Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nbaua/nest-mongo-auth-role-starter
A starter code for NestJS REST API using Mongoose, implements the authentication and role guards.
https://github.com/nbaua/nest-mongo-auth-role-starter
authentication mongodb mongodb-database mongoose nestjs nestjs-backend node nodejs rolebased typescript
Last synced: about 6 hours ago
JSON representation
A starter code for NestJS REST API using Mongoose, implements the authentication and role guards.
- Host: GitHub
- URL: https://github.com/nbaua/nest-mongo-auth-role-starter
- Owner: nbaua
- Created: 2021-06-17T12:28:25.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-06-18T03:48:56.000Z (over 3 years ago)
- Last Synced: 2024-11-14T21:30:12.634Z (2 months ago)
- Topics: authentication, mongodb, mongodb-database, mongoose, nestjs, nestjs-backend, node, nodejs, rolebased, typescript
- Language: TypeScript
- Homepage:
- Size: 91.8 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## NestJS-Mongo Authentication Starter Extended Version
A starter code for NestJS REST API authentication using Mongo(ose/DB), aiming at quick start on the project, Being the authentication is a most tedious activity for any project.
This starter code allows you to focus on the other project aspects, while providing Auth guard and Role guard implemented.This repository contains the following features.
- As NestJs FW project, a separation of concern is always present.
- Implements the JWT based authentication using passport middleware.
- Implements role based security on top of the authentication model.
- Implements custom guards and strategies.
- Global Validation Pipe supported with option to override the same with custom validations.
- CORS Enabled and Logged operations with Nest console logger.
- Minimal implementation, allowing you to extend the project the way you want.### You would require to create .env file in the project root with the following entries
```
MONGO_URI=mongodb://localhost:27017/
JWT_SECRET=```