User_Management_system/
├── middleware/
│ └── CalculateLevels.js // calculating levels 2 and 3 in our express app.
├── model/
│ └── worker.js // contains the mongodb schema for our database model
├── public/
│ └── res/
│ ├── css/ // contains all the necessary css files
│ └── javascript/ // contains all the necessary javascript files
│ └── index.html // main html file
├── routes/
│ └── workerRoutes.js // Contains routes for the CRUD operations
├── README.md // Documentation file
└── server.js // Main express server
This is an incomplete solution to the user management system. The app uses RESTAPI to perform CRUD commands, employing a specified worker database model. It includes a referral system where a worker can refer others into the system.
- Ensure you have MongoDB installed and your MongoDB server is running.
- Navigate into the
User_Management_system
folder. - Install all dependencies using:
npm install
- If your database server is running, start the application with:
The port will be displayed in the command line console.
npm start
- The app does not use any frontend framework, relying instead on pure HTML code.
- All dependencies are listed in the
package.json
file. - The app will create a key worker with an ID in the database first, known as the super worker. It will not create a new worker entry unless a referral ID is provided.
Parts of the code were generated by ChatGPT, with the remaining written by the author. The author hopes to learn more to create a more robust application. RESTAPI was used to solve this exercise.