4b90925c2aff44f7e4f41547ab5057e7b692fe13
- Remove contradictory tasks/artifacts.py (artifacts go to owning modules) - Distinguish simple (5) vs complex (3) actors for _run_actor() pattern - Make apply_partial_update sync (no I/O) - Remove soft_delete helper (one-liner, confusing with dual patterns) - Fix false dead code claim about media/service.py json import - Add all project_pct → progress_pct reference locations - Add broker import order risk and worker command change - Add _run_async() and _parse_frame_rate() placement Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Documentation
This folder contains documentation and references for the Coffee Project Backend API.
Project Structure
cpv3/
├── api/ # Versioned API routers
│ └── v1/
│ └── router.py # Aggregates all module routers
├── common/ # Cross-cutting concerns and utilities
│ └── schemas.py # Base Pydantic schema
├── db/ # Database configuration
│ ├── base.py # SQLAlchemy base classes
│ ├── models.py # All ORM models (optional central import)
│ └── session.py # Database session management
├── infrastructure/ # App bootstrapping, config, security, external integrations
│ ├── settings.py # Application settings (Pydantic)
│ ├── security.py # Password hashing, JWT tokens
│ ├── auth.py # Authentication dependencies
│ ├── deps.py # Infrastructure-level dependencies
│ └── storage/ # Storage backends
│ ├── base.py # StorageService and protocol
│ ├── local.py # Local filesystem backend
│ ├── s3.py # S3/MinIO backend
│ └── types.py # Storage types
├── modules/ # Feature modules
│ ├── captions/
│ ├── files/ # File management (renamed from storage)
│ ├── jobs/
│ ├── media/
│ ├── projects/
│ ├── system/
│ ├── transcription/
│ ├── users/
│ └── webhooks/
└── main.py # FastAPI application entry point
Module Structure
Each module follows this structure:
router.py- HTTP concerns only (request/response, status codes, dependencies)schemas.py- Pydantic DTOs onlyservice.py- Business logic + orchestration (calls repositories + other services)repository.py- All DB queries (SQLAlchemy session usage)models.py- ORM models only
API Versioning
The API uses URL-based versioning. All routes are mounted under /api/ prefix.
Description
Languages
Python
99.2%
Dockerfile
0.7%
Mako
0.1%