126 lines
3.1 KiB
Markdown
126 lines
3.1 KiB
Markdown
# Project Context - Le Juste Poids
|
||
|
||
Ce fichier sert de handoff rapide pour reprendre le projet dans une nouvelle conversation Copilot.
|
||
|
||
Specification metier complete:
|
||
|
||
- `SPEC_FONCTIONNELLE.md`
|
||
|
||
## 1) Stack et structure
|
||
|
||
- Monorepo npm workspaces
|
||
- API: NestJS + Prisma + PostgreSQL
|
||
- Front: Next.js (App Router)
|
||
- DB locale: Docker Compose
|
||
|
||
Arborescence utile:
|
||
|
||
- `apps/api` - backend NestJS
|
||
- `apps/web` - frontend Next.js
|
||
- `docker-compose.yml` - stack locale (web/api/db)
|
||
|
||
## 2) Commandes utiles
|
||
|
||
Installer:
|
||
|
||
```bash
|
||
npm install
|
||
```
|
||
|
||
Lancer toute la stack:
|
||
|
||
```bash
|
||
docker compose up --build
|
||
```
|
||
|
||
Build API + Web:
|
||
|
||
```bash
|
||
npm run build -w apps/api ; npm run build -w apps/web
|
||
```
|
||
|
||
URLs locales attendues:
|
||
|
||
- Web: `http://localhost:3002`
|
||
- API: `http://localhost:3001`
|
||
- DB: `localhost:5432`
|
||
|
||
## 3) Auth et rôles
|
||
|
||
- Rôles: `ADMIN`, `FAMILY`
|
||
- Login JWT + refresh token
|
||
- `ADMIN` redirigé vers `/admin`
|
||
- `FAMILY` redirigé vers `/predictions`
|
||
|
||
## 4) Workflow concours (état actuel)
|
||
|
||
Le concours suit un flux en 3 phases:
|
||
|
||
1. `OPEN`
|
||
- Les participants peuvent saisir/modifier leurs pronostics.
|
||
- L'admin peut saisir/modifier les valeurs finales (outcomes).
|
||
|
||
2. `CLOSED` (après clôture)
|
||
- Les pronostics participants sont verrouillés.
|
||
- Les outcomes sont verrouillés.
|
||
- L'admin passe sur un wizard de scoring par catégorie:
|
||
- suggestions auto
|
||
- comparaison réponse finale vs réponses candidats
|
||
- validation des points étape par étape
|
||
|
||
3. `finalized = true` (validation définitive)
|
||
- Le concours est validé définitivement.
|
||
- Plus de reouverture possible.
|
||
- Côté participants, la page `/predictions` affiche:
|
||
- gagnant
|
||
- classement final
|
||
- rappel de "vos réponses"
|
||
|
||
## 5) Endpoints pronostics clés
|
||
|
||
Public authentifié:
|
||
|
||
- `GET /predictions/cards`
|
||
- `GET /predictions/board`
|
||
- `GET /predictions/activity`
|
||
- `GET /predictions/scoreboard`
|
||
- `GET /predictions/my-entries`
|
||
- `PUT /predictions/cards/:cardId/my-entry`
|
||
|
||
Admin:
|
||
|
||
- `POST /predictions/game/close`
|
||
- `POST /predictions/game/open`
|
||
- `POST /predictions/game/finalize`
|
||
- `POST /predictions/cards/:cardId/outcomes`
|
||
- `POST /predictions/cards/:cardId/suggest-scores`
|
||
- `PATCH /predictions/entries/:entryId/scores`
|
||
|
||
## 6) Fichiers clés à lire en priorité
|
||
|
||
Backend:
|
||
|
||
- `apps/api/src/predictions/predictions.controller.ts`
|
||
- `apps/api/src/predictions/predictions.service.ts`
|
||
- `apps/api/prisma/schema.prisma`
|
||
|
||
Frontend:
|
||
|
||
- `apps/web/src/app/admin/page.tsx`
|
||
- `apps/web/src/app/predictions/page.tsx`
|
||
- `apps/web/src/lib/predictions-client.ts`
|
||
- `apps/web/src/types/predictions.ts`
|
||
|
||
## 7) Vérifications rapides après modif
|
||
|
||
1. Build API + web.
|
||
2. Parcours manuel:
|
||
- Admin: outcomes en `OPEN`, puis clôture, wizard de scoring, finalisation.
|
||
- Family: après finalisation, vérifier affichage gagnant + vos réponses.
|
||
|
||
## 8) Prompt de reprise prêt à coller
|
||
|
||
```text
|
||
Contexte projet: monorepo Le Juste Poids (NestJS API + Next.js web + Postgres). Lis PROJECT_CONTEXT.md puis inspecte les fichiers clés listés. Je veux que tu poursuives le workflow de fin de concours sans casser l’existant. Commence par vérifier l’état actuel (API + front), puis propose et implémente les changements avec build de validation.
|
||
```
|