merge
This commit is contained in:
@@ -8,3 +8,10 @@ POSTGRES_DB=benevoles
|
|||||||
# Secret de signature des jetons (lien magique / session), >= 32 octets.
|
# Secret de signature des jetons (lien magique / session), >= 32 octets.
|
||||||
# À régénérer en production : openssl rand -hex 32
|
# À régénérer en production : openssl rand -hex 32
|
||||||
JWT_SECRET=dev-insecure-secret-change-me-please-32b
|
JWT_SECRET=dev-insecure-secret-change-me-please-32b
|
||||||
|
|
||||||
|
# Frontend (service `frontend` du docker-compose).
|
||||||
|
# mock (défaut) : jeu de démonstration en mémoire, aucun backend requis.
|
||||||
|
# http : API réelle — renseigner alors VITE_EDITION_ID avec l'UUID
|
||||||
|
# d'une édition (créée p. ex. par `python -m app.seed`).
|
||||||
|
VITE_API_MODE=mock
|
||||||
|
# VITE_EDITION_ID=
|
||||||
|
|||||||
@@ -14,9 +14,14 @@ cp .env.example .env
|
|||||||
docker compose up --build
|
docker compose up --build
|
||||||
```
|
```
|
||||||
|
|
||||||
|
- Frontend : http://localhost:5173
|
||||||
- API : http://localhost:8000
|
- API : http://localhost:8000
|
||||||
- Documentation interactive : http://localhost:8000/docs
|
- Documentation interactive : http://localhost:8000/docs
|
||||||
|
|
||||||
|
Le frontend démarre en mode `mock` (jeu de démonstration en mémoire, aucun
|
||||||
|
backend requis). Pour le brancher sur l'API réelle : `VITE_API_MODE=http` et
|
||||||
|
`VITE_EDITION_ID=<uuid>` dans `.env` (voir `frontend/README.md`).
|
||||||
|
|
||||||
## Tests
|
## Tests
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@@ -31,6 +36,6 @@ démarrage du conteneur PostgreSQL.
|
|||||||
| Dossier | Rôle |
|
| Dossier | Rôle |
|
||||||
|--------------|-------------------------------------------------|
|
|--------------|-------------------------------------------------|
|
||||||
| `backend/` | API FastAPI, modèle SQLModel, migrations Alembic |
|
| `backend/` | API FastAPI, modèle SQLModel, migrations Alembic |
|
||||||
| `frontend/` | Interface React + Vite + TS + Tailwind (étape ultérieure) |
|
| `frontend/` | Interface React + Vite + TS + Tailwind (service `frontend`) |
|
||||||
| `deploy/` | Configuration de déploiement production |
|
| `deploy/` | Configuration de déploiement production |
|
||||||
| `.github/` | Chaîne CI/CD (build → GHCR → SSH sur le VPS) |
|
| `.github/` | Chaîne CI/CD (build → GHCR → SSH sur le VPS) |
|
||||||
|
|||||||
@@ -36,6 +36,26 @@ services:
|
|||||||
- ./backend:/app
|
- ./backend:/app
|
||||||
- venv:/app/.venv
|
- venv:/app/.venv
|
||||||
|
|
||||||
|
frontend:
|
||||||
|
build: ./frontend
|
||||||
|
command: npm run dev -- --host --port 5173
|
||||||
|
environment:
|
||||||
|
# mock = jeu de démonstration en mémoire (défaut, aucun backend requis).
|
||||||
|
# http = API réelle : renseigner aussi VITE_EDITION_ID (UUID d'une édition
|
||||||
|
# existante, p. ex. après `docker compose run --rm backend uv run python -m app.seed`).
|
||||||
|
VITE_API_MODE: ${VITE_API_MODE:-mock}
|
||||||
|
VITE_EDITION_ID: ${VITE_EDITION_ID:-}
|
||||||
|
# Cible du proxy `/api` de Vite à l'intérieur du réseau compose.
|
||||||
|
VITE_API_TARGET: http://backend:8000
|
||||||
|
ports:
|
||||||
|
- "5173:5173"
|
||||||
|
depends_on:
|
||||||
|
- backend
|
||||||
|
volumes:
|
||||||
|
- ./frontend:/app
|
||||||
|
- frontend_node_modules:/app/node_modules
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
db_data:
|
db_data:
|
||||||
venv:
|
venv:
|
||||||
|
frontend_node_modules:
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
node_modules
|
||||||
|
dist
|
||||||
|
.vite
|
||||||
|
*.tsbuildinfo
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
.DS_Store
|
||||||
Reference in New Issue
Block a user