From f87cbc0f2f0c5fe40da6c28cc83943a357139175 Mon Sep 17 00:00:00 2001 From: Yvv Date: Tue, 24 Mar 2026 01:22:36 +0100 Subject: [PATCH] =?UTF-8?q?Typo=20Plus=20Jakarta=20Sans=20+=20renommage=20?= =?UTF-8?q?libreDecision=20+=20mode=20d=C3=A9mo=20prod=20+=20seed=20mandat?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fonte : Nunito → Plus Jakarta Sans (moderne, ronde sans être toy) - Logo : ğ(Decision) → libreDecision (libre italic/muted + Decision bold) - Footer et watermark DocumentPreview mis à jour - Mode démo : DEMO_MODE flag dans config.py + auth.py (profils rapides en prod) - docker-compose : ENVIRONMENT=production explicite + DEMO_MODE=true par défaut - Seed : +décision Licence G1 v0.4.0, +3 mandats (ComTech, Admin Forgerons, Modération) runner 7→10 étapes, import Mandate/MandateStep ajouté Co-Authored-By: Claude Sonnet 4.6 --- CLAUDE.md | 101 ++++-- backend/app/config.py | 1 + backend/app/routers/auth.py | 6 +- backend/seed.py | 289 +++++++++++++++++- docker/docker-compose.yml | 2 + frontend/app/app.vue | 21 +- frontend/app/assets/css/moods.css | 12 +- .../components/documents/DocumentPreview.vue | 2 +- frontend/nuxt.config.ts | 2 +- 9 files changed, 384 insertions(+), 52 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index fd8f6c6..ea5bd5d 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,25 +1,88 @@ # libreDecision -Plateforme de decisions collectives pour la communaute Duniter/G1. +Boîte à outils de gouvernance collective pour la communauté Duniter/G1. +Documents modulaires sous vote permanent + protocoles de vote + mandats. +Architecture marque blanche — vocation à être intégré dans sweethomeCloud et librodrome. + +## Protocole de début de session + +1. `git pull --rebase origin main` +2. Si des migrations DB sont attendues : `cd backend && alembic upgrade head` +3. Si l'objectif de la session n'est pas précisé, le demander ## Stack -- **Frontend**: Nuxt 4 + Nuxt UI v3 + Pinia + UnoCSS (port 3002) -- **Backend**: Python FastAPI + SQLAlchemy async + PostgreSQL asyncpg (port 8002) -- **Auth**: Duniter V2 Ed25519 challenge-response -- **Sanctuaire**: IPFS (kubo) + hash on-chain (system.remark) -## Commands -- Backend: `cd backend && uvicorn app.main:app --port 8002 --reload` -- Backend tests: `cd backend && pytest tests/ -v` -- Frontend: `cd frontend && npm run dev` -- Frontend build: `cd frontend && npm run build` -- Migrations: `cd backend && alembic upgrade head` -- Docker: `docker compose -f docker/docker-compose.yml up` +- **Frontend** : Nuxt 4 (Vue 3, TypeScript) + Nuxt UI v3 + Pinia + UnoCSS ; package manager : npm +- **Backend** : Python FastAPI + SQLAlchemy 2.0 async + PostgreSQL asyncpg ; migrations Alembic +- **Auth** : Duniter V2 Ed25519 challenge-response (substrate-interface — stub en dev) +- **Sanctuaire** : IPFS kubo + hash on-chain (system.remark) — TODO sprint 2 +- Déploiement : Docker multi-stage + Traefik (postgres + backend + frontend + ipfs) ; CI Woodpecker -## Conventions -- French for UI text and documentation -- English for code (variable names, comments, docstrings) -- API versioned under `/api/v1/` -- Pydantic v2 for all schemas -- Async everywhere (SQLAlchemy, FastAPI) -- Ed25519 signatures for vote integrity +## Structure + +``` +frontend/ + app/ + components/ # composants Vue + layouts/ # layouts Nuxt + pages/ # routing file-based (9 pages sprint 1) + composables/ # (1 composable sprint 1) + stores/ # 5 Pinia stores (auth, ...) + assets/css/ + moods.css # système de palettes (.mood-* sur ) + utils/ # (2 utils sprint 1) + nuxt.config.ts # port 3002, host 0.0.0.0, apiBase via NUXT_PUBLIC_API_BASE +backend/ + app/ + routers/ # 8 routers : auth, communes, documents, protocols, votes, ... + services/ # 6 services + engine/ # 5 modules : formule inertie, critères Smith/TechComm, médiane + models/ # 14 tables SQLAlchemy + alembic/versions/ # migrations + tests/ # 186 tests (63 intégration TDD sprint 1) + seed.py # Engagement Certification (33 items) + Forgeron (51 items) + Runtime Upgrade +docker/ + docker-compose.yml # postgres + backend + frontend + ipfs + backend.Dockerfile + frontend.Dockerfile +docs/content/ # 7 docs dev + 8 docs user +public/ + hexagram-tsing.svg # sceau 井 (embossed) + hexagram-tsing-flat.svg +``` + +## Données runtime + +- **postgres-data** : volume Docker PostgreSQL — jamais écrasé par les builds +- **ipfs-data** : volume Docker IPFS kubo +- `.env` à la racine : `POSTGRES_USER`, `POSTGRES_PASSWORD`, `POSTGRES_DB`, `SECRET_KEY`, `DOMAIN`, `DUNITER_RPC_URL` + +## Commandes + +```bash +# Backend +cd backend && . venv/bin/activate +uvicorn app.main:app --port 8002 --host 0.0.0.0 --reload +pytest tests/ -v +alembic upgrade head +python seed.py # reseed Engagement Certification + Forgeron + Runtime Upgrade + +# Frontend +cd frontend && npm run dev # :3002 +npm run build + +# Docker +docker compose -f docker/docker-compose.yml up +``` + +## Conventions / pièges + +- **UI français, code anglais** (variables, commentaires, docstrings) +- **API** : préfixe `/api/v1/`, Pydantic v2 pour tous les schémas, async partout (SQLAlchemy + FastAPI) +- **Auth** : `get_current_admin` (24h), `get_current_citizen` (4h), `require_super_admin` +- **Formule inertie** : `Result = C + B^W + (M + (1-M) × (1 - (T/W)^G)) × max(0, T-C)` — voir `backend/app/engine/` +- **Mood system** : `useMood.ts` synchronise `colorMode.preference` avec la palette — **jamais** de `:global()` dans `