This API made for university food system and use Node.js, Express.js, MongoDB, JWT and more...
There is no Frontend and UI to work with this API.so you must use appllications like postman to work with this project !
first execute below command to install all package needed:npm installThen make sure you have installed MongoDB on your system and mongod service is running then run project with this command:
node indexWeb server start running on localserver and port 3000 by default.you can change the port in .env file.use below endpoints to with web server:
Endpoints:
- Login = GET /api/user
- Signup = POST /api/user
- Edit User = PUT /api/user
- Increase Currency = POST /api/user/increase-currency
- Get Foods = GET /api/food
- Create Food = POST /api/food
- Delete Food = DELETE /api/food
- Reserve Food = POST /api/food/reserve
Method = GET
Route = /api/user
Pass these as query string in URL
- username : string
- password : string
Method = POST
Route = /api/user
Pass these in body as JSON
- fullname : string
- password : string
Method = PUT
Route = /api/user
Pass these in body as JSON
- type : integer - range[0,5]
- type = 0 => Update food code password
- newCode : integer
- type = 1 => Update username
- newUsername : string
- type = 2 => Update password
- newPassword : string
- type = 3 => Update email
- newEmail : string
- type = 4 => Promote user(admin)
- targetUser : string
- type = 5 => Demote user(admin)
- targetUser : string
Method = POST
Route = /api/user/increase-currency
Pass these in body as JSON
- amount : integer
Method = GET
Route = /api/food
Pass these as query string in URL
- year : integer
- month : integer
- day : integer
Method = POST
Route = /api/food
Pass these in body as JSON
- name : string
- meal : integer range[1,5]
- price : integer
- locations : string[]
- year : integer
- month : integer
- day : integer
- hour : integer
- minute : integer
Method = DELETE
Route = /api/food
Pass these in body as JSON
- id : string
Method = POST
Route = /api/food/reserve
Pass these in body as JSON
- id : string
- amount : integer
- location : string