Skip to content

Repository files navigation

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads CircleCI Coverage Discord Backers on Open Collective Sponsors on Open Collective Support us

Description

NestJs-Authentication starter.

Prerequisites

  • MySQL is the world's most popular open source database.
  • Node is a JavaScript runtime built on Chrome's V8 JavaScript engine.
  • vscode is a Text Editor

Setup

  1. Clone the repository git clone <repo>
  2. Cd into the project root directory
  3. Load the code into vscode
  4. Install the app
  5. Create Database schema in either MySQL, Postgres or MongoDb
  6. Create .env and .env.testing files in the project root folder
  7. This step is optional. Modify the database settings in app.module.ts. For instance, you could change type value in the config property to either postgres or mysql

Examples

.env and .env.testing should contain the variables below. Make sure there is no space after the values of each variables

  NODE_ENV=
  PORT=
  HOST=
  DATABASE_NAME=
  DATABASE_USERNAME=
  DATABASE_PASSWORD=
  DATABASE_PORT=
  APP_SECRET=
  APP_JWT_EXPIRATION=

Database module config example in app.module.ts

  DatabaseModule.forRoot({
        config: {
          databaseType: 'relational' || 'document',
          type: 'mysql' || 'postgres' || 'mongodb',
          orm: 'typeorm' || 'sequelize' || '',
        },
        useClass: ConfigService,
  }),
  ...

Installation

$ npm install

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Support

Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.

Stay in touch

License

Nest is MIT licensed.

About

NestJs authentication and authorization starter

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages