Nx + Angular + NestJS mono-repository starter with workflow automation.
| Trigger | Badge | |
|---|---|---|
| ℹ️ | Manual, Scheduled (weekly) | |
| ℹ️ | Manual | |
| ℹ️ | PR merge event (destination: trunk) | |
| ℹ️ | Manual | |
| ℹ️ | PR merge event (destination: trunk) | |
| ℹ️ | Scheduled (weekly) | |
| ℹ️ | PR open event (destination: trunk) |
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 setting up the dev environment;
- given that the dev environment is set up, the command
yarn install:all:linuxshould install everything needed to work with the project;
- 🆗 OSX -
should work due to similarity to Linux- one will have to figure out oneself how to set up the dev environment;
- given that the dev environment is set up, the command
yarn install:all:osxshould install everything needed to work with the project; - the automation scripts support the OS with relatively high probability, but it has not been tested;
- 🤷 Windows -
should work, but no guarantees- one will have to figure out oneself how to set up the dev environment;
- one will have to figure out oneself how to install
protolint, see available installation options; - given that the dev environment is set up, the following commands should be used to install
shellcheckvia PowerShell;iwr -useb get.scoop.sh | iex scoop install shellcheck
- recommended shell: Git for Windows >
Git BASH; - configure Git to use LF as a carriage return
git config --global core.autocrlf false git config --global core.eol lf
- 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)
npx nx run tools: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 czThe GitBook documentation is generated based on this GitHub repo.
Application deployments and autogenerated engineering documentation.
npx nx generate client-feature client-<feature-name> --tags=scope:client-<feature-name>,type:featurenpx nx generate client-ui client-<feature-name> --tags=scope:client-<feature-name>,type:uinpx nx generate client-store client-store-<feature-name> --tags=scope:client-store-<feature-name>,type:data-accessnpx nx generate client-util client-util-<feature-name> --tags=scope:client-util-<feature-name>,type:utilnpx nx generate module-boundariesThis 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 plugins which are added to the workspace:
| Application type | Command | Domain |
|---|---|---|
| Angular | nx add @nx/angular |
Web client |
| Nest | nx add @nx/nest |
API |
| Node | nx add @nx/node |
Automation |
| Storybook | nx add @nx/storybook |
UI testing |
| Cypress | nx add @nx/cypress |
E2E testing |
| Jest | nx add @nx/jest |
Unit testing |
To generate an application run:
npx nx g @nx/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:
npx nx g @nx/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:
npx nx 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:
npx nx g @nx/angular:component my-component --project=my-appTo build the project run:
npx nx 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:
npx nx test my-appTo execute the unit tests affected by a change run:
npx nx affected:testEnd-to-end testing with Cypress
To execute the end-to-end tests run:
npx nx e2e my-appTo execute the end-to-end tests affected by a change run:
npx nx affected:e2eTo see a diagram of the dependencies of the projects run:
npx nx dep-graphnpx nx g @nx/angular:storybook-configuration project-namePrint supported workspace commands
npx nx run tools:helpVisit the Nx Documentation to learn more.