A NestJS App with Login, Signup feature, with latest technology, tools, and best practices.
-
[JWT] - JWT Login, and Refresh Token setup
-
[Cors Origin] - Allow only given origin
-
[Helmet] - Helmet can help protect your app from some well-known web vulnerabilities by setting HTTP headers appropriately. Generally, Helmet is just a collection of smaller middleware functions that set security-related HTTP headers
-
[Throttling] - to protect app from brute-force attacks
-
[Response Interceptors] - Interceptors for response handling
-
[Env Config] - Env Config Service for easy and env access & env variables validation with Joi
-
[Logging] - Added Logger Module to print Logs
-
[Prisma ORM] - using Prisma for efficient database handling
-
[MongoDB] - using MongoDB for user database
-
[ESlint] and [Prettier] - For clean, consistent, and error-free code
-
[Jest] - For rock-solid unit tests
-
[Husky] - For Git Hooks, having auto commit check, lint-staged, and running tests on commit.
-
[Lint-Staged] - For linting and prettier
-
[Import Resolver] - For auto import resolve on save
To get started with this app, follow these steps:
- Fork & clone repository:
## Don't forget to ⭐ star and fork it first :)
git clone https://github.com/smyaseen/backend.git
- Add ENV variables
NODE_ENV=development or production
DATABASE_URL
SECRETKEY=
JWT_ACCESS_SECRET
JWT_REFRESH_SECRET
APP_LOGS=true
LOG_LEVEL=log
CORS_ORIGIN="http://localhost:5173"
- Install the dependencies:
npm install
- Run the development server:
npm run start:dev
- This project uses a git hook to enforce. To install the git hook, run the following command in the root directory of the project:
npm run prepare
- Unit tests: Run Jest tests using
npm run coverage