Inventory Management System(IMS) is a nodejs based system. It stores, manages and update to the detail or status of inventory. The frontend of the project is present in the github.
- node(v13.6.0)
- npm(v6.13.4)
- mongodb(v3.4.23) or higher
- nvm (optional)
A file name config.js contains all the configuration required for the code to function properly.
You can configure following field
1. 'secretKey': 'youcankeepanyvalue' // which is used to create password hash
2. 'whitelist' : ['http://localhost:3000'] // white listing the url so that only provided url frontend can communicate
3. 'mongoUrl': 'mongodb://localhost:27017/inventory' // mongodb url
-
Clone the project.
-
Move towards the directory of the cloned project.
-
Install the package using package manager npm.
$ npm install
-
Configure the project.
-
Start the project using.
$ npm start
-
Now the project will be running on http://localhost:3000. You can use postman or other software to communicate.
.
├── bin
| ├── www
├── models
| ├── db.js
| ├── medicines.js
| └── users.js
├── node_modules
├── public
| ├── stylesheets
| | └──style.css
├── routes
| ├── cors.js
| ├── index.js
| ├── medicineRouter.js
| └── userRouter.js
├── views
| ├── error.jade
| ├── index.jade
| └── layout.jade
├── .gitignore
├── .nvmrc
├── app.js
├── authenticate.js
├── config.js
├── package-lock.json
├── package.json
└── README.md
-
bin - It contains a executable file(www) which start the server in port 3000 or port provided in environmental variable (PORT). And also sets up the basic error handling. Rarely need to be taken in account.
-
models - This folder contains the scheme of requried models.
-
public - This folder contains the file which is accessible to the user when they are connected from the website. Like javascript, css, images and other assets. We don't need this folder because we are hadling all the request and response in JSON format.
-
routes - This is the folder where all the routes are kept.
-
views - This is the folder where we kept all the templating engine files. Express looks into it when rendering the view. We don't need this folder because we are hadling all the request and response in JSON format.
-
.gitignore - Files to be ignored for git.
-
.nvmrc - Node version defined here and can be used by nvm by command (nvm use) from terminal.
-
app.js - This file sets up all the functionality required for the application to work properly.
-
authenticate.js - This file contains all the authentication strategy and initilization for authentication.
-
config.js - Configuration file. Every config variables to be defined here.