This repository contains an ecommerce application built with Django and React, extended with a distributed, event-driven backend architecture.
The backend uses Django REST Framework and is enhanced with:
- Celery for background task processing
- Redis for task buffering and caching
- RabbitMQ as a domain event bus
- Kombu for event publishing and consumption
- Commands for seeding and running consumer threads
The frontend is built with React, Redux, and Tailwind.
- Django handles HTTP requests and business logic
- Redis buffers Celery tasks and caches frequently accessed data
- Celery Workers execute background jobs (emails, image resizing, webhooks)
- RabbitMQ publishes domain events (e.g.
order.completed) - Event Consumers react to events and trigger async work
- Idempotency prevents duplicate side effects during retries
- Stripe & Paystack as payment gateways
python -m venv .venv
source .venv/bin/activate
cd server
pip install -r requirements.txt
python manage.py runserver
# Seed products
python manage.py seed_productscd server
celery -A project worker -l info
python manage.py run_notifications_consumerpytestDuplicate the .env.example file, rename the copy to .env and add your own stripe and paystack keys.
Then run the following
cd client
npm i
npm start# Merge environemnt variables
sh ./scripts/merge_envs.sh
# Run local stack
docker compose up --build# Build frontend
sh ./scripts/build_client.sh
# Merge environemnt variables
sh ./scripts/merge_envs.sh
# Run production stack
docker compose -f docker-compose.prod.yml up -d