From 1afa3fe51e949b2c813e01362720726d9bb95253 Mon Sep 17 00:00:00 2001 From: Thomas Fransolet Date: Tue, 28 Apr 2026 12:04:15 +0200 Subject: [PATCH] init readme --- README.md | 125 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 125 insertions(+) diff --git a/README.md b/README.md index eaf2eae..3b4bb5a 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,127 @@ # visitapp-web +App visiteur web MyInfoMate — `app.myinfomate.be/[slug]` + +Next.js 14+ (App Router), TypeScript, Tailwind CSS. + +--- + +## Prérequis + +- Node.js 20+ +- npm ou pnpm +- Accès à une instance `manager-service` (local ou prod) + +--- + +## Variables d'environnement + +| Variable | Description | +|----------|-------------| +| `NEXT_PUBLIC_API_URL` | URL de base de `manager-service` | + +Créer les fichiers suivants (non commités) : + +```bash +# .env.local — dev local vers backend local +NEXT_PUBLIC_API_URL=http://localhost:5000 + +# .env.production.local — build local vers backend prod +NEXT_PUBLIC_API_URL=https://api.myinfomate.be +``` + +--- + +## Développement local + +```bash +npm install +npm run dev +``` + +L'app tourne sur `http://localhost:3000`. + +Pour tester un slug client : `http://localhost:3000/nom-du-client` + +--- + +## Tester un build local pointant vers la prod + +```bash +# Crée .env.production.local avec NEXT_PUBLIC_API_URL=https://api.myinfomate.be +npm run build +npm run start +``` + +Permet de valider le build de production avec les vraies données avant déploiement. + +--- + +## Déploiement + +Le déploiement est manuel via Docker sur le serveur. + +### 1. Se connecter au serveur + +```bash +ssh user@server +cd /path/to/manager-service +``` + +### 2. Builder et relancer le conteneur - A VERIFIER AVANT DE LANCER + +```bash +docker compose -f docker-compose-myinfomate.yml build visitapp-web +docker compose -f docker-compose-myinfomate.yml up -d visitapp-web +``` + +### 3. Vérifier + +```bash +docker compose -f docker-compose-myinfomate.yml logs -f visitapp-web +``` + +L'app est accessible sur `https://app.myinfomate.be`. + +--- + +## Structure du projet + +``` +src/ +├── app/ +│ ├── [slug]/ +│ │ ├── layout.tsx # Fetch config client, inject thème CSS +│ │ ├── page.tsx # Accueil (grille configurations) +│ │ ├── sections/ +│ │ │ └── [sectionId]/ +│ │ │ └── page.tsx # Dispatcher par type de section +│ │ ├── agenda/ +│ │ ├── map/ +│ │ └── ... +│ └── layout.tsx # Root layout +├── lib/ +│ ├── api/ # Client généré depuis OpenAPI manager-service +│ └── i18n.ts # Helper traductions (TranslationDTO[]) +├── components/ +│ ├── ui/ # Composants génériques +│ └── sections/ # Un composant par type de section +└── context/ + └── VisitorContext.tsx # Langue sélectionnée, config client +``` + +--- + +## Theming multi-client + +Le thème est injecté dynamiquement depuis `ConfigurationDTO` : + +```css +:root { + --color-primary: #e52122; + --color-secondary: #ed7082; +} +``` + +Tous les composants utilisent `var(--color-primary)` — aucune config par client +côté code, tout vient du backend.