Skip to content
/ ultimate-nest Public template
forked from rubiin/ultimate-nest

Starter template with blog clone as project

License

Notifications You must be signed in to change notification settings

cyjme/ultimate-nest

Repository files navigation

Nest Logo

Blog made using Nestjs + Mikro-orm codebase(backend) containing real world examples (CRUD, auth, advanced patterns, etc)

CI

Getting started

Clone this repo. Edit the env file and pass in your credentials

Installation

Install dependencies

 yarn

Database

Mikro Orm

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:

  1. i18n
  2. seeding and factories for fake data
  3. roles
  4. threads for cpu extensive tasks
  5. refresh tokens support
  6. email templates with eta
  7. adminjs support
  8. twillio

NPM scripts

  • yarn start - Start application
  • yarn start:watch - Start application in watch mode
  • yarn test - run Jest test runner
  • yarn start:prod - Build application

Start 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

Authentication

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.

About

Starter template with blog clone as project

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 97.7%
  • Other 2.3%