- ✏️ Project description
- 📋 Tasks
- 📟 Functionality
- 📱 Project technologies
- 📚 Dependencies used
- 📈 Relationships between tables
- 📽️ Example work
- 🔧 Project Features
- 🔌 Installation and launch
- 📗 API Documentation
- 🔐 License
- 🧙♂️ Authors
A project based on the Django Rest Framework, designed to show the interaction of the "Online Store" with:
Customer, Manager / Admin, Provider and Courier.
The project was developed with the aim of exploring the Django Rest Framework.
Topics such as:
- Patterns of MVC, MVP. ✅
- Authentication JWT. ✅
- Authentication sessions. ✅
- Integration. ✅
- Registration via SMTP protocol. ✅
- Registration, authorization using Djoser. ✅
- Optimization by connecting phone tasks. ✅
- Optimization using Cache. ✅
- The work of queue brokers (Redis, RabbitMQ, Kafka). ✅
- The difference between RabbitMQ and Kafka, the pros and cons of using them. ✅
- Working with the Yookassa payment system. ✅
- The use of webhook. ✅
An approximate list of endpoints and their capabilities.
- Scheme -
Spectacular
. - Registration -
SMTP
. - Sending messages -
Djoser
. - Error tracking -
Sentry
. - Address verification via -
Google Maps
. (In development) - Database Backup -
CeleryBeat
. - Caching and Database -
Redis
. - Background tasks -
Celery
. - Queue broker -
RabbitMQ
. - The payment system is
Yookassa
. - Payment confirmation -
Webhook
.
Python 3.11
Django 4.2.7
djangorestframework 3.14.0
djangorestframework-simplejwt 5.3.0
drf-spectacular 0.26.5
djoser 2.2.2
psycopg2 2.9.9
redis 5.0.1
rabbitmq-server 0.0.1
celery 5.3.6
django-celery-beat 2.5.0
sentry-sdk 1.38.0
yookassa 3.0.1
- An example of how Database copying works. Download video in the best quality.
- An example of the work of **Placing an order and paying for it in Yookassa**. Download video in the best quality.
[WARNING] If you encounter errors when starting a project, a couple of recommendations below can help you!
-
This project began to be created without knowing how to write the REST API more competently and
how to properly implement the online store itself. For this reason, there may be some shortcomings. -
Why are there no microservices in this project? I had heard about microservices at that time,
but I did not understand how to implement them. For this reason, this project has only one service. -
Also, if you run through docker, you will need to complete the configuration
celery(roll back to a lower version) or add the config to rabbitmq. For some
one of these reasons, docker does not want celery to work and warnings pop up in rabbitmq. -
For more convenient use of the project:
If you want your project to start with the Run button (Shift+F10) and apply Debug (Shift+F9), go to this link
Warning
If you have all the following on your computer, you can skip this warning.
- Cloning the repository:
git clone https://github.com/AntonVagabond/online_store.git
- Creating a virtual environment and installing dependencies:
python3.11 -m venv env
source env/bin/activate
pip install -r requirements.txt
- Creating
.env
based on.env.example
SECRET_KEY=
DEBUG=
ALLOWED_HOSTS=
PG_DATABASE=
PG_USER=
PG_PASSWORD=
DB_HOST=
DB_PORT=
SENTRY_DSN=
EMAIL_HOST=
EMAIL_PORT=
EMAIL_HOST_USER=
EMAIL_HOST_PASSWORD=
EMAIL_USE_TLS=
REDIS_HOST=
REDIS_PORT=
RABBIT_HOST=
RABBIT_PORT=
CELERY_TASK_TRACK_STARTED=
ACCEPT_CONTENT=
RESULT_SERIALIZER=
TASK_SERIALIZER=
TIMEZONE=
YOOKASSA_SHOP_ID=
YOOKASSA_SECRET_KEY=
YOOKASSA_RETURN_URL=
STATIC_FILES=/path/to/static/
MEDIA_FILES=/path/to/media/
- Build of the project:
docker-compose up -d --build
- Creating migrations:
docker exec web python manage.py makemigrations
- Application of migrations:
docker exec web python manage.py migrate
- Initialization of the project:
docker-compose exec make initial
- Adding a superuser:
docker-compose exec web python manage.py createsuperuser
API documentation is available at /api/v1
.
A brief presentation of the documentation:
For details, see the LICENSE file.