This project demonstrate following points
- Implementation of REST API
- Implementation of JWT Token
- Utlizing MongoDB for Data Storage
Following are the modules covered to demonstrate skills:
- Authentication and Authorization
- Users - CRUD Operation
- Roles - CRUD Operation
- Product - CRUD Operation
- Category - CRUD Operation
NodeJS: 9.x or above
MongoDB: 3.6.X or above
Run # npm install to install all dependancy
In config.js
let appConfig = {
protocol: 'http://',
host: 'localhost', // Listening Server Address
port: process.env.NODE_APP_PORT || 3000, // Listening Server Port
saltRounds: 15, // Used for JWT Token Generation
secretKey: "X1t(01?G449042l", // Used for JWT Token Generation
resetCodeLength: 12,
addHours: 1
}
let dbConfig = {
connection: 'mongodb://localhost:27017/nodeRestApi' // Mongo DB Connection String
}
let filePaths = {
category: 'uploads/category',
product: 'uploads/product',
user: 'uploads/user',
}
let routeSlug = {
category: 'categories',
product: 'products',
auth: 'auth',
users: 'users',
roles: 'roles'
}
appConfig.baseUrl = appConfig.protocol + appConfig.host + ":" + appConfig.port + '/';
appConfig.dbConfig = dbConfig;
appConfig.filePaths = filePaths;
appConfig.routeSlug = routeSlug;
module.exports = appConfig;
Run # npm start