Skip to content

Cloud Storage app with microservice architecture. Written using Litestar and gRPC framework

License

Notifications You must be signed in to change notification settings

j3rrryy/cloud_storage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cloud Storage

СI/CD 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 - MinIO
  • Message broker between Gateway and Mail service - Apache Kafka

📝 To-Do list

  • Tests
  • Logs processing - Graylog, Elasticsearch, MongoDB
  • Metrics processing - Prometheus, 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

💻 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

❌ Stop

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