'Node Backend' is a basic project made to provide one time setup of Nodejs Backend to support Small scale applications.
The concept behind this Repo is to provide working example of Scalable Nodejs backend. You are free to create new Routes, CRUD operations for new collections.
Node Backend is a Expressjs based code setup to be integrated with MongoDB, which has
- Seprated Routes
- Multi Middlewares
- Clean and Manageable code
- MongoDB
- nodemon to run server.js
- Expressjs to write route and handler code
- Mongoose for collection schema
- Create Database "someDatabase" in MongoDB instance
- Create three collections : bestseller_books, Users, userCart
- Pass MongoDB instance connection in
dbconnection.js
file
npm install
nodemon server.js
- /controllers -- API handlers/exontrollers for different routes, containing CRUD operations/verbs like PUT, GET, POST etc
- /dbconnection.js -- contains db connection URL
- /routes -- Entry points for CRUD verbs where based on verb, handler/controller action is executed
- /models -- Objects containing validation for data, like name:String etc
- Server.js -- main file responsible for calling routes and their corresponding handlers/controllers
- Package.json -- file containing npm dependencies and one start script
For Heroku Deployment
- setup mlab on Heroku and get the endpoint
- In dbconnection.js, Use MONGODB_URI as MONGODB_URI = 'mongodb://HerokuUsername:[email protected]:63707/heroku_n399gz4k';
- For monitoring Mlab from your local system, hit mongo ds263707.mlab.com:63707/heroku_n3996656ty -u username -p password from your local system
- Write MORE Tests
- Add Night Mode
MIT
Free Software, Hell Yeah!