Use this template to bootstrap the creation of NestJS Microservice in Gotrade 🚀
This README should not be edited, please edit README.TPL.MD
instead.
- Nix: Environment Management
- direnv: Environment Loader
- Taskfile: Task runner
- Nest.js: API Server
- MikroORM: ORM
- Vitest: Test framework
- Dependabot: Dependency Linter
- Semantic Releaser with Conventional Commit: Continuous Delivery
- Infrastructure
- Linters
- Formatters
- Pre-commit
Click the Use this Template
and provide the new repo details for your action
All dependencies are pre-install via nix
and activated via direnv
Setup the repository. This is automatically executed if you have direnv
pls setup
Running unit tests
pls test
The task runner has convenience commands for development
Action | Command |
---|---|
Setup the repository | pls setup |
Start development | pls dev |
Build typescript project | pls build |
Clean all artifacts | pls clean |
Preview the built project locally | pls preview |
Remove all development artifacts in cluster | pls stop:dev |
Remove all test artifacts in cluster | pls stop:test |
Tear development cluster | pls tear:dev |
Tear test cluster | pls tear:test |
The task runner has convenience commands for testing
Action | Command | Alias |
---|---|---|
Run unit test | pls test:unit |
pls test |
Watch unit test | pls test:unit:watch |
pls test:watch |
Unit Test Coverage | pls test:unit:cover |
- |
Run integration test | pls test:int |
- |
Watch integration test | pls test:int:watch |
- |
Integration Test Coverage | pls test:int:cover |
- |
Generate Test Reports | pls test:report |
- |
You can additionally filter tests by adding the filter (contains):
pls test:int -- fast
The above will only run test file names containing the word fast
You can check Taskfile.yml
and tasks
folder for more commands.
The task runner has convenience commands for docker and helm charts.
Please note that helm chart commands are scoped to landscapes
, i.e. there
are the same command for each landscape.
Action | Command |
---|---|
Debug the chart | pls helm:<landscape>:debug |
Update dependency | pls helm:<landscape>:dep |
Install/Upgrade the chart in current context and namespace | pls helm:<landscape>:install |
Synchronize config file with helm chart | pls helm:<landscape>:sync |
Uninstall the chart | pls helm:<landscape>:remove |
Build production docker image | pls docker:prod |
Build development docker image | pls docker:dev |
Build test docker image | pls docker:test |
Build migration docker image | pls docker:migrate |
The task runner has convenience commands for ORM to manage the databases.
Please note that orm commands are scoped to database names, i.e. there are the same command for each database name.
There are multiple database commands, please check Taskfile.yml
and tasks
folder for more commands.
The one listed here are the most common commands.
Action | Command |
---|---|
Debug ORM | pls orm:<database>:debug |
Migrate | pls orm:<database>:migration:up |
Create Migration | pls orm:<database>:migration:create |
Run seeders | pls orm:<database>:seeder:run |
Create new seeder | pls orm:<database>:seeder:create |
The task runner has convenience commands for basic quality assurance
Action | Command |
---|---|
Run all Checks | pls check |
You can check Taskfile.yml
and tasks
folder for more commands.