- Explore a FIFO (First In, First Out) queue system implemented in this project, where you can enqueue ≠ types of actions for execution. Queue can be [ A, B, D, E, B ] here next action is A.
- Every 1-sec, next action from queue is executed and costs 1 credits (actionA uses creditsA, actionB uses creditsB, etc).
- Every 30-sec, credits are regenerated within a range of 80-100% of their maximum value.
- Everything in the project (front, back, and tests) is design to scale :
- Edit
allType
in both backend/src/constants and frontend/src/constants - Refresh the page (and server will auto restart with nodemon).
- This guide explains how to configure your machine to use a local database with MongoDB Compass : MongoDB Documentation
- Create two databases : "fifo" and "fifo_test". They correspond to the environment variables in backend (.env) file:
MongoURL
andMongoURL_test
.
Run MongoDB Compass (on MacOS):
- to start MongoDB server run
brew services start mongodb-community@7.0
- to stop MongoDB server run
brew services stop mongodb-community@7.0
- You dont have to change
MongoURL
andMongoURL_test
in backend (.env) if you named your databases as mentioned in previous section. PORT
andVITE_API_PORT
respectively from backend (.env) and frontend (.env) have to be the same.
- Navigate to frontend folder
- Execute
npm install
- Execute
npm run dev
- Listening on port 5173
Required: Node.js v21.6+.
- Navigate to the backend folder
- Execute
npm install
- Execute
npm run build
- Execute
npm run dev
- Listening on port 3000
- Working on backend ? use
npm run watch
, which compiles your code automatically on changes.
- Navigate to the backend folder
- Cancel
npm run dev
processus - Use
npm run test