Thomas Fransolet 1afa3fe51e init readme
2026-04-28 12:04:15 +02:00
2026-04-28 12:04:15 +02:00

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) :

# .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

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

# 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

ssh user@server
cd /path/to/manager-service

2. Builder et relancer le conteneur - A VERIFIER AVANT DE LANCER

docker compose -f docker-compose-myinfomate.yml build visitapp-web
docker compose -f docker-compose-myinfomate.yml up -d visitapp-web

3. Vérifier

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 :

: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.

Description
No description provided
Readme 93 KiB
Languages
TypeScript 98.7%
CSS 1.2%
JavaScript 0.1%