This application is to be used as an exemplary setup for NestJs using modern best practices such as TDD, CI/CD and Aspect Oriented Programming.
The concept is to have a single controller entrypoint that dynamically resolves the required service. In this application design, the dynamic providers are the unique VEHIKL offices (forest-city
, kw
, hammer-squad
) which each have their own unique interfaces and interaction methods.
The resolved service provider supports a common interface and data shape.
- Ensure you are using the correct version of node by running
nvm use
- Install dependencies using
yarn
- There yah go!
There are two different debugging scenarios:
To debug the running application run :
yarn debug:api
Then connect your vscode debugger by using the included launch.json
configuration for Debug Nest App
.
Boom!
To debug your test suite, run the included configuration in the launch.json
for Jest Tests
.
Run nx build my-app
to build the project. The build artifacts will be stored in the dist/
directory. Use the --prod
flag for a production build.
Run nx test my-app
to execute the unit tests via Jest.
Run nx affected:test
to execute the unit tests affected by a change.
Run ng e2e my-app
to execute the end-to-end tests via Cypress.
Run nx affected:e2e
to execute the end-to-end tests affected by a change.
Run nx dep-graph
to see a diagram of the dependencies of your projects.
Visit the Nx Documentation to learn more.
Continuous Integration (CI) has been setup using GitHub Actions. Please refer to the ci.yml file for specifics.
Linting and tests are executed, and a test coverage report is posted to the corresponding PR.
The current CI build
status is displayed on the README as a badge:
(If the above is red, someone screwed up.)
Coverage reports are posted as an autogenerated PR comment, if the CI pipeline is configured with a valid NX_GITHUB_API_TOKEN
.
To run the coverage report locally, it is easiest done with
yarn test:api:coverage