|
| 1 | +# AGENTS.md - Sesame Orchestrator |
| 2 | + |
| 3 | +## Vue d'ensemble du projet |
| 4 | + |
| 5 | +`sesame-orchestrator` est un monorepo Node.js/TypeScript basé sur Yarn workspaces + Turbo. |
| 6 | + |
| 7 | +Le projet contient deux applications principales : |
| 8 | + |
| 9 | +- `apps/api` : API backend en **NestJS**. |
| 10 | +- `apps/web` : application frontend en **Nuxt 3**. |
| 11 | + |
| 12 | +Le dépôt est orienté synchronisation d'identités multi-sources, avec une architecture modulaire côté API et une SPA côté Web. |
| 13 | + |
| 14 | +## Stack et architecture |
| 15 | + |
| 16 | +| Couche | Technologie | |
| 17 | +| --- | --- | |
| 18 | +| Monorepo | Yarn workspaces (`apps/*`, `packages/*`) | |
| 19 | +| Orchestration tâches | Turbo (`turbo.json`) | |
| 20 | +| API | NestJS + TypeScript | |
| 21 | +| Web | Nuxt 3 + Vue 3 + TypeScript | |
| 22 | +| Lint/Format | ESLint + Prettier + EditorConfig | |
| 23 | + |
| 24 | +### Structure principale |
| 25 | + |
| 26 | +```text |
| 27 | +sesame-orchestrator/ |
| 28 | +├── apps/ |
| 29 | +│ ├── api/ # Backend NestJS |
| 30 | +│ └── web/ # Frontend Nuxt 3 (srcDir: src) |
| 31 | +├── packages/ # Packages partagés (si présents) |
| 32 | +├── turbo.json # Pipeline monorepo |
| 33 | +├── .eslintrc.js # ESLint racine |
| 34 | +├── .prettierrc # Prettier racine |
| 35 | +├── .editorconfig # Règles d'édition globales |
| 36 | +└── Makefile # Workflow Docker/dev local |
| 37 | +``` |
| 38 | + |
| 39 | +## Conventions monorepo |
| 40 | + |
| 41 | +- Utiliser les scripts racine pour les commandes transverses (`build`, `start:*`, `lint`, `format`). |
| 42 | +- Préserver la séparation des responsabilités : logique métier dans `apps/api`, UI/composables/stores dans `apps/web`. |
| 43 | +- Limiter les changements au périmètre de la demande (pas de refactor global hors besoin explicite). |
| 44 | +- Respecter les conventions de chaque application plutôt que d'imposer un style unique artificiel. |
| 45 | + |
| 46 | +## API (`apps/api`) - conventions NestJS |
| 47 | + |
| 48 | +### Organisation |
| 49 | + |
| 50 | +- Structure par domaines (`core`, `management`, `settings`, etc.). |
| 51 | +- Pattern dominant `controller` <-> `service`. |
| 52 | +- TypeScript compilé en CommonJS (cf. `apps/api/tsconfig.json`). |
| 53 | + |
| 54 | +### Scripts utiles |
| 55 | + |
| 56 | +```bash |
| 57 | +yarn workspace @libertech-fr/sesame-orchestrator_api start:dev |
| 58 | +yarn workspace @libertech-fr/sesame-orchestrator_api build |
| 59 | +yarn workspace @libertech-fr/sesame-orchestrator_api lint |
| 60 | +yarn workspace @libertech-fr/sesame-orchestrator_api lint:fix |
| 61 | +``` |
| 62 | + |
| 63 | +### Qualité de code |
| 64 | + |
| 65 | +- Favoriser des services fins et testables. |
| 66 | +- Éviter `any` sauf exception justifiée (la racine interdit `@typescript-eslint/no-explicit-any`). |
| 67 | +- Conserver les imports et chemins d'alias existants (`~/*`, `@/*`) quand applicables. |
| 68 | + |
| 69 | +## Web (`apps/web`) - conventions Nuxt 3 |
| 70 | + |
| 71 | +### Architecture |
| 72 | + |
| 73 | +- Application configurée en SPA (`ssr: false` dans `nuxt.config.ts`). |
| 74 | +- `srcDir` défini à `src`. |
| 75 | +- Organisation attendue : `src/pages`, `src/components`, `src/composables`, `src/stores`. |
| 76 | + |
| 77 | +### Scripts utiles |
| 78 | + |
| 79 | +```bash |
| 80 | +yarn workspace @libertech-fr/sesame-orchestrator_web start:dev |
| 81 | +yarn workspace @libertech-fr/sesame-orchestrator_web build |
| 82 | +yarn workspace @libertech-fr/sesame-orchestrator_web lint |
| 83 | +yarn workspace @libertech-fr/sesame-orchestrator_web lint:fix |
| 84 | +``` |
| 85 | + |
| 86 | +### Règles de développement |
| 87 | + |
| 88 | +- Privilégier TypeScript strict côté logique métier/composables. |
| 89 | +- Garder les composants Vue ciblés et lisibles. |
| 90 | +- Respecter la configuration Nuxt existante (runtime config, modules, proxy, pinia, quasar, sentry). |
| 91 | +- Ne pas introduire de logique SSR, routes serveur ad hoc, ni comportement contraire à `ssr: false`. |
| 92 | + |
| 93 | +## ESLint, Prettier, EditorConfig (obligatoire) |
| 94 | + |
| 95 | +### ESLint |
| 96 | + |
| 97 | +- Racine : `.eslintrc.js` avec `plugin:@typescript-eslint/recommended` + `plugin:prettier/recommended`. |
| 98 | +- API : `apps/api/.eslintrc.js` (override local autorisant certaines règles). |
| 99 | +- Web : lint via `eslint .` (config Nuxt/eslint stack du projet). |
| 100 | + |
| 101 | +Commandes standard : |
| 102 | + |
| 103 | +```bash |
| 104 | +yarn lint |
| 105 | +yarn workspace @libertech-fr/sesame-orchestrator_api lint |
| 106 | +yarn workspace @libertech-fr/sesame-orchestrator_web lint |
| 107 | +``` |
| 108 | + |
| 109 | +### Prettier |
| 110 | + |
| 111 | +Racine (`.prettierrc`) : |
| 112 | + |
| 113 | +- `semi: false` |
| 114 | +- `singleQuote: true` |
| 115 | +- `trailingComma: all` |
| 116 | +- `arrowParens: always` |
| 117 | +- `printWidth: 180` |
| 118 | + |
| 119 | +Commande de format racine : |
| 120 | + |
| 121 | +```bash |
| 122 | +yarn format |
| 123 | +``` |
| 124 | + |
| 125 | +### EditorConfig |
| 126 | + |
| 127 | +Règles globales (`.editorconfig`) : |
| 128 | + |
| 129 | +- indentation : 2 espaces |
| 130 | +- fin de ligne : LF |
| 131 | +- charset : UTF-8 |
| 132 | +- suppression des espaces fin de ligne |
| 133 | +- newline finale obligatoire |
| 134 | +- exception : pas de trim trailing whitespace sur `*.md` |
| 135 | +- exception : tabulation pour `Makefile` |
| 136 | + |
| 137 | +## Workflow de développement |
| 138 | + |
| 139 | +### Via scripts npm/yarn |
| 140 | + |
| 141 | +```bash |
| 142 | +yarn install |
| 143 | +yarn start:dev |
| 144 | +yarn build |
| 145 | +yarn lint |
| 146 | +``` |
| 147 | + |
| 148 | +### Via Makefile (Docker/dev env) |
| 149 | + |
| 150 | +```bash |
| 151 | +make dbs |
| 152 | +make dev |
| 153 | +make stop |
| 154 | +``` |
| 155 | + |
| 156 | +## Règles de contribution pour agents IA |
| 157 | + |
| 158 | +1. Respecter en priorité les configurations réelles du dépôt (`.eslintrc.js`, `.prettierrc`, `.editorconfig`, `turbo.json`). |
| 159 | +2. Ne pas introduire d'outils parallèles de lint/format sans demande explicite. |
| 160 | +3. Après modification de code, exécuter au minimum le lint ciblé de l'application touchée. |
| 161 | +4. Éviter les changements de style massifs non liés à la tâche. |
| 162 | +5. Conserver la cohérence des scripts existants (`start:dev`, `start:prod`, `start:debug`, `lint`, `build`). |
| 163 | +6. Documenter brièvement les choix non évidents dans la PR/commit. |
| 164 | + |
| 165 | +## Raccourcis utiles |
| 166 | + |
| 167 | +```bash |
| 168 | +# Monorepo |
| 169 | +yarn start:dev |
| 170 | +yarn lint |
| 171 | +yarn format |
| 172 | + |
| 173 | +# API |
| 174 | +yarn workspace @libertech-fr/sesame-orchestrator_api start:dev |
| 175 | +yarn workspace @libertech-fr/sesame-orchestrator_api lint:fix |
| 176 | + |
| 177 | +# Web |
| 178 | +yarn workspace @libertech-fr/sesame-orchestrator_web start:dev |
| 179 | +yarn workspace @libertech-fr/sesame-orchestrator_web lint:fix |
| 180 | +``` |
0 commit comments