A back-end e-commerce API built with Python, Django, and PostgreSQL.
Contact: [email protected] | LinkedIn
A back-end e-commerce API built with Python, Django, and PostgreSQL. It includes endpoints for creating, retrieving, updating, and deleting products, as well as for managing orders, customers, carts, and their items.
Key Features:
- Secure JWT authentication and role-based access control.
- Containerized deployment with Docker.
- Products Catalog management.
- Shopping Cart and Orders management.
# Clone the repo
git clone https://github.com/degisew/commerce-store.git
cd commerce-store
# Run with Docker
docker-compose up --build
# OR run locally
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements/dev.txt
python manage.py runserver
Access: http://localhost:8000/api/v1/docs for API docs.
├── apps/ # Custom Apps collection
├── config/ # Project Configurations
├── docker
│ └── dev/
│ └── Dockerfile # Django API Dockerfile for development environment
├── docs/ # Documentation files
├── requirements/ # requirements.txt files collection
├── .env # Environment variables (you will create this)
├── compose.yaml # Docker Compose configuration file
└── README.md # This README file
Show Setup Details
- Python 3.10+
- Docker 20.10+ & Docker Compose 1.29+
- PostgreSQL 14+ (for local setup)
- Git 2.30+
-
Clone the Repository:
git clone https://github.com/degisew/commerce-store.git cd commerce-store
-
Configure Environment:
Create a .env file with-in your root project directory and store secure values.
Example
.env
:# Database POSTGRES_USER=your_db_user POSTGRES_PASSWORD=your_db_password POSTGRES_DB=your_db_name # Django SECRET_KEY=your_secret_key DB_USER=your_database_user # Optional: pgAdmin [email protected] PGADMIN_DEFAULT_PASSWORD=your_pgadmin_password
-
Run the Application:
-
Docker (Recommended):
docker-compose up --build
-
Local Development:
python -m venv venv source venv/bin/activate pip install -r requirements/dev.txt python manage.py runserver
-
-
Access Services:
- API: http://localhost:8000
- API Docs: http://localhost:8000/api/v1/docs
- pgAdmin (if included): http://localhost:8001
Show API Reference
Endpoint | Method | Description |
---|---|---|
/api/v1/store/products |
GET | List all available products |
/api/v1/core/users |
GET | List Registered accounts |
/api/v1/store/collections |
GET | List all Product Categories |
Full Docs: http://localhost:8000/api/v1/docs
Tech Stack:
- Backend: Django, and Django Rest Framework for RESTful APIs
- Database: PostgreSQL
- DevOps: Docker, Docker-compose
Show Deployment Details
# Run with Docker Compose
docker-compose -f compose.prod.yaml up -d
DB_USER=your_database_user
REDIS_URL=redis://host:6379/0
SECRET_KEY=your-secret-key
ALLOWED_HOSTS=your-domain.com
MIT License. See LICENSE.