Skip to content

Latest commit

 

History

History
88 lines (66 loc) · 4.65 KB

README.md

File metadata and controls

88 lines (66 loc) · 4.65 KB

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads CircleCI Coverage Discord Backers on Open Collective Sponsors on Open Collective Support us

Restaurant App with Nest.js and Mongo

Description

This project is restaurant application built using Nest.js and Mongo. The focus is on writing clean, modular, and testable code, and following a well-organized project structure.

Technology Stack

  • Nest.js
  • MongoDB
  • Mongoose
  • Jest (in progress)

Getting Started

To get started with this project, follow these steps:

  • Clone this repository to your local machine.
  • Navigate to the restaurant-system directory.
cd ./restaurant-system
  • Install app dependencies.
npm install
  • Run the app.
npm start

Testing (in progress)

To run the tests, follow these steps:

  1. Install dependencies: npm install
  2. Run the tests: npm run test

Process flow

NOTES:

  • Modify the test.env as needed, add your database connection string, your jwt secret, admin username and admin password. Then, rename the file into: development.env.
  • For any API endpoint usage, refer to the documentation

1- Run npm install to install dependencies.
2- Run npm start to start the application.
3- Signup with the following endpoint: POST http://127.0.0.1:3000/auth/signup.
4- Search products with the following endpoint: GET http://127.0.0.1:3000/products.
5- Add a product to cart with the following endpoint: POST http://127.0.0.1:3000/carts/add-to-cart.
5.1- You can get the existing cart, update cart item qty, delete a cart item, delete the whole cart.
5.2- Refer to the Carts directory in the API documentation.
6- Make an order based on the existing cart with the following endpoint: POST http://http://127.0.0.1:3000/orders/make-order.
6.1- You can get your orders, cancel an order, update order item qty, update order address.
6.2- Refer to the Orders directory in the API documentation.
For Admin:
1- Signin using the following credentials: Admin:01120099205 with the following endpoint: POST http://127.0.0.1:3000/auth/signin.
2- You can create a product with the following endpoint: POST http://127.0.0.1:3000/products/create-product.
3- You can get orders with the following endpoint: GET http://127.0.0.1:3000/admin/orders.
4- You can update an order with the following endpoint: PATCH http://127.0.0.1:3000/admin/update-order.
5- You can get the daily sales report with the following endpoint: GET http://127.0.0.1:3000/admin/sales-report?date=2024-05-26.