Skip to content

Latest commit

Β 

History

History
96 lines (66 loc) Β· 2.27 KB

File metadata and controls

96 lines (66 loc) Β· 2.27 KB

Mini Dropbox Backend

A personal file storage service MVP (like a mini-Dropbox) built with a strict Domain-Driven Design (DDD) and Clean Architecture approach.

πŸš€ Tech Stack

  • Language: Python 3.12+
  • Web Framework: FastAPI (Async)
  • Database: PostgreSQL (Async via asyncpg)
  • ORM: SQLAlchemy 2.0
  • Object Storage: MinIO (S3 Compatible)
  • Dependency Manager: uv
  • Migrations: Alembic
  • Containerization: Docker & Docker Compose

πŸ—οΈ Architecture

This project adheres to the Dependency Rule: dependencies only point inwards.

src/
β”œβ”€β”€ domain/           # Enterprise Logic (Pure Python, No Frameworks)
β”œβ”€β”€ application/      # Application Business Rules (Use Cases, DTOs)
β”œβ”€β”€ interfaces/       # Interface Adapters (FastAPI Routers, Pydantic Schemas)
└── infrastructure/   # Frameworks & Drivers (SQLAlchemy, MinIO, Settings)

✨ Features

  • User Management: Registration, Login, Authentication.
  • File System:
    • Upload/Download files.
    • Create/List folders.
    • Hierarchical structure.
  • Sharing:
    • Generate public read-only links.
    • Expiration support.
    • Disable/Revoke links.
  • Sync (Delta):
    • (In Progress) polling mechanism for changes.

πŸ› οΈ Getting Started

Prerequisites

  • Docker & Docker Compose
  • uv (Python package manager)

1. Environment Setup

The project relies on environment variables. For local development, default values are provided in src/infrastructure/config/settings.py.

2. Start Infrastructure

Spin up PostgreSQL and MinIO:

docker-compose up -d

3. Install Dependencies

uv sync

4. Run Migrations

Apply database schema changes:

uv run alembic upgrade head

5. Run the Application

Start the FastAPI development server:

uv run fastapi dev src/interfaces/api/main.py
  • API: http://localhost:8000
  • Docs: http://localhost:8000/docs

6. Running Tests

Run the test suite (requires Docker infra running):

uv run pytest

πŸ“ Development Rules

See ARCHITECTURE_RULES.md for detailed coding guidelines regarding the DDD structure and strict separation of concerns.