This project is an online marketplace platform, developed as part of a graduate assignment, that provides essential e-commerce functionality. The platform allows users to manage products, shops, and orders with a robust user role system (Admin, Shop Owner, Customer). It is designed with scalability and modern best practices in mind, ensuring security, easy maintenance, and future extensibility.
-
🔒 User Authentication & Authorization: Users can register, log in, confirm their emails via the API, and request password reset links. Different roles (Admin, Shop Owner, Customer) ensure role-based access control throughout the platform.
-
🗂 Category Management: Admins can create, update, and delete categories, and also manage shops within categories.
-
🏪 Shop & Product Management: Authenticated users can create and manage their own shops, update or delete them, and handle products through manual input (update/delete) or import from file (
JSON
,YAML
). -
🛒 Shopping Cart & Order System: Users can add, view and remove products from their shopping cart, place orders, confirm them and view order history. Admins are responsible for managing order statuses and can delete orders.
-
📧 Asynchronous Email Notifications:
Celery
workers, withRedis
as the message broker, manage email notifications for users and admins. -
🐋 Dockerized Environment: The platform is fully containerized using
Docker
andDocker Compose
, simplifying local development and deployment by including the backend,PostgreSQL
database, andRedis
for message brokering. -
📜 Process Management: Supervisor efficiently manages both
Django
andCelery
processes within a single container, ensuring logs are handled smoothly. -
🛠️ CI/CD Pipeline:
GitHub Actions
are integrated for continuous integration, ensuring code quality with automated testing, linting, and coverage reports before merging changes to the main branch.
Backend | DevOps | Databases & Message Broker |
---|---|---|
Python |
Docker |
PostgreSQL |
Django |
Docker Compose |
Redis |
DjangoRestFramework |
GitHub Actions |
|
Celery |
You can explore all the API endpoints in the Postman documentation. Click here to view the detailed documentation.
- 📥 Clone the repository
First, ensure you havegit
installed on your machine. Then clone the project repository:
git clone https://github.com/Nikilandgelo/online_store_backend.git
- 📝 Create a
.env
file
In the root directory of the project, create a.env
file with the following variables (make sure to replace<...>
with your own values):
- For
PostgreSQL
:
POSTGRES_PASSWORD=<your_postgres_password>
POSTGRES_USER=<your_postgres_user>
POSTGRES_DB=<your_postgres_db>
POSTGRES_HOST=PostgresDB
POSTGRES_PORT=5432
- For email handling (ensure you have access to a SMTP server):
EMAIL_HOST=<your_smtp.example.com>
EMAIL_HOST_PASSWORD=<your_email_password>
EMAIL_HOST_USER=<your_email_user>
EMAIL_PORT=<587> or <465>
SERVER_SOCKET=localhost:8000 # your django server IP:port
ADMIN_EMAIL=<your_another_email_user> # for getting "admins" mails when orders confirmed
- Other Django settings:
SECRET_KEY=<your_secret_key>
REDIS_HOST=Redis
- 📂 Navigate to the project directory:
Once the repository is cloned, navigate to theDRFProject
directory where the main backend files are located:
cd DRFProject
- 🔧 Set up a virtual environment and install dependencies:
Create a virtual environment for the project and install the required Python dependencies:
python -m venv .venv/ # Create a virtual environment
source .venv/bin/activate # Activate the virtual environment on Linux
# on Windows will be - venv\Scripts\activate
pip install -r requirements.txt # Install all dependencies
- 🐋 Run the Docker containers:
Finally, start up all required services (PostgreSQL, Redis, Django) by running the Docker containers:
docker-compose up -d --build
- 🌐 Access the application:
After the containers are running, you can access the application in your web browser at:
http://localhost:8000