generated from coulomb/repo-seed
DirektVermittlungDe Backend (Reference Implementation)
This repository contains a FastAPI-based reference implementation of the DirektVermittlungDe (DVD) backend.
DVD provides document-centric communication between citizens and authorities: citizens upload a letter or provide an Aktenzeichen, the system auto-routes it to the responsible unit and opens an interaction thread for clarification instead of a phone-based "Schnitzeljagd".
Features
-
Document Intake (
POST /documents)- Split-payload model: plaintext metadata + encrypted payload.
- Auto-routing to assigned unit.
-
Interaction Threads
- Create a thread per document (
/documents/{id}/threads). - Citizen/official messages via
/threads/{threadId}/messages. - Cursor-based pagination for message history.
- Create a thread per document (
-
Exports
- Async export workflow (
POST /exports) with job IDs and status polling.
- Async export workflow (
-
Security & NFR Alignment
- OAuth2 / JWT-based auth (scopes:
citizen:write,official:read,official:write). - Document retention date for GDPR-friendly cleanup.
- Architected for async I/O and offloading CPU-heavy work (hybrid concurrency).
- OAuth2 / JWT-based auth (scopes:
Quickstart
-
Install dependencies
pip install -e . -
Run DB migrations (simple metadata create)
python -m app.scripts.init_db -
Run the API
uvicorn app.main:app --reload -
Open Swagger UI
Visit:
http://localhost:8000/docs