Skip to content

Latest commit

 

History

History
220 lines (190 loc) · 12.1 KB

README.en.md

File metadata and controls

220 lines (190 loc) · 12.1 KB

Online Store

Static Badge Static Badge Static Badge Static Badge Static Badge
Static Badge Static Badge Static Badge Static Badge Static Badge Static Badge

Language: Русский, English 🌍

📃 Content

  1. ✏️ Project description
  2. 📱 Project technologies
  3. 📚 Dependencies used
  4. 📈 Relationships between tables
  5. 📽️ Example work
  6. 🔧 Project Features
  7. 🔌 Installation and launch
  8. 📗 API Documentation
  9. 🔐 License
  10. 🧙‍♂️ Authors

✏️ Description of the project

A project based on the Django Rest Framework, designed to show the interaction of the "Online Store" with:

Customer, Manager / Admin, Provider and Courier.

📋 Tasks

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

📟 Functional features

An approximate list of endpoints and their capabilities.

📱 Project technologies

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

📚 Dependencies used

  • 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

📈 Relationships between tables

img.png

📽️ Example work.

  1. An example of how Database copying works. Download video in the best quality. copy_bd

  1. An example of the work of **Placing an order and paying for it in Yookassa**. Download video in the best quality. pay_yookassa

🔧 Project Features

[WARNING] If you encounter errors when starting a project, a couple of recommendations below can help you!

  1. When you start the project, you get an error. This link can help you.
  2. You have a logging error when logging into the documentation. This link 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

🔌 Installation and launch

Warning

If you have all the following on your computer, you can skip this warning.

  • You may need to register in Sentry
  • You can try to register with Yookassa to test the platform.

📔 Installing the project in the IDE

  • 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/

🐳 Installing the project in Docker

  • 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

API documentation is available at /api/v1.
A brief presentation of the documentation: swagger

🔐 License

For details, see the LICENSE file.

🧙‍♂️ Authors