Factory Management it backend (server only) project demonstrates Factory management system. The Factory has employees. Each employee belongs to a department. Each employee works several shifts. Each shift structure build from one or more employees. The project base on NodeJS and MongoDB. the server manage data from three different sources:
- (read only) The server read data from Jsonplaceholder by REST API to authenticate and authorize access to the factory management system
- The server use MongoDB to load and store data about the employees, departments, shifts and so on.
- The server log to Json file the actions that user does.
the system also tracks about the actions that users do. users have limit actions peer day like getting the list of employees, create a new department etc... the action count resets at UTC midnight.
the sever comenicate to client by GraphGL.
To run the application locally, follow these steps:
- install nodeJS v18.12.1 or above(tested)
- install npm 8.5.4 or above(tested)
- (optional) install nodemon global
- (optional) an .env file change the secret key, action limit, port or mongoDB address.
- go to server dictory
cd server
- install dependencies
npm i
- run the server
node index.js
- in .env file make sure the ADDRESS point on demo database and nor real database with personal data.
- run
npm test
to use jest - drop the database. shifts can't be deleted by customer requirements.