Files
benevoles/backend
AdamThomasandClaude Opus 5.5 6892e0307d
ci-cd / build-backend (push) Successful in 33s
ci-cd / build-frontend (push) Successful in 20s
ci-cd / deploy (push) Successful in 14s
Photo du bénévole ajoutée par la coordination
Section « Photo » sur la fiche bénévole (ajouter / remplacer / retirer),
PUT/DELETE /editions/{id}/volunteers/{vid}/photo (COORDINATION),
validation de l'image partagée avec le formulaire public (read_photo).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 18:17:25 +01:00
..
2026-09-09 22:19:58 +02:00
2026-09-09 22:19:58 +02:00

Backend — API de gestion des bénévoles

FastAPI · SQLModel · PostgreSQL · Alembic. Dépendances gérées par uv.

Développement

Toujours via Docker Compose depuis la racine du dépôt :

docker compose up --build          # démarre db + backend (reload actif)
docker compose run --rm backend uv run pytest
docker compose run --rm backend uv run ruff check .

Migrations

docker compose run --rm backend uv run alembic revision --autogenerate -m "..."
docker compose run --rm backend uv run alembic upgrade head

Structure

Chemin Rôle
app/main.py Instance FastAPI, middlewares, routers
app/config.py Configuration (variables d'environnement)
app/db.py Engine SQLAlchemy + dépendance de session
app/api/ Routers HTTP
app/models/ Tables SQLModel du domaine
app/validation/ Moteur de règles d'affectation (cœur du produit)
app/i18n/ t(key) + locales/fr.json — aucun texte en dur ailleurs
app/migrations/ Alembic
tests/ pytest, base de test PostgreSQL réelle

Note

uv.lock est versionné (généré dans le conteneur). Le régénérer après toute modification des dépendances : docker compose run --rm backend uv lock.