feat: migrate showcase to Next.js and overhaul CRM UI

- rebuild the public site on the Next.js App Router with static export,
  per-section SEO pages, metadata, sitemap, robots and a generated OG image
- add full-screen scroll-snap regions, staged scroll reveals, a hash-free
  tab navigation with a sliding indicator and region-by-region menu scrolling
- replace the theme text toggle with animated sun/moon icons
- restructure the CRM API into config, middleware, models, routes, services
  and utils layers
- redesign the CRM shell with a single surface, tab rail, full-width blurred
  DataTable, record dialogs and mask-based icons
- update Docker/Nginx publishing, Makefile targets, shared UI polish and docs
This commit is contained in:
2026-11-16 00:52:29 +01:00
parent ab4cde1ce2
commit 09cf07d79b
113 changed files with 6427 additions and 2364 deletions
+33 -21
View File
@@ -1,35 +1,42 @@
# API et modèle de données — CoHaiSe CRM
Base : **`/api/crm`**, plus `GET /healthz` (sonde base, `503` si indisponible).
`attachUser` sur les quatre préfixes ; `requireAuth` sur chaque route sauf la
connexion. **Aucune route n'est protégée par un rôle** depuis `007_no_roles.sql`.
`attachUser` sur `auth`, `countries`, `organizations` et `contacts` ;
`requireAuth` sur toutes leurs routes sauf la connexion. `POST /leads` est
public (formulaire de la vitrine). **Aucune route n'est protégée par un rôle**
depuis `007_no_roles.sql`.
## Routes
| Méthode | Chemin | Fichier |
| --- | --- | --- |
| POST | `/api/crm/auth/login` | `routes/auth.ts:64` |
| POST | `/api/crm/auth/logout` | `routes/auth.ts:98` |
| GET | `/api/crm/auth/me` | `routes/auth.ts:105` |
| POST | `/api/crm/auth/change-password` | `routes/auth.ts:114` |
| GET | `/api/crm/countries?q=` | `routes/countries.ts:46` |
| POST | `/api/crm/countries` | `routes/countries.ts:57` |
| PATCH | `/api/crm/countries/:id` | `routes/countries.ts:88` |
| DELETE | `/api/crm/countries/:id` | `routes/countries.ts:132` |
| GET | `/api/crm/organizations?q&page&limit` | `routes/organizations.ts:105` |
| GET | `/api/crm/organizations/:id` | `routes/organizations.ts:135` |
| POST | `/api/crm/organizations` | `routes/organizations.ts:146` |
| PATCH | `/api/crm/organizations/:id` | `routes/organizations.ts:200` |
| DELETE | `/api/crm/organizations/:id` | `routes/organizations.ts:262` |
| GET | `/api/crm/contacts?q&organizationId&page&limit` | `routes/contacts.ts:96` |
| GET | `/api/crm/contacts/:id` | `routes/contacts.ts:140` |
| POST | `/api/crm/contacts` | `routes/contacts.ts:151` |
| PATCH | `/api/crm/contacts/:id` | `routes/contacts.ts:202` |
| DELETE | `/api/crm/contacts/:id` | `routes/contacts.ts:260` |
| POST | `/api/crm/auth/login` | `routes/authRoutes.ts` |
| POST | `/api/crm/auth/logout` | `routes/authRoutes.ts` |
| GET | `/api/crm/auth/me` | `routes/authRoutes.ts` |
| POST | `/api/crm/auth/change-password` | `routes/authRoutes.ts` |
| GET | `/api/crm/countries?q=` | `routes/countryRoutes.ts` |
| POST | `/api/crm/countries` | `routes/countryRoutes.ts` |
| PATCH | `/api/crm/countries/:id` | `routes/countryRoutes.ts` |
| DELETE | `/api/crm/countries/:id` | `routes/countryRoutes.ts` |
| GET | `/api/crm/organizations?q&page&limit` | `routes/organizationRoutes.ts` |
| GET | `/api/crm/organizations/:id` | `routes/organizationRoutes.ts` |
| POST | `/api/crm/organizations` | `routes/organizationRoutes.ts` |
| PATCH | `/api/crm/organizations/:id` | `routes/organizationRoutes.ts` |
| DELETE | `/api/crm/organizations/:id` | `routes/organizationRoutes.ts` |
| GET | `/api/crm/contacts?q&organizationId&page&limit` | `routes/contactRoutes.ts` |
| GET | `/api/crm/contacts/:id` | `routes/contactRoutes.ts` |
| POST | `/api/crm/contacts` | `routes/contactRoutes.ts` |
| PATCH | `/api/crm/contacts/:id` | `routes/contactRoutes.ts` |
| DELETE | `/api/crm/contacts/:id` | `routes/contactRoutes.ts` |
| POST | `/api/crm/leads` | `routes/leadRoutes.ts` |
Chaque route valide son corps puis délègue à `services/*Service.ts` ; aucune
requête SQL n'est écrite dans `routes/`.
### Conventions communes
- Corps validés par Zod (`createX`/`updateX`, `credentials`, `changePassword`).
- Corps validés par Zod dans les routes (`createXBody`, `updateXBody`,
`credentials`, `newPassword`, `leadBody`).
- `:id` UUID validé par regex ⇒ **404** sinon (pays : entier `> 0` sinon 404).
- Pagination : `limit` borné `1..100`, défaut 25 ; `q` fait une recherche
texte.
@@ -84,3 +91,8 @@ CLI : `cohaise-migrate --dir <dossier> [--dry-run] [--check]`, codes `0` / `1`
Le DDL MariaDB n'est pas transactionnel : une migration interrompue se corrige
par un **nouveau** fichier, jamais en éditant l'ancien.
`make crm-migrate` applique les migrations **puis reconstruit et redémarre
l'API** : un binaire plus ancien que le schéma (par exemple du code qui lit
encore `roles` après `007`) répondrait `NOT_MIGRATED` alors que la base est à
jour.