A feature-rich e-commerce backend API built with Django and Django REST Framework.
This project is a comprehensive e-commerce RESTful API designed to power an online store. It includes product management, user authentication, cart functionality, order processing, and much more!
- 🔑 User Authentication: Secure JWT-based authentication with Djoser
- 🛒 Product Management: Full CRUD with filtering, searching, and sorting
- 📦 Collection Management: Group products into collections
- 🛍 Shopping Cart System: Add, remove, and update items
- 📦 Order Processing: Order placement and tracking
- 👤 Customer Profiles: View and manage purchase history
- ⭐ Reviews System: Leave reviews for products
- 🔐 Role-based Access Control: Admin, staff, and customers
- 🏷 Content Tagging: Flexible product categorization
- ❤️ Like Feature: Users can like various content types
- 📄 Pagination: Efficient API responses with pagination
Technology | Description |
---|---|
Django | Web framework for backend logic |
Django REST Framework | API development & serialization |
PostgreSQL | Relational database for storage |
Simple JWT | JSON Web Token authentication |
Djoser | Prebuilt authentication endpoints |
Django Filter | Advanced filtering support |
Django Debug Toolbar | Debugging & performance monitoring |
POST /auth/users/
- Register new userPOST /auth/jwt/create/
- Get JWT tokenPOST /auth/jwt/refresh/
- Refresh JWT token
GET /store/products/
- List all productsGET /store/products/{id}/
- Get product detailsPOST /store/products/
- Create new product (Admin only)PUT /store/products/{id}/
- Update product (Admin only)DELETE /store/products/{id}/
- Delete product (Admin only)
GET /store/collections/
- List all collectionsGET /store/collections/{id}/
- Get collection detailsPOST /store/collections/
- Create new collection (Admin only)PUT /store/collections/{id}/
- Update collection (Admin only)DELETE /store/collections/{id}/
- Delete collection (Admin only)
POST /store/carts/
- Create a cartGET /store/carts/{id}/
- Get cart detailsDELETE /store/carts/{id}/
- Delete cart
GET /store/carts/{id}/items/
- List cart itemsPOST /store/carts/{id}/items/
- Add item to cartPATCH /store/carts/{id}/items/{id}/
- Update item quantityDELETE /store/carts/{id}/items/{id}/
- Remove item from cart
GET /store/orders/
- List customer ordersPOST /store/orders/
- Create an orderGET /store/orders/{id}/
- Get order detailsPATCH /store/orders/{id}/
- Update order (Admin only)DELETE /store/orders/{id}/
- Delete order (Admin only)
GET /store/customers/me/
- Get customer profilePUT /store/customers/me/
- Update customer profile
GET /store/products/{id}/reviews/
- List product reviewsPOST /store/products/{id}/reviews/
- Create a review
1️⃣ Clone the repository
git clone <repository-url>
cd django-ecommerce-api
2️⃣ Create & activate a virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
3️⃣ Install dependencies
pip install -r requirements.txt
4️⃣ Configure database settings in storefront2/settings.py
5️⃣ Apply database migrations
python manage.py migrate
6️⃣ Create an admin user
python manage.py createsuperuser
7️⃣ Run the development server
python manage.py runserver
📦 django-ecommerce-api
├── 📁 core/ # Authentication & base models
├── 📁 store/ # E-commerce logic (products, orders, etc.)
├── 📁 tags/ # Content tagging system
├── 📁 likes/ # Like functionality
├── 📁 storefront2/ # Project settings & configurations
├── 📁 playground/ # Development & testing space
This project is licensed under the MIT License. See the LICENSE file for details.
🚀 Happy Coding & Build Your Own E-commerce Platform!