A boilerplate/starter project for quickly building production-ready RESTful APIs using Node.js, Express, and Mongoose.
It comes with many built-in features, such as authentication using JWT, request validation, etc. For more details about the features, check the list below.
- ES9: latest ECMAScript features
- NoSQL database: MongoDB object data modeling using Mongoose
- Authentication and authorization: using passport
- Validation: request data validation using Joi
- Logging: using winston and morgan
- Error handling: centralized error handling mechanism
- Dependency management: with Yarn
- Environment variables: using dotenv and cross-env
- Security: set security HTTP headers using helmet
- Santizing: sanitize request data against xss and query injection
- CORS: Cross-Origin Resource-Sharing enabled using cors
- Social Login: Login with Google and Facebook
Clone the repo:
git clone https://github.com/praveen7557/node-mongo.git
cd node-mongo
Install dependencies:
yarn install
Environment varibales:
cp .env.example .env
# open .env and modify the environment variables (if needed)
Running locally:
yarn dev
Running in production:
yarn start