A Dockerized Django e-commerce application with product and inventory management, role-aware user flows, order and payment handling, wishlist APIs, background tasks, and S3-compatible object storage.
- Role-aware authentication, profiles, addresses, and account management
- Product catalog with categories, brands, inventory, media, discounts, comments, and wishlists
- Order creation, payment flow, and verification endpoints
- Django REST Framework endpoints for wishlist operations
- Asynchronous jobs with Celery and RabbitMQ
- Redis for caching and Celery result storage
- PostgreSQL persistence
- S3-compatible object storage integration through
boto3anddjango-storages - Docker Compose environment with health checks and non-root application containers
- Locked dependencies managed with Poetry;
requirements.txtis generated frompoetry.lock
flowchart LR
Client[Browser / API Client] --> App[Django + Gunicorn]
App --> DB[(PostgreSQL)]
App --> Redis[(Redis)]
App --> Broker[RabbitMQ]
Broker --> Worker[Celery Worker]
Worker --> Storage[S3-Compatible Object Storage]
Nginx[Nginx / TLS] --> App
| Area | Tools |
|---|---|
| Backend | Python 3.12, Django, Django REST Framework |
| Database | PostgreSQL |
| Async processing | Celery, RabbitMQ |
| Caching / result backend | Redis |
| Storage | boto3, django-storages, S3-compatible storage |
| Authentication | Django authentication, JWT via SimpleJWT |
| Runtime | Gunicorn, Docker, Docker Compose |
| Tooling | Poetry, Ruff, isort, pre-commit |
| Admin | Django Jazzmin |
apps/
├── account/ # users, roles, authentication, addresses, tokens
├── core/ # shared utilities, OTP/SMS helpers, management commands
├── order/ # carts, orders, payments, payment verification
├── product/ # catalog, inventory, brands, categories, discounts, wishlists
└── public/ # public pages, home page, login flows
config/ # Django settings, URLs, Celery configuration
utility/
├── bucket/ # object-storage integration and related tasks
└── bin/ # Docker entrypoint scripts
git clone https://github.com/pedramkarimii/Online-Shop.git
cd Online-Shopcp .env.example .envEdit .env and replace development placeholders before starting the stack. Never commit .env.
When PostgreSQL port 5432 is already in use, set a different host port in .env:
POSTGRES_HOST_PORT=55432docker compose config --quietdocker compose up --build app celery-workerThe application is available at:
http://127.0.0.1:8000/
Stop the local stack with:
docker compose downInstall runtime and development dependencies:
poetry install --with devRun Django checks:
poetry run python manage.py check
poetry run python manage.py makemigrations --check --dry-runRun linting:
poetry run ruff check .Generate runtime requirements from the lock file:
poetry export \
--only main \
--format requirements.txt \
--without-hashes \
--output requirements.txtrequirements.txt must remain synchronized with poetry.lock.
Run dependency consistency checks inside the application image:
docker compose build app
docker compose run --rm --no-deps \
--entrypoint sh \
app \
-c 'python -m pip check && python manage.py check'Run Django migrations as a plan without applying changes:
docker compose up -d db
docker compose run --rm --no-deps \
--entrypoint sh \
app \
-c 'python manage.py migrate --plan'The repository contains model, view, token, and Selenium-oriented test modules across the account, order, product, and public applications.
Run Django tests with configured services available:
poetry run python manage.py testSelenium-focused tests require a compatible browser and WebDriver environment.
- Real credentials are excluded from version control through
.gitignore. .env.examplecontains placeholders only.- Docker application containers run as a non-root user.
- Dependency versions are locked with Poetry.
- Run an audit against runtime dependencies:
pip-audit -r requirements.txt- Create a branch from
develop. - Keep
.envfiles and secrets out of commits. - Run formatting, linting, and Django checks.
- Submit a focused pull request with a clear description.
This project is licensed under the MIT License. See LICENSE.