Nx + Angular + NestJS mono-repository starter with workflow automation.
| Trigger | Badge |
|---|---|
| PR open event (destination: trunk) | |
| PR merge event (destination: trunk) | |
| Manual | |
| Manual | |
| Scheduled (weekly) | |
| Manual, Scheduled (weekly) |
In order to run own copy of the project one must fulfill the following requirements.
- Debian based Linux - recommended, check out this dev setup instructions to facilitate getting started
- OSX
Windows-poorly supported
- Yarn - preferred package manager for dependencies installation in the project root.
- npm - preferred package manager for dependencies installation in the
functionsfolder.
The project has lots of package scripts, check it in the package.json located in the project root, or use the following command (see terminal output for usage tips)
yarn workspace:helpUsing commitizen cli is mandatory.
Provided all dependencies are installed, and commitizen cli is installed as a global dependency, this command must be used.
git czIs generated based on GitHub repo.
Applications as well as generated documentation, testing reports, and a custom changelog are deployed to Firebase.
yarn workspace:schematic client-feature client-<feature-name> --tags=scope:client-<feature-name>,type:featureyarn workspace:schematic client-ui client-ui-<feature-name> --tags=scope:client-ui-<feature-name>,type:uiyarn workspace:schematic client-store client-store-<feature-name> --tags=scope:client-store-<feature-name>,type:data-accessyarn workspace:schematic client-util client-util-<feature-name> --tags=scope:client-util-<feature-name>,type:utilThis project was generated using Nx.
🔎 Nx is a set of Angular CLI power-ups for modern development.
Nx supports many plugins which add capabilities for developing different types of applications and different tools.
These capabilities include generating applications, libraries, .etc as well as the devtools to test, and build projects as well.
Below are some plugins which you can add to your workspace:
| Application type | Command |
|---|---|
| Angular | ng add @nrwl/angular |
| React | ng add @nrwl/react |
| Web (no framework frontends) | ng add @nrwl/web |
| Nest | ng add @nrwl/nest |
| Express | ng add @nrwl/express |
| Node | ng add @nrwl/node |
| Storybook | ng add @nrwl/storybook |
To generate an application run:
ng g @nrwl/angular:app my-appYou can use any of the plugins above to generate applications as well.
When using Nx, you can create multiple applications and libraries in the same workspace.
To generate a library run:
ng g @nrwl/angular:lib my-libYou can also use any of the plugins above to generate libraries as well.
Libraries are sharable across libraries and applications.
It can be imported from @nx-ng-starter/mylib.
To start a dev server run:
ng serve my-appNavigate to http://localhost:4200/.
The app will automatically reload if you change any of the source files.
To generate a new component run:
ng g component my-component --project=my-appTo build the project run:
ng build my-appThe build artifacts will be stored in the dist/ directory.
Use the --prod flag for a production build.
Unit testing with Jest
To execute the unit tests run:
ng test my-appTo execute the unit tests affected by a change run:
npm run affected:testEnd-to-end testing with Cypress
To execute the end-to-end tests run:
ng e2e my-appTo execute the end-to-end tests affected by a change run:
npm run affected:e2eTo see a diagram of the dependencies of your projects run:
npm run dep-graphnpx nx g @nrwl/angular:storybook-configuration project-nameng run tools:helpVisit the Nx Documentation to learn more.
