Files
MABEA/backend/README.md
T
patrickandClaude Sonnet 5 48b6d6a5be
CI / backend-tests (push) Failing after 1s
Sprint 0: FastAPI-Skeleton, vollständiges DB-Schema (Alembic), Auth (JWT/bcrypt), Rollen-Dependency, CI
- Vollständiges Ziel-Schema aus Prompt 20 als initiale Migration (inkl. Karte-13-Vorbereitung: UUID-PKs, systemknoten)
- Seed-Migration für Hauptserver-Datensatz (Sprintplan E6)
- JWT-Login + /auth/me, require_roles-Dependency (Prompt 05 Berechtigungsmatrix)
- Tests: health, login/me, Rollen-Ablehnung/-Zulassung (S0-Abnahmekriterien)
- Gitea-Actions-CI: install -> migrate -> pytest mit Coverage-Gate 50%

Nur Code/Config erzeugt, nicht lokal installiert oder ausgeführt (Deployment-Regel).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L85hmKbvX7Cqkq47KnQhFt
2026-09-03 22:32:54 +02:00

36 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# MABEA Backend Sprint 0
FastAPI-Skeleton, Datenbankschema (Alembic), Auth (JWT), Rollen-Dependency. Details: `ergebnisse/sprintplan.md`, `ergebnisse/19_technische_architektur.md`, `ergebnisse/20_datenbank_schema.md`.
## Setup (auf dem Zielsystem, nicht lokal)
```bash
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
cp example.env .env
# .env editieren: DATABASE_URL, JWT_SECRET_KEY, SYSTEMKNOTEN_ID
alembic upgrade head
uvicorn app.main:app --host 0.0.0.0 --port 8000
```
## Tests (CI oder Zielsystem)
```bash
pytest
```
Erwartet eine per Alembic migrierte PostgreSQL-Test-Datenbank (`DATABASE_URL` zeigt darauf). CI-Workflow: `.gitea/workflows/ci.yml`.
## Struktur
- `app/core/app_settings.py` Konfiguration aus Umgebungsvariablen
- `app/core/security.py` Passwort-Hashing, JWT
- `app/db/` SQLAlchemy Engine/Session
- `app/models/` ORM-Modelle (Sprint 0: nur Auth-relevante Tabellen; weitere Modelle folgen Sprint 1+)
- `app/api/` FastAPI-Router, Dependencies (u.a. `require_roles` für Prompt-05-Berechtigungsmatrix)
- `alembic/versions/0001_initial_schema.py` vollständiges Ziel-Schema (Prompt 20), auch für Tabellen, die erst spätere Sprints per API befüllen
- `alembic/versions/0002_seed_hauptserver.py` Sprintplan E6: seedet den einen `systemknoten`-Datensatz (`typ='haupt'`)