Giter VIP home page Giter VIP logo

nextjs-tailwind-ionic-capacitor-starter's Introduction

Ionic - Nextjs - Tailwind - Capacitor

Description

This is an Ionic - Nextjs - Tailwind - Capacitor App.

Reading List

Stack Framework Layers

example

Requirements


Setup Part 1

There are 6 steps to follow to initialise this project.

OR Simply use command npm run build:all to run all the init steps. Once finished you can proceed to Setup Part 2

Open /capacitor-android/manifests/AndroidManifest.xml and make sure your XML config contains the following:

  1. First we need the Ionic Client.
  • npm install -g @ionic/cli
  • npm install -g @ionic/cli native-run

  1. Now lets install all the dependencies.
  • npm i

  1. We will then need to run the build which will create the .next build folder in or project.
  • npm run build

  1. This next step is crucial! We to export our build as static which can be run standalone without the need of a Node.js server. But also it creates the out directory that we need before we can include our native device builds.
  • npm run export

  1. Ok so now we can let Capacitor which platforms we want to build on.
  • npx cap add ios
  • npx cap add android

  1. Time to rebuild nextjs, export it, and copy it to the native projects.
  • npm run build
  • npm run export
  • npx cap copy

Setup Part 2

Now all is built we need to add some code manually.

Open file ./android/app/build.gradle, you will see something similiar to:

android {
   ...
   defaultConfig {
      ...
   }
}

Add the code below inside defaultConfig, If its not already there.

aaptOptions {
   // Without this Android apps just wont work... Read more:
   // https://github.com/ionic-team/capacitor/commit/c23d99315acea2f0894e5ff8a08dd42a867b2982
   ignoreAssetsPattern '!.svn:!.git:!.ds_store:!_.scc:._:!CVS:!thumbs.db:!picasa.ini:!*~'
}

Environments Commands

Development

  • Web: npm run dev:web
  • IOS (Mac): npm run dev:ios
  • IOS (Windows): Ionic Appflow or alternative
  • Android: npm run dev:android
  • Web on LAN Network: npm run dev:network

Production

  • Web: npm run start
  • IOS: This will need to be handled via Xcode or Ionic Appflow.
  • Android: This is handled in Android Studio apk release.

Important Notes

  • When adding a new Capacitor plugin it is essential that you perform the following command: npx cap sync
  • To use the Google Fit for Android, you need an OAuth 2.0 client ID for Android applications. Link1.
  • Cordova Capacitor plugin variables. Link1
  • Cordova Capacitor Deep Dive. Link1

Production

You MUST remove this from capacitor.config.json file

  "server": {
    "url": "http://192.168.0.44:3000"
  }

Production Reading:

nextjs-tailwind-ionic-capacitor-starter's People

Contributors

jhurley-bd avatar vonswirl avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.