Clone this repo. Edit the env file and pass in your credentials
Install dependencies
yarn
The example codebase uses MikroORM with a Postgres database.
Copy MikroORM config example file and adjust the connection settings and other settings(jwt,redism,mail,etc) respectively on sample env file
Start local Postgres server and run NODE_ENV=dev yarn orm:up
to apply migrations
Now you can start the application witt `NODE_ENV=dev yarn start.
Note: Env files are kept in env folder. The config validation allows 4 environment ['dev', 'prod', 'test','stage']. The env file name should be of format .env.[environment] Ex. (.env.test). The env to use should be provided while running any script as NODE_ENV=dev npm run dev
Faetures covered:
- i18n
- seeding and factories for fake data
- roles
- threads for cpu extensive tasks
- refresh tokens support
- email templates with
eta
- adminjs support
- twillio
yarn start
- Start applicationyarn start:watch
- Start application in watch modeyarn test
- run Jest test runneryarn start:prod
- Build application
yarn start
- Test api by browsing to
http://localhost:[port]/v1/user
- View automatically generated swagger api docs by browsing to
http://localhost:[port]/docs
This applications uses JSON Web Token (JWT) to handle authentication. The token is passed with each request using the Authorization
header with Token
scheme. The JWT authentication middleware handles the validation and authentication of the token.