Skip to content

A NestJS boilerplate with authentication, GraphQL and MikroORM.

License

Notifications You must be signed in to change notification settings

Jenyus-Org/nestjs-auth-graphql-mikroorm-starter

Repository files navigation

Jenyus Logo

Description

A fork of the Nest framework TypeScript boilerplate by Jenyus with PassportJS authentication, GraphQL and OpenAPI docs integrations using MikroORM.

Setup

  • Uses code-first GraphQL
  • Uses MikroORM for entities and migrations
  • Implements refresh token based auth flow
  • Uses PassportJS and JWT for authentication
  • Custom Prettier and ESLint config
  • Uses @jenyus-org/nestjs-graphql-utils to optimize queries and solve the N+1 problem

Configuration Files

Environment Variables

.env

JWT_KEY=<your-jwt-key-here>

TypeORM

ormconfig.js

const { join } = require("path");

module.exports = {
  type: "sqlite",
  synchronize: true,
  entities: ["dist/**/*.entity.js"],
  database: "tmp/data.sqlite",
  migrations: [join(__dirname, "database", "migrations", "*.ts")],
  cli: {
    migrationsDir: "src/database/migrations",
  },
};

Installation

$ yarn

Running the app

# development
$ yarn start

# watch mode
$ yarn start:dev

# production mode
$ yarn start:prod

Test

# unit tests
$ yarn test

# e2e tests
$ yarn test:e2e

# test coverage
$ yarn test:cov

License

This boilerplate remains true to Nest and is MIT licensed.

About

A NestJS boilerplate with authentication, GraphQL and MikroORM.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published