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


Hello every one 👋
This is a simple order management system 🧑‍💼
Implmented using:
Backend framework: NestJS
ORM: Prisma
Database: PostgreSQL

Setup

  1. Clone the repository
  2. Install dependencies: npm install (Make sure you are in order-management-system directly before running this command)
  3. Set up PostgreSQL and create a database
  4. Configure .env file with the database URL
  5. Run Prisma migrations: npx prisma migrate dev
  6. To seed your database run: npm run seed
  7. Start the server: npm run start
  8. To view API documentation on swagger use this link 👉 http://localhost:3000/api

API Endpoints

  • Add to Cart: POST /api/cart/add
  • View Cart: GET /api/cart/:userId
  • Update Cart: PUT /api/cart/update
  • Remove From Cart: DELETE /api/cart/remove
  • Create Order: POST /api/orders
  • Get Order by ID: GET /api/orders/:orderId
  • Update Order Status: PUT /api/orders/:orderId/status
  • Get Orders by User ID: GET /api/orders/user/:userId
  • Apply Coupon: POST /api/orders/apply-coupon