├── .env.example ├── .env.test ├── .eslintrc.js ├── .gitignore ├── .husky └── pre-commit ├── .prettierrc ├── README.md ├── db └── migrations │ └── 1647339231280-table_user.ts ├── docker-compose.yml ├── nest-cli.json ├── ormconfig.js ├── package.json ├── src ├── app.module.ts ├── auth │ ├── auth.module.ts │ ├── controllers │ │ └── auth.controller.ts │ ├── decorators │ │ ├── public.decorator.ts │ │ └── roles.decorator.ts │ ├── dto │ │ └── login.dto.ts │ ├── guards │ │ ├── jwt-auth.guard.ts │ │ ├── jwt-refresh.guard.ts │ │ ├── local-auth.guard.ts │ │ └── roles.guard.ts │ ├── models │ │ ├── roles.model.ts │ │ └── token.model.ts │ ├── services │ │ └── auth.service.ts │ └── strategies │ │ ├── jwt-refresh.strategy.ts │ │ ├── jwt.strategy.ts │ │ └── local.strategy.ts ├── config.ts ├── environments.ts ├── main.ts ├── users │ ├── controllers │ │ └── users.controller.ts │ ├── dto │ │ └── create-user.dto.ts │ ├── entities │ │ └── user.entity.ts │ ├── services │ │ └── users.service.ts │ └── users.module.ts └── utils │ └── entities │ └── default.entity.ts ├── test ├── app.e2e-spec.ts ├── jest-e2e.json └── utils.ts ├── tsconfig.build.json └── tsconfig.json /.env.example: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jordicher/nestjs-typeorm-auth-template/HEAD/.env.example -------------------------------------------------------------------------------- /.env.test: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jordicher/nestjs-typeorm-auth-template/HEAD/.env.test -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jordicher/nestjs-typeorm-auth-template/HEAD/.eslintrc.js -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jordicher/nestjs-typeorm-auth-template/HEAD/.gitignore -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | npx lint-staged 5 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jordicher/nestjs-typeorm-auth-template/HEAD/.prettierrc -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jordicher/nestjs-typeorm-auth-template/HEAD/README.md -------------------------------------------------------------------------------- /db/migrations/1647339231280-table_user.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jordicher/nestjs-typeorm-auth-template/HEAD/db/migrations/1647339231280-table_user.ts -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jordicher/nestjs-typeorm-auth-template/HEAD/docker-compose.yml -------------------------------------------------------------------------------- /nest-cli.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jordicher/nestjs-typeorm-auth-template/HEAD/nest-cli.json -------------------------------------------------------------------------------- /ormconfig.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jordicher/nestjs-typeorm-auth-template/HEAD/ormconfig.js -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jordicher/nestjs-typeorm-auth-template/HEAD/package.json -------------------------------------------------------------------------------- /src/app.module.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jordicher/nestjs-typeorm-auth-template/HEAD/src/app.module.ts -------------------------------------------------------------------------------- /src/auth/auth.module.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jordicher/nestjs-typeorm-auth-template/HEAD/src/auth/auth.module.ts -------------------------------------------------------------------------------- /src/auth/controllers/auth.controller.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jordicher/nestjs-typeorm-auth-template/HEAD/src/auth/controllers/auth.controller.ts -------------------------------------------------------------------------------- /src/auth/decorators/public.decorator.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jordicher/nestjs-typeorm-auth-template/HEAD/src/auth/decorators/public.decorator.ts -------------------------------------------------------------------------------- /src/auth/decorators/roles.decorator.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jordicher/nestjs-typeorm-auth-template/HEAD/src/auth/decorators/roles.decorator.ts -------------------------------------------------------------------------------- /src/auth/dto/login.dto.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jordicher/nestjs-typeorm-auth-template/HEAD/src/auth/dto/login.dto.ts -------------------------------------------------------------------------------- /src/auth/guards/jwt-auth.guard.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jordicher/nestjs-typeorm-auth-template/HEAD/src/auth/guards/jwt-auth.guard.ts -------------------------------------------------------------------------------- /src/auth/guards/jwt-refresh.guard.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jordicher/nestjs-typeorm-auth-template/HEAD/src/auth/guards/jwt-refresh.guard.ts -------------------------------------------------------------------------------- /src/auth/guards/local-auth.guard.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jordicher/nestjs-typeorm-auth-template/HEAD/src/auth/guards/local-auth.guard.ts -------------------------------------------------------------------------------- /src/auth/guards/roles.guard.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jordicher/nestjs-typeorm-auth-template/HEAD/src/auth/guards/roles.guard.ts -------------------------------------------------------------------------------- /src/auth/models/roles.model.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jordicher/nestjs-typeorm-auth-template/HEAD/src/auth/models/roles.model.ts -------------------------------------------------------------------------------- /src/auth/models/token.model.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jordicher/nestjs-typeorm-auth-template/HEAD/src/auth/models/token.model.ts -------------------------------------------------------------------------------- /src/auth/services/auth.service.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jordicher/nestjs-typeorm-auth-template/HEAD/src/auth/services/auth.service.ts -------------------------------------------------------------------------------- /src/auth/strategies/jwt-refresh.strategy.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jordicher/nestjs-typeorm-auth-template/HEAD/src/auth/strategies/jwt-refresh.strategy.ts -------------------------------------------------------------------------------- /src/auth/strategies/jwt.strategy.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jordicher/nestjs-typeorm-auth-template/HEAD/src/auth/strategies/jwt.strategy.ts -------------------------------------------------------------------------------- /src/auth/strategies/local.strategy.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jordicher/nestjs-typeorm-auth-template/HEAD/src/auth/strategies/local.strategy.ts -------------------------------------------------------------------------------- /src/config.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jordicher/nestjs-typeorm-auth-template/HEAD/src/config.ts -------------------------------------------------------------------------------- /src/environments.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jordicher/nestjs-typeorm-auth-template/HEAD/src/environments.ts -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jordicher/nestjs-typeorm-auth-template/HEAD/src/main.ts -------------------------------------------------------------------------------- /src/users/controllers/users.controller.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jordicher/nestjs-typeorm-auth-template/HEAD/src/users/controllers/users.controller.ts -------------------------------------------------------------------------------- /src/users/dto/create-user.dto.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jordicher/nestjs-typeorm-auth-template/HEAD/src/users/dto/create-user.dto.ts -------------------------------------------------------------------------------- /src/users/entities/user.entity.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jordicher/nestjs-typeorm-auth-template/HEAD/src/users/entities/user.entity.ts -------------------------------------------------------------------------------- /src/users/services/users.service.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jordicher/nestjs-typeorm-auth-template/HEAD/src/users/services/users.service.ts -------------------------------------------------------------------------------- /src/users/users.module.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jordicher/nestjs-typeorm-auth-template/HEAD/src/users/users.module.ts -------------------------------------------------------------------------------- /src/utils/entities/default.entity.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jordicher/nestjs-typeorm-auth-template/HEAD/src/utils/entities/default.entity.ts -------------------------------------------------------------------------------- /test/app.e2e-spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jordicher/nestjs-typeorm-auth-template/HEAD/test/app.e2e-spec.ts -------------------------------------------------------------------------------- /test/jest-e2e.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jordicher/nestjs-typeorm-auth-template/HEAD/test/jest-e2e.json -------------------------------------------------------------------------------- /test/utils.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jordicher/nestjs-typeorm-auth-template/HEAD/test/utils.ts -------------------------------------------------------------------------------- /tsconfig.build.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jordicher/nestjs-typeorm-auth-template/HEAD/tsconfig.build.json -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jordicher/nestjs-typeorm-auth-template/HEAD/tsconfig.json --------------------------------------------------------------------------------