Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/techreagan/nodejs-and-expressjs-with-mongodb-boilerplate
This is my boilerplate for RESTful API with NodeJS and MongoDB
https://github.com/techreagan/nodejs-and-expressjs-with-mongodb-boilerplate
boilerplate expressjs jwt mongodb mongoosejs nodejs npm npm-package restful restful-api typescript
Last synced: 27 days ago
JSON representation
This is my boilerplate for RESTful API with NodeJS and MongoDB
- Host: GitHub
- URL: https://github.com/techreagan/nodejs-and-expressjs-with-mongodb-boilerplate
- Owner: techreagan
- Created: 2020-01-14T23:03:14.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-09-27T02:55:03.000Z (about 2 years ago)
- Last Synced: 2024-10-11T12:04:22.512Z (27 days ago)
- Topics: boilerplate, expressjs, jwt, mongodb, mongoosejs, nodejs, npm, npm-package, restful, restful-api, typescript
- Language: TypeScript
- Homepage:
- Size: 74.2 KB
- Stars: 10
- Watchers: 3
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NodeJS / ExpressJS MongoDB(Mongoose) Boilerplate
This is my boilerplate for RESTful API with NodeJS and MongoDB.
## Boilerplate Folders
- advance typescript - typescript version that uses decorators for the boilerplate
- basic typescript - typescript version of the boilerplate
- vanilla js - vanilla javascript boilerplate## Boilerplate Features
- Authentication with JWT
- Reset Password with email (Using mailtrap for email testing)
- Email verification (Using mailtrap for email testing)
- User Create, Read, Update and Delete (CRUD) operations
- API Security (NoSQL Injections, XSS Attacks, http param pollution etc)## Configuration File
Modify the config/.env file to your environment variables, set your JWT_SECRET and SMTP variables
```ENV
NODE_ENV=development
PORT=3001MONGO_URI=YOUR_URL
JWT_SECRET=YOUR_SECRET
JWT_EXPIRE=30d
JWT_COOKIE_EXPIRE=30#In Minutes
RESET_PASSWORD_EXPIRATION_TIME=10
EMAIL_VERIFICATION_EXPIRATION_TIME=10SMTP_HOST=smtp.mailtrap.io
SMTP_PORT=2525
SMTP_EMAIL=
SMTP_PASSWORD=
[email protected]
FROM_NAME=Boilerplate
```## Installation
Install all npm dependecies
```console
npm install
```Install nodemon globally
```console
npm install -g nodemon
```Run database seeder
```console
node seeder -i
```Delete all data
```console
node seeder -d
```## Run Boilerplate
```console
node run dev
```## License
This project is licensed under the MIT License