Skip to content

fullstackship/ultimate-nx-monorepo

Repository files navigation

Ultimate Monorepo Project with NX, Xplat and Nxtend


This Github repo is to setup Ultimate Monorepo project for Angular, React, Ionic , Capacitor , Vue, Plain WebComponent, Node/Express, NestJS and more (soon).

Just Clone this Github Repo and 'npm install' if you don't have time to setup one by one.

- Github : https://github.com/fullstackship/ultimate-nx-monorepo

Note that I tested based on Node 12.16.1 version and NPM(6.14.X).


FYI, the setup process is actually all about Angular-Schematics.



Setup Projects for Mono Repo

1. Setup NX Workspace

  • npx create-nx-workspace@latest

    • Choose 'empty' and 'NX CLI'

2. Setup Angular packages

3. Setup React

4. Setup Vue.js

5. Setup WebComponent

6. Setup Vue

7. Setup Ionic/Angular with Xplat

8. Setup Ionic-React and Capacitor with @nxtend

  • Setup Ionic/React

    • npm install -D --exact @nxtend/ionic-react
      • nx generate @nxtend/ionic-react:init
    • nx generate @nxtend/ionic-react:application ionic-react
  • Install Capacitor Plugin

    • npm install -D --exact @nxtend/capacitor
    • nx generate @nxtend/capacitor:init
  • Add Capacitor to Existing Project

    • nx generate @nxtend/capacitor:capacitor-project ionic-react-cap --project ionic-react
  • Add Native Platform

    • nx run ionic-react:build
    • nx run ionic-react-cap:add --platform=android
    • nx run ionic-react-cap:add --platform=ios
  • Sync Native Platform

    • nx run {Capacitor project name}:sync --platform {native platform}
    • nx run ionic-react-cap:sync --platform android
  • Open Native Platform(Android Studio or XCode)

    • nx run ionic-react-cap:open --platform=android
    • nx run ionic-react-cap:open --platform=ios
  • Check for more detail

9. Setup Node/Express

10. Setup NestJS

- npm install -D @nrwl/nest

- nx g @nrwl/nest:app nest-api 

- Check for more detail 
  
  - https://nx.dev/angular/tutorial/05-add-node-app 

TODO

  • electron
  • chrome-extension
  • react-native

Running Xplat Ionic app

  • nx serve ionic-myapp

    • If you have ERROR with paths, you have some options to resolve the issues.
    • It happens because vscode needs some time to re-index the folder packages and files.(It may take long)

      • Restart TS Server

      • Restart Angular Language Server

      • Change the paths mannually

      • For example, @import '~@nx-base/scss/index'; --> @import '../../../libs/scss/index';

  • You should see this screen if you have no Error during starting the Ionic app.

About

Ultimate Monorepo Project with NX, Xplat and Nxtend

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published