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)
- List & Retrieve
-
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.)
- Customer:
-
Clone & Install
Clone the repo
python3 -m venv .venv source .venv/bin/activate pip install -r requirements.txt -
Migrate and Run
python manage.py makemigrations python manage.py migrate python manage.py runserver
-
API Documentaion
Swagger:
api/docs/