E-Commerce Marketplace API

This project is an e-commerce marketplace API built with Node.js, Express.js, and MongoDB using Mongoose. It provides functionality for users, sellers, catalogs, products, and orders. Buyers and sellers can register, manage catalogs, create orders, and more.

Getting Started

Prerequisites

Before you begin, ensure you have the following software installed on your system:

Installation

  1. Clone this repository to your local machine:
git clone https://github.com/Seudonym/UL-Assignment.git
  1. Navigate into the repository's folder:
cd UL-Assignment
  1. Install dependencies
npm install
  1. Run
npm start

Your API should now be running at https://localhost:3000/

API Endpoints

Authentication APIs

  • Register a User:

    • Endpoint: POST /api/auth/register
    • Description: Allows users to register.
  • User Login:

    • Endpoint: POST /api/auth/login
    • Description: Allows registered users to log in.

APIs for Buyers

  • Get List of Sellers:

    • Endpoint: GET /api/buyer/list-of-sellers
    • Description: Retrieve a list of all sellers.
  • Get Seller's Catalog:

    • Endpoint: GET /api/buyer/seller-catalog/:seller_id
    • Description: Get the catalog of a specific seller by seller_id.
  • Create Order:

    • Endpoint: POST /api/buyer/create-order/:seller_id
    • Description: Allows buyers to create an order for a specific seller with seller_id.

APIs for Sellers

  • Create a Catalog:

    • Endpoint: POST /api/seller/create-catalog
    • Description: Sellers can create a catalog of items.
  • Retrieve Seller's Orders:

    • Endpoint: GET /api/seller/orders
    • Description: Retrieve the list of orders received by a seller.

For more detailed information on these API endpoints, please refer to the project's source code.