Skip to content

SHUBHAM-NIRMAL18/ecommerce-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

E‑Commerce API

Django
DRF

This repository exposes a simple E‑Commerce API built with Django & Django REST Framework. It supports:

  • User & Roles

    • Register / Login (JWT)
    • Two roles: Admin & Customer
    • Only authenticated users can access any endpoint
  • Category (Admin only writes)

    • List & Retrieve (any authenticated)
    • Create / Update / Delete (Admin only)
  • Product (Admin only writes)

    • List & Retrieve
      • Admin sees all products
      • Customer sees only active products
    • Create / Update / Delete / Activate / Deactivate (Admin only)
  • Order

    • Customer:
      • Create order (quantity ≤ stock, product must be active)
      • View own orders
      • Cancel own order (only if status is pending)
    • Admin:
      • View all orders
      • Change order status (confirm, ship, deliver, etc.)

Getting Started

  1. Clone & Install

    Clone the repo

    python3 -m venv .venv
    source .venv/bin/activate
    pip install -r requirements.txt
    
  2. Migrate and Run

    python manage.py makemigrations
    python manage.py migrate
    python manage.py runserver
    
  3. API Documentaion

    Swagger:

    api/docs/

About

This repository provides a simple E-Commerce API built with Django and DRF. It includes JWT authentication with Admin and Customer roles. Admins can manage categories, products, and orders, while customers can browse active products, place orders with stock validation, view their own orders, and cancel pending ones.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors