Welcome to the API documentation for the E-Commerce Marketplace. This project provides a set of REST API endpoints to facilitate communication between buyers and sellers in an e-commerce ecosystem.
demo_assignment.MP4
To access the APIs, users must authenticate by obtaining an authentication token. Use the following endpoints for authentication:
-
Register a User:
POST /api/auth/register
- Register a user with a unique username, password, and user type (buyer or seller).
-
Login:
POST /api/auth/login
- Log in with a registered username and password to receive an authentication token.
-
Get List of Sellers:
GET /api/buyer/list-of-sellers
- Retrieve a list of all sellers.
-
Get Seller's Catalog:
GET /api/buyer/seller-catalog/:seller_id
- Get the catalog of a specific seller by providing their ID.
-
Create Order:
POST /api/buyer/create-order/:seller_id
- Create an order by specifying the seller's ID and a list of products.
-
Create Catalog:
POST /api/seller/create-catalog
- Create a catalog by providing a list of products.
-
Get Seller's Orders:
GET /api/seller/orders
- Retrieve a list of orders received by the seller.
- Two types: buyers and sellers
- Attributes: _id, username, password, type (buyer/seller)
- Belongs to a seller
- Attributes: _id, seller (reference to User), products (array of Products)
- Attributes: _id, name, price
- Created by a buyer
- Attributes: _id, buyer (reference to User), seller (reference to User), products (array of Products)
- See Authentication
- See Buyer APIs
- See Seller APIs
- Node.js
- Postman extension or application
-
Clone the repository.
git clone "https://github.com/suyogschavan/e_comm.git"
-
Install dependencies:
npm install
-
Start the server:
npm start
Set up environment variables such as database connection details and secret keys. Refer to the .env
file.
Feel free to contribute by submitting issues or pull requests.