This is a Server for an e-commerce application built using Node.js and MongoDB. It provides endpoints to perform various operations related to managing products, categories, carts, orders, and user authentication.
-
Clone the repository:
-
Install dependencies:
-
Set up your MongoDB database and configure the connection string in
config/db.ts
. -
Start the server:
-
POST /api/v1/user/new: Register a new user.
-
GET [/api/v1/user/all]: Get All User.
-
GET [/api/v1/user/:_id]: User Detail.
-
DELETE [/api/v1/user/:_id]: Delete User Detail .
- POST /api/v1/product/new: To Create New Product.
- GET /api/v1/product/all: To get all Products with filters.
- GET /api/v1/product/latest: To get last 10 Products.
- GET /api/v1/product/categories: To get all unique Categories.
- GET /api/v1/product/admin-products: To get all Products.
- GET /api/v1/product/:_id: To get Single Products.
- PUT /api/v1/product/:_id: To get Update Products.
- DELETE /api/v1/product/:_id: To get Delete Product Products.
- POST /api/v1/order/new: To Create New Order.
- GET /api/v1/order/new: To Get my order.
- GET /api/v1/order/all: To Get All order.
- GET /api/v1/order/:id: To Get Single Order.
- PUT /api/v1/order/:id: To Process Order.
- DELETE /api/v1/order/:id: To Get Dlete Order.
- POST /api/v1/payment/create: To Create New Payment.
- GET /api/v1/payment/discount: To apply discount.
- POST /api/v1/payment/coupon/new: To Create coupon.
- GET /api/v1/payment/coupon/all: To Get All coupon.
- DELETE /api/v1/payment/:id: To Dlete coupon.
- GET /api/v1/dashboard/stats: To Get Dashboard stats
- GET /api/v1/dashboard/pie: To Get Pie Chart.
- GET /api/v1/dashboard/bar: To Get Bar Chart.
- GET /api/v1/dashboard/line: To Get Line Chart.
It's recommended to thoroughly test each API endpoint using tools like Postman.