Skip to content

blackmirorr1/ShopAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ShopAPI πŸ›’

E-Commerce REST API built with Django REST Framework as a learning project. The API supports full shopping flow from browsing products to placing orders.


Tech Used

  • Python 3.13
  • Django 5.2
  • Django REST Framework
  • JWT Authentication (SimpleJWT)
  • django-filter

Features

  • Register & Login with JWT Tokens
  • Products with Search, Filter by price, and Pagination
  • Cart Management (each user sees only their cart)
  • Orders with automatic Stock Management
  • Reviews & Ratings (one review per product per user)
  • Sales Statistics using Django ORM aggregations
  • Custom Permissions (only owner can edit/delete their data)

How to Run

# Install dependencies
pip install -r requirements.txt

# Run migrations
python manage.py migrate

# Create admin user
python manage.py createsuperuser

# Start server
python manage.py runserver

API Endpoints

POST   /api/register/          β†’ Create new account
POST   /api/token/             β†’ Login and get JWT tokens
POST   /api/token/refresh/     β†’ Refresh access token

GET    /api/product/           β†’ List all products (with filter & search)
POST   /api/product/           β†’ Add new product
PUT    /api/product/<id>/      β†’ Update product
DELETE /api/product/<id>/      β†’ Delete product

GET    /api/cart/              β†’ View my cart
POST   /api/cart/              β†’ Add item to cart
DELETE /api/cart/<id>/         β†’ Remove item from cart

POST   /api/order/             β†’ Place an order
GET    /api/order/             β†’ View my orders

POST   /api/review/            β†’ Add a review
GET    /api/review/            β†’ View all reviews

GET    /api/statistics/        β†’ View sales statistics (admin)

Filter & Search

GET /api/product/?search=iphone
GET /api/product/?min_price=100&max_price=500
GET /api/product/?ordering=-price
GET /api/product/?page=2

Made by Mahmoud Mancy

About

E-Commerce REST API built with Django REST Framework, JWT Authentication, Filter, Search, Pagination, Reviews & Stock Management

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages