Router server-side application with Node.js v22.0.0, NPM-v10.5.1, Express.js-v4.19.2, MongoDB-v6.8.0, Mongoose-v8.5.0, and Insomnia-v9.3.2
- Description Info
- GitHub Repository
- Installation Process
- Usage Info
- Contributing Guidelines
- Test Instructions
- Demonstration on YouTube
- License
- Questions and Contacts
Mongo API Router uses NPM packages like MongoDB package as a database document model and Mongoose as a object-oriented programming library that establishes connection between database and Node RTE. Mongoose Shemas, database Models and connection are set at first. Seeds for populating databse with testing data at second and routes and controllers at the end. Testing is performed by using Insomnia Client API platform.
As MongoDB will be used as a document database model it should be installed at first MongoDB Installation Package. Click on the button download and start downloading MongoDB Windows installation package (mongodb-windows-x86_64-7.0.12-signed.msi). Also, before start make a empty dir on C drive (C:>mkdir -p data/db). Start MongoDB Setup Wizard and follow instructions. Setup type should be Complete, not Custom, Configuration as Run service as Network Service user, also install MongoDB Compass, press next and install.
Navigate to the bin directory of already instolled MongoDb on your machine and copy path (C:\Program Files\MongoDB\Server\6.0\bin) and go to Edit The System Environment Variables (System Properties) at your PC. After went to Environment Variables section, click on the Path at User Variables window and press Edit button. Click on button New and past previously copied path to MongoDB bin directory and press Ok. Check your MongoDB is working type in Git Bash terminal as follows (C:/Users/jdoe> $ mongod):
$ mongodIf terminal shows something like image below it means MongoDB is set properly. Othrewise repeat process again.
After MongoDB is setup, npm packages should be installed at root dir of the application (~/mongo-api/app>):
To initialize package.json and to install node_packages run
$ npm init # initialize formating of package.json
$ npm install # installing node packagesTo install mongodb npm packages run
$ npm install mongodb To install mongoose npm packages run
$ npm install mongooseSeed data are stored in seed.js file (~/utils/seed.js) and you can execute it as follows:
$ node ./utils/seed.jsAlternatively,
$ npm run seed # automate executable shortcuts scripts at package.jsonAs a small application it can be helpful for testing and practising purpose but on the other side it has some atributes of serious programming application.
Currentlly, at this stage there is no contributors but for more information any enquiry can be reffered to Question and Contact section.
Application runs by invoking command $ npm run start at ~/mongo-api/app> directory. Before running application, download compressed repo from githaub and installl packages globaly or at application root directory from the section Installation Process.
$ nodemon ./server.js # OR node ./server.js Alternatively,
$ npm run devAll automate executable scripts are stored at root directory ~/mongo-api/app> in package.json file.
"scripts": {
"test": "jest",
"start": "node ./server.js",
"dev": "nodemon ./server.js",
"seed": "node ./utils/seed.js"
},Demonstration on YouTube
Demonstration of the application can be visited below.
Copyright © 2024, codexdev. Released under the MIT License.
Questions about application can be reffered to the author's GitHub account or you can Contact Me directly over an email.



