Skip to content

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.

License

Notifications You must be signed in to change notification settings

degisew/commerce-store

Repository files navigation

Commerce Store

A back-end e-commerce API built with Python, Django, and PostgreSQL.

License Python Django Docker

Contact: [email protected] | LinkedIn

Overview

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.

Table of Contents

Quick Start

# 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.

Project Structure

├── 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

Setup

Show Setup Details

Prerequisites

  • Python 3.10+
  • Docker 20.10+ & Docker Compose 1.29+
  • PostgreSQL 14+ (for local setup)
  • Git 2.30+

Instructions

  1. Clone the Repository:

    git clone https://github.com/degisew/commerce-store.git
    cd commerce-store
  2. 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
  3. 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
  4. Access Services:

API Reference

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

Architecture

Tech Stack:

  • Backend: Django, and Django Rest Framework for RESTful APIs
  • Database: PostgreSQL
  • DevOps: Docker, Docker-compose

Deployment

Show Deployment Details

Production

# Run with Docker Compose
docker-compose -f compose.prod.yaml up -d

Environment Variables

DB_USER=your_database_user
REDIS_URL=redis://host:6379/0
SECRET_KEY=your-secret-key
ALLOWED_HOSTS=your-domain.com

License

MIT License. See LICENSE.

⭐ Star this repo if you found it useful!

Built by Degisew Mengist

⬆ Back to Top

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published