Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ndrwbv/nestjs-postgres-auth-roles
NestJS boilerplate with JWT, postgres and roles guard
https://github.com/ndrwbv/nestjs-postgres-auth-roles
nestjs postgres token token-authetication
Last synced: 2 months ago
JSON representation
NestJS boilerplate with JWT, postgres and roles guard
- Host: GitHub
- URL: https://github.com/ndrwbv/nestjs-postgres-auth-roles
- Owner: ndrwbv
- License: mit
- Created: 2020-03-27T04:11:45.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-24T01:43:58.000Z (about 2 years ago)
- Last Synced: 2023-03-02T14:51:16.424Z (almost 2 years ago)
- Topics: nestjs, postgres, token, token-authetication
- Language: TypeScript
- Homepage:
- Size: 3.33 MB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NestJS boilerplate
- nestJS
- postgres
- docker
- JWT Auth
- role guardInspired by https://github.com/bashleigh/nestjs-blog
## Use
- Start the postgres container using docker
```bash
$ docker-compose up -d
```- Start the nestjs process using to following
```bash
$ yarn start
```### Production
If you're going to use this example in production (or your own verison of it) it's recommended to run using the 'complied' JS version from dist. You can do this by using the following command
```bash
$ yarn start:prod
```> This command will also clean and build your dist folder
## Development
For development, the best command to use is
```bash
$ yarn dev
```This will start nodemon to reload our script when there's been any changes in the src directory
## Testing
#### Unit testing
Unit tests can be ran by simply using the `test` script
```bash
$ yarn test
```This will run jest on all `.spec.ts` files.
#### End to End testing (E2E)
End to end tests can be run by using the following command
```bash
$ yarn test:e2e
```this will run jest on all `.e2e-spec.ts` files.
#### Coverage
Use jest to show you a coverage of your tests
```bash
$ yarn test:cov
```## Build your own NestJS application
Want to get started on your own NestJS application? Simply install the [nest-cli](https://github.com/nestjs/nest-cli) `npm i -g @nestjs/cli` and use the command `nest new my-application` to create a new directory called `my-application` with nestjs ready to go!
# Packages
- Nestjs
- [@nestjs/typeorm](https://github.com/nestjs/typeorm) A typeorm module for nestjs
- [@nestjs/passport](https://github.com/nestjs/passport) An easy to use module for passport include AuthGuards
- [@nestjs/jwt](https://github.com/nestjs/jwt) A JWT module for nestjs
- nestjs-community
- [nestjs-config](https://github.com/nestjs-community/nestjs-config) A config module for nestjs (envs)
- [typeorm](https://github.com/typeorm/typeorm) typeorm is an orm for TypeScript