This is the backend for Order Management System here
Before running the server, make sure you have the following installed:
Instalation:
-
Clone the repo
-
Run
npm install
to install all the dependencies -
Run
npm start
to start the server -
You can either use mongodb locally like mongodb community server or use a cloud service like MongoDB Atlas
-
Set up the environment variables in
.env
fileNODE_ENV='development' MONGODB_URI='mongodb://127.0.0.1:27017/ordersManagement' PORT=3000 JWT_SECRET_TOKEN='secret' CORS_ORIGIN=http://localhost:51730
-
/users
POST /users/login
- Login userPOST /users/logout
- Logout user
-
/orders
GET /orders
- Get all ordersGET /orders/:id
- Get order by idPOST /orders
- Create a new orderPATCH /orders/:id
- Update order by idDELETE /orders/:id
- Delete order by idPOST /orders/:id/complete
- Complete order by id
-
/menu
GET /menu
- Get all menu itemsGET /menu/:id
- Get menu item by idPOST /menu
- Create a new menu itemPATCH /menu/:id
- Update menu item by idDELETE /menu/:id
- Delete menu item by id
-
/customers
GET /customers
- Get all customersGET /customers/:id
- Get customer by idPOST /customers
- Create a new customerPATCH /customers/:id
- Update customer by idDELETE /customers/:id
- Delete customer by id
-
/incomes
GET /incomes
- Get all incomesGET /incomes/:id
- Get income by id
In cases where the client's request does not fit into the above categories, the API responds with a JSON object containing only one property named "error" and an appropriate error message.
Example error response:
{
"error": "error message"
}
Otherwise, the API responds with a message in JSON format.
{
"message": "message"
}
This project is licensed under the MIT License.
For any questions or further information about the backend logistics or API, feel free to reach out via GitHub or email.
Happy coding! 🚀