# prepare app
$ npm install
$ docker-compose up
# use for development (also watches for changes!)
$ npm run dev
# use for production
$ npm run build
$ npm run start
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
Start the app and visit /docs
if you are a human , or /docs-json
if you are a machine.
The app follows the principals of domain-driven design, i.e., placing the project's primary focus on the core domain and domain logic.
The app is divided into logical units, so called modules
, each of which represents a bounded context. You will find the following modules:
- project
- user
- notification
- app (no domain)
- shared (no domain, seedwork)
- cache
- config
- event
- object-mapper
- object-storage
- serialization
- session
- telemetry
- token
- typeorm
- utility
Each module follows a 3 tier architecture:
Figure from a dotnet DDD microservice article.
You can use the supplied docker compose file. Just run:
$ docker-compose up --detach
Error: The postgres extension "pg_trgm" is not installed. An administrator should install the extension: "CREATE EXTENSION pg_trgm;"
Connect to your local postgres intance (psql postgres://covee-saas:password@localhost:5432/covee-saas
) and run CREATE EXTENSION pg_trgm;
.
Create an .env
file and specify your custom environment variables. The .env
file is ignored and will not be commited.
4. Setup email environment outside of mailslurper
Any smtp server works for this. Mailjet offers 200 emails/day for free. Go ahead and create a new account with them.
Set the following variables in your .env
file:
SMTP_URL="smtps://<mj-smtp-api-key>:<mj-smtp-secret>@in-v3.mailjet.com"
EMAIL_SENDER="Covee Network <[email protected]>"
The EMAIL_SENDER
should be the email address you used to register on mailjet.