Skip to content

Latest commit

 

History

History
116 lines (83 loc) · 3.12 KB

README.md

File metadata and controls

116 lines (83 loc) · 3.12 KB

Cloud Storage

СI/CD Codecov Python 3.12 MIT License Ruff

📖 Key features

  • Microservice architecture
  • gRPC between services
  • Fast serialization with MessagePack
  • Access and refresh JWT tokens
  • Active sessions control
  • Fast file upload/downolad
  • Emails with new login info
  • Main DB - PostgreSQL
  • DB for cache - Redis
  • S3 for files and logs - MinIO
  • Message broker between Gateway and Mail service - Apache Kafka
  • Monitoring - Prometheus & Grafana
  • Log aggregation - Promtail & Loki & Grafana

Architecture

Note

API located at /api

Docs located at /api/docs, but Swagger does not support MessagePack, so use another tool to send requests with this content type

Grafana located at /monitoring

💻 Requirements

  • Docker

🛠️ Getting started

  • Copy .env file from examples/dev/ to dev/ folder and fill it in

  • (For dev/prod) Copy redis.conf file from examples/ to dev/ or prod/ folder and fill it in

  • (For prod) Copy .env file from examples/prod/ to prod/ folder and fill it in

  • (For prod) Copy nginx.conf file from examples/prod/ to prod/ folder and fill it in

  • (For prod) Copy docker-compose.cert.yml file from examples/prod/ to prod/ folder and fill it in

🚀 Start

  • Run the dev ver.

    docker compose -f docker-compose.dev.yml up --build -d
  • Run the prod ver. and get a SSL certificate

    • Create the directory on the server

      mkdir -p /cloud_storage/
    • Use SCP to copy the prod files to the server

      scp -r ./prod/* <username>@<host>:/cloud_storage/
    • Run the deploy script

      bash deploy.sh

👷 Maintenance

  • Run tests

    • Get access to the container

      docker exec -it <container_name> sh
    • Install testing dependencies

      pip install -r ./tests/requirements.test.txt
    • Use this command

      pytest

❌ Stop

docker compose -f docker-compose.<dev/prod>.yml stop