Nest framework TypeScript boilerplate with PassportJS authentication, GraphQL and OpenAPI docs integrations.
This repository has been archived as we consider the use of TypeORM to lead to technical debt in modern web projects. Instead we recommend checking out the MikroORM based starter with an otherwise identical setup.
- Uses code-first GraphQL
- Uses TypeORM for entities and migrations
- Properly configures
ormconfig.js
for runtime synchronization 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
.env
JWT_KEY=<your-jwt-key-here>
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",
},
};
$ yarn
# development
$ yarn start
# watch mode
$ yarn start:dev
# production mode
$ yarn start:prod
# unit tests
$ yarn test
# e2e tests
$ yarn test:e2e
# test coverage
$ yarn test:cov
This boilerplate remains true to Nest and is MIT licensed.