@atlashub/smartstack-cli 1.5.1 → 1.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.documentation/css/styles.css +2168 -2168
- package/.documentation/js/app.js +794 -794
- package/config/default-config.json +86 -86
- package/config/settings.json +53 -53
- package/config/settings.local.example.json +16 -16
- package/dist/index.js +0 -0
- package/dist/index.js.map +1 -1
- package/package.json +88 -88
- package/templates/agents/action.md +36 -36
- package/templates/agents/efcore/conflicts.md +84 -84
- package/templates/agents/efcore/db-deploy.md +51 -51
- package/templates/agents/efcore/db-reset.md +59 -59
- package/templates/agents/efcore/db-seed.md +56 -56
- package/templates/agents/efcore/db-status.md +64 -64
- package/templates/agents/efcore/migration.md +85 -85
- package/templates/agents/efcore/rebase-snapshot.md +62 -62
- package/templates/agents/efcore/scan.md +90 -90
- package/templates/agents/efcore/squash.md +67 -67
- package/templates/agents/explore-codebase.md +65 -65
- package/templates/agents/explore-docs.md +97 -97
- package/templates/agents/fix-grammar.md +49 -49
- package/templates/agents/gitflow/abort.md +45 -45
- package/templates/agents/gitflow/cleanup.md +85 -85
- package/templates/agents/gitflow/commit.md +40 -40
- package/templates/agents/gitflow/exec.md +48 -48
- package/templates/agents/gitflow/finish.md +92 -92
- package/templates/agents/gitflow/init.md +139 -139
- package/templates/agents/gitflow/merge.md +62 -62
- package/templates/agents/gitflow/plan.md +42 -42
- package/templates/agents/gitflow/pr.md +78 -78
- package/templates/agents/gitflow/review.md +49 -49
- package/templates/agents/gitflow/start.md +61 -61
- package/templates/agents/gitflow/status.md +32 -32
- package/templates/agents/snipper.md +36 -36
- package/templates/agents/websearch.md +46 -46
- package/templates/commands/_resources/formatting-guide.md +124 -124
- package/templates/commands/ai-prompt.md +315 -315
- package/templates/commands/apex/1-analyze.md +100 -100
- package/templates/commands/apex/2-plan.md +145 -145
- package/templates/commands/apex/3-execute.md +171 -171
- package/templates/commands/apex/4-examine.md +116 -116
- package/templates/commands/apex/5-tasks.md +209 -209
- package/templates/commands/apex.md +76 -76
- package/templates/commands/application/create.md +362 -362
- package/templates/commands/application/templates-backend.md +463 -463
- package/templates/commands/application/templates-frontend.md +517 -517
- package/templates/commands/application/templates-i18n.md +478 -478
- package/templates/commands/application/templates-seed.md +362 -362
- package/templates/commands/application.md +303 -303
- package/templates/commands/business-analyse/0-orchestrate.md +640 -640
- package/templates/commands/business-analyse/1-init.md +269 -269
- package/templates/commands/business-analyse/2-discover.md +520 -520
- package/templates/commands/business-analyse/3-analyse.md +408 -408
- package/templates/commands/business-analyse/4-specify.md +598 -598
- package/templates/commands/business-analyse/5-validate.md +326 -326
- package/templates/commands/business-analyse/6-handoff.md +746 -746
- package/templates/commands/business-analyse/7-doc-html.md +602 -602
- package/templates/commands/business-analyse/bug.md +325 -325
- package/templates/commands/business-analyse/change-request.md +368 -368
- package/templates/commands/business-analyse/hotfix.md +200 -200
- package/templates/commands/business-analyse.md +640 -640
- package/templates/commands/controller/create.md +216 -216
- package/templates/commands/controller/postman-templates.md +528 -528
- package/templates/commands/controller/templates.md +600 -600
- package/templates/commands/controller.md +337 -337
- package/templates/commands/create/agent.md +138 -138
- package/templates/commands/create/command.md +166 -166
- package/templates/commands/create/hook.md +234 -234
- package/templates/commands/create/plugin.md +329 -329
- package/templates/commands/create/project.md +507 -507
- package/templates/commands/create/skill.md +199 -199
- package/templates/commands/create.md +220 -220
- package/templates/commands/debug.md +95 -95
- package/templates/commands/documentation/module.md +202 -202
- package/templates/commands/documentation/templates.md +432 -432
- package/templates/commands/documentation.md +190 -190
- package/templates/commands/efcore/_env-check.md +153 -153
- package/templates/commands/efcore/conflicts.md +186 -186
- package/templates/commands/efcore/db-deploy.md +193 -193
- package/templates/commands/efcore/db-reset.md +426 -426
- package/templates/commands/efcore/db-seed.md +326 -326
- package/templates/commands/efcore/db-status.md +226 -226
- package/templates/commands/efcore/migration.md +400 -400
- package/templates/commands/efcore/rebase-snapshot.md +264 -264
- package/templates/commands/efcore/scan.md +198 -198
- package/templates/commands/efcore/squash.md +298 -298
- package/templates/commands/efcore.md +224 -224
- package/templates/commands/epct.md +69 -69
- package/templates/commands/explain.md +186 -186
- package/templates/commands/explore.md +45 -45
- package/templates/commands/feature-full.md +267 -267
- package/templates/commands/gitflow/1-init.md +1038 -1038
- package/templates/commands/gitflow/10-start.md +768 -768
- package/templates/commands/gitflow/11-finish.md +457 -457
- package/templates/commands/gitflow/12-cleanup.md +276 -276
- package/templates/commands/gitflow/13-sync.md +216 -216
- package/templates/commands/gitflow/14-rebase.md +251 -251
- package/templates/commands/gitflow/2-status.md +277 -277
- package/templates/commands/gitflow/3-commit.md +344 -344
- package/templates/commands/gitflow/4-plan.md +145 -145
- package/templates/commands/gitflow/5-exec.md +147 -147
- package/templates/commands/gitflow/6-abort.md +344 -344
- package/templates/commands/gitflow/7-pull-request.md +453 -355
- package/templates/commands/gitflow/8-review.md +240 -176
- package/templates/commands/gitflow/9-merge.md +451 -365
- package/templates/commands/gitflow.md +128 -128
- package/templates/commands/implement.md +663 -663
- package/templates/commands/init.md +567 -567
- package/templates/commands/mcp-integration.md +330 -330
- package/templates/commands/notification.md +129 -129
- package/templates/commands/oneshot.md +57 -57
- package/templates/commands/quick-search.md +72 -72
- package/templates/commands/ralph-loop/cancel-ralph.md +18 -18
- package/templates/commands/ralph-loop/help.md +126 -126
- package/templates/commands/ralph-loop/ralph-loop.md +18 -18
- package/templates/commands/review.md +106 -106
- package/templates/commands/utils/test-web-config.md +160 -160
- package/templates/commands/utils/test-web.md +151 -151
- package/templates/commands/validate.md +233 -233
- package/templates/commands/workflow.md +193 -193
- package/templates/gitflow/config.json +138 -138
- package/templates/hooks/ef-migration-check.md +139 -139
- package/templates/hooks/hooks.json +25 -25
- package/templates/hooks/stop-hook.sh +177 -177
- package/templates/skills/ai-prompt/SKILL.md +778 -778
- package/templates/skills/application/SKILL.md +563 -563
- package/templates/skills/application/templates-backend.md +450 -450
- package/templates/skills/application/templates-frontend.md +531 -531
- package/templates/skills/application/templates-i18n.md +520 -520
- package/templates/skills/application/templates-seed.md +647 -647
- package/templates/skills/business-analyse/SKILL.md +191 -191
- package/templates/skills/business-analyse/questionnaire.md +283 -283
- package/templates/skills/business-analyse/templates-frd.md +477 -477
- package/templates/skills/business-analyse/templates-react.md +580 -580
- package/templates/skills/controller/SKILL.md +240 -240
- package/templates/skills/controller/postman-templates.md +614 -614
- package/templates/skills/controller/templates.md +1468 -1468
- package/templates/skills/documentation/SKILL.md +133 -133
- package/templates/skills/documentation/templates.md +476 -476
- package/templates/skills/feature-full/SKILL.md +838 -838
- package/templates/skills/notification/SKILL.md +555 -555
- package/templates/skills/ui-components/SKILL.md +870 -870
- package/templates/skills/workflow/SKILL.md +582 -582
- package/templates/test-web/api-health.json +38 -38
- package/templates/test-web/minimal.json +19 -19
- package/templates/test-web/npm-package.json +46 -46
- package/templates/test-web/seo-check.json +54 -54
|
@@ -1,580 +1,580 @@
|
|
|
1
|
-
# Templates React - Documentation FRD
|
|
2
|
-
|
|
3
|
-
> **Usage:** Templates pour générer la documentation HTML (React) des specs fonctionnelles
|
|
4
|
-
> **Output:** `web/smartstack-web/src/pages/docs/business/{app}/{module}/`
|
|
5
|
-
> **Context7:** Utiliser pour génération de code React à jour
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## RÈGLE CONTEXT7 (OBLIGATOIRE)
|
|
10
|
-
|
|
11
|
-
```
|
|
12
|
-
╔══════════════════════════════════════════════════════════════════════════════╗
|
|
13
|
-
║ GÉNÉRATION REACT AVEC CONTEXT7 ║
|
|
14
|
-
╠══════════════════════════════════════════════════════════════════════════════╣
|
|
15
|
-
║ ║
|
|
16
|
-
║ TOUJOURS utiliser Context7 pour la génération de composants React: ║
|
|
17
|
-
║ ║
|
|
18
|
-
║ Prompt pattern: ║
|
|
19
|
-
║ "use context7 with /facebook/react and /i18next/react-i18next ║
|
|
20
|
-
║ to generate {component} following SmartStack patterns" ║
|
|
21
|
-
║ ║
|
|
22
|
-
║ Libraries à référencer: ║
|
|
23
|
-
║ • /facebook/react - React 19 patterns ║
|
|
24
|
-
║ • /i18next/react-i18next - Internationalization ║
|
|
25
|
-
║ • /remix-run/react-router - React Router v7 ║
|
|
26
|
-
║ • /lucide-icons/lucide-react - Icons ║
|
|
27
|
-
║ ║
|
|
28
|
-
╚══════════════════════════════════════════════════════════════════════════════╝
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
---
|
|
32
|
-
|
|
33
|
-
## Template FrdDocPage.tsx
|
|
34
|
-
|
|
35
|
-
```tsx
|
|
36
|
-
// web/smartstack-web/src/pages/docs/business/{app}/{module}/FrdDocPage.tsx
|
|
37
|
-
// GÉNÉRER AVEC: use context7 with /facebook/react
|
|
38
|
-
|
|
39
|
-
import { Link } from 'react-router-dom';
|
|
40
|
-
import { useTranslation } from 'react-i18next';
|
|
41
|
-
import {
|
|
42
|
-
FileText,
|
|
43
|
-
Users,
|
|
44
|
-
Shield,
|
|
45
|
-
CheckCircle,
|
|
46
|
-
AlertTriangle,
|
|
47
|
-
ChevronRight,
|
|
48
|
-
ArrowRight,
|
|
49
|
-
List,
|
|
50
|
-
Layout,
|
|
51
|
-
Database
|
|
52
|
-
} from 'lucide-react';
|
|
53
|
-
|
|
54
|
-
// Types pour les données FRD
|
|
55
|
-
interface UseCase {
|
|
56
|
-
id: string;
|
|
57
|
-
name: string;
|
|
58
|
-
actor: string;
|
|
59
|
-
permission: string;
|
|
60
|
-
description: string;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
interface BusinessRule {
|
|
64
|
-
id: string;
|
|
65
|
-
rule: string;
|
|
66
|
-
category: string;
|
|
67
|
-
priority: 'Must' | 'Should' | 'Could';
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
interface Permission {
|
|
71
|
-
path: string;
|
|
72
|
-
description: string;
|
|
73
|
-
roles: string[];
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
interface FrdData {
|
|
77
|
-
featureId: string;
|
|
78
|
-
moduleName: string;
|
|
79
|
-
applicationName: string;
|
|
80
|
-
version: string;
|
|
81
|
-
useCases: UseCase[];
|
|
82
|
-
businessRules: BusinessRule[];
|
|
83
|
-
permissions: Permission[];
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// Données chargées depuis le FRD (à générer dynamiquement)
|
|
87
|
-
const frdData: FrdData = {
|
|
88
|
-
featureId: 'FEAT-XXX',
|
|
89
|
-
moduleName: '{ModuleName}',
|
|
90
|
-
applicationName: '{ApplicationName}',
|
|
91
|
-
version: '1.0',
|
|
92
|
-
useCases: [
|
|
93
|
-
{
|
|
94
|
-
id: 'UC-001',
|
|
95
|
-
name: '{Use Case Name}',
|
|
96
|
-
actor: '{Actor}',
|
|
97
|
-
permission: 'business.{app}.{module}.{action}',
|
|
98
|
-
description: '{Description}'
|
|
99
|
-
}
|
|
100
|
-
],
|
|
101
|
-
businessRules: [
|
|
102
|
-
{
|
|
103
|
-
id: 'BR-001',
|
|
104
|
-
rule: '{Business Rule Description}',
|
|
105
|
-
category: 'Validation',
|
|
106
|
-
priority: 'Must'
|
|
107
|
-
}
|
|
108
|
-
],
|
|
109
|
-
permissions: [
|
|
110
|
-
{
|
|
111
|
-
path: 'business.{app}.{module}.read',
|
|
112
|
-
description: 'View {module} data',
|
|
113
|
-
roles: ['Admin', 'Manager', 'User', 'ReadOnly']
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
path: 'business.{app}.{module}.create',
|
|
117
|
-
description: 'Create new {module}',
|
|
118
|
-
roles: ['Admin', 'Manager']
|
|
119
|
-
}
|
|
120
|
-
]
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
// Composant Badge de priorité
|
|
124
|
-
function PriorityBadge({ priority }: { priority: string }) {
|
|
125
|
-
const colors = {
|
|
126
|
-
Must: 'bg-red-500/10 text-red-600',
|
|
127
|
-
Should: 'bg-yellow-500/10 text-yellow-600',
|
|
128
|
-
Could: 'bg-blue-500/10 text-blue-600'
|
|
129
|
-
};
|
|
130
|
-
return (
|
|
131
|
-
<span className={`px-2 py-0.5 rounded text-xs font-medium ${colors[priority as keyof typeof colors] || 'bg-gray-500/10 text-gray-600'}`}>
|
|
132
|
-
{priority}
|
|
133
|
-
</span>
|
|
134
|
-
);
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
// Composant Section numérotée
|
|
138
|
-
function NumberedSection({
|
|
139
|
-
number,
|
|
140
|
-
title,
|
|
141
|
-
icon: Icon,
|
|
142
|
-
children
|
|
143
|
-
}: {
|
|
144
|
-
number: number;
|
|
145
|
-
title: string;
|
|
146
|
-
icon: React.ComponentType<{ className?: string }>;
|
|
147
|
-
children: React.ReactNode;
|
|
148
|
-
}) {
|
|
149
|
-
return (
|
|
150
|
-
<section id={`section-${number}`} className="scroll-mt-4">
|
|
151
|
-
<h2 className="text-xl font-semibold mb-4 flex items-center gap-3">
|
|
152
|
-
<span className="w-8 h-8 rounded-full bg-[var(--color-primary-600)] text-white flex items-center justify-center text-sm font-bold">
|
|
153
|
-
{number}
|
|
154
|
-
</span>
|
|
155
|
-
<Icon className="w-5 h-5 text-[var(--color-primary-600)]" />
|
|
156
|
-
{title}
|
|
157
|
-
</h2>
|
|
158
|
-
<div className="card p-6">
|
|
159
|
-
{children}
|
|
160
|
-
</div>
|
|
161
|
-
</section>
|
|
162
|
-
);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
export function {ModuleName}FrdDocPage() {
|
|
166
|
-
const { t } = useTranslation('docs-business');
|
|
167
|
-
|
|
168
|
-
return (
|
|
169
|
-
<div className="space-y-8">
|
|
170
|
-
{/* Breadcrumb */}
|
|
171
|
-
<nav className="flex items-center gap-2 text-sm text-[var(--text-secondary)]">
|
|
172
|
-
<Link to="/docs" className="hover:text-[var(--color-primary-600)]">
|
|
173
|
-
{t('breadcrumb.docs')}
|
|
174
|
-
</Link>
|
|
175
|
-
<span>/</span>
|
|
176
|
-
<Link to="/docs/business" className="hover:text-[var(--color-primary-600)]">
|
|
177
|
-
{t('breadcrumb.business')}
|
|
178
|
-
</Link>
|
|
179
|
-
<span>/</span>
|
|
180
|
-
<Link to={`/docs/business/${frdData.applicationName.toLowerCase()}`} className="hover:text-[var(--color-primary-600)]">
|
|
181
|
-
{t(`apps.${frdData.applicationName.toLowerCase()}.name`)}
|
|
182
|
-
</Link>
|
|
183
|
-
<span>/</span>
|
|
184
|
-
<span>{t(`modules.${frdData.moduleName.toLowerCase()}.name`)}</span>
|
|
185
|
-
</nav>
|
|
186
|
-
|
|
187
|
-
{/* Header */}
|
|
188
|
-
<header>
|
|
189
|
-
<div className="flex items-center gap-2 mb-2">
|
|
190
|
-
<span className="px-2 py-0.5 rounded bg-[var(--color-primary-600)]/10 text-[var(--color-primary-600)] text-xs font-medium">
|
|
191
|
-
{frdData.featureId}
|
|
192
|
-
</span>
|
|
193
|
-
<span className="px-2 py-0.5 rounded bg-green-500/10 text-green-600 text-xs font-medium">
|
|
194
|
-
v{frdData.version}
|
|
195
|
-
</span>
|
|
196
|
-
</div>
|
|
197
|
-
<h1 className="text-3xl font-bold mb-4 flex items-center gap-3">
|
|
198
|
-
<FileText className="w-8 h-8 text-[var(--color-primary-600)]" />
|
|
199
|
-
{t(`modules.${frdData.moduleName.toLowerCase()}.title`)}
|
|
200
|
-
</h1>
|
|
201
|
-
<p className="text-lg text-[var(--text-secondary)]">
|
|
202
|
-
{t(`modules.${frdData.moduleName.toLowerCase()}.subtitle`)}
|
|
203
|
-
</p>
|
|
204
|
-
</header>
|
|
205
|
-
|
|
206
|
-
{/* Table des matières */}
|
|
207
|
-
<div className="card p-4 bg-[var(--bg-secondary)]">
|
|
208
|
-
<h2 className="font-semibold mb-3 flex items-center gap-2">
|
|
209
|
-
<List className="w-4 h-4" />
|
|
210
|
-
{t('common.tableOfContents')}
|
|
211
|
-
</h2>
|
|
212
|
-
<nav className="grid grid-cols-2 md:grid-cols-3 gap-2">
|
|
213
|
-
{['overview', 'useCases', 'businessRules', 'permissions', 'wireframes', 'api'].map((section, idx) => (
|
|
214
|
-
<a
|
|
215
|
-
key={section}
|
|
216
|
-
href={`#section-${idx + 1}`}
|
|
217
|
-
className="flex items-center gap-2 p-2 rounded hover:bg-[var(--bg-tertiary)] text-sm"
|
|
218
|
-
>
|
|
219
|
-
<ChevronRight className="w-4 h-4 text-[var(--color-primary-600)]" />
|
|
220
|
-
{t(`sections.${section}`)}
|
|
221
|
-
</a>
|
|
222
|
-
))}
|
|
223
|
-
</nav>
|
|
224
|
-
</div>
|
|
225
|
-
|
|
226
|
-
{/* Section 1: Vue d'ensemble */}
|
|
227
|
-
<NumberedSection number={1} title={t('sections.overview')} icon={Layout}>
|
|
228
|
-
<p className="text-[var(--text-secondary)] mb-4">
|
|
229
|
-
{t(`modules.${frdData.moduleName.toLowerCase()}.overview`)}
|
|
230
|
-
</p>
|
|
231
|
-
<div className="grid grid-cols-2 md:grid-cols-4 gap-4 mt-4">
|
|
232
|
-
<div className="p-4 rounded-lg bg-[var(--bg-secondary)] text-center">
|
|
233
|
-
<div className="text-2xl font-bold text-[var(--color-primary-600)]">
|
|
234
|
-
{frdData.useCases.length}
|
|
235
|
-
</div>
|
|
236
|
-
<div className="text-sm text-[var(--text-secondary)]">{t('stats.useCases')}</div>
|
|
237
|
-
</div>
|
|
238
|
-
<div className="p-4 rounded-lg bg-[var(--bg-secondary)] text-center">
|
|
239
|
-
<div className="text-2xl font-bold text-[var(--color-primary-600)]">
|
|
240
|
-
{frdData.businessRules.length}
|
|
241
|
-
</div>
|
|
242
|
-
<div className="text-sm text-[var(--text-secondary)]">{t('stats.businessRules')}</div>
|
|
243
|
-
</div>
|
|
244
|
-
<div className="p-4 rounded-lg bg-[var(--bg-secondary)] text-center">
|
|
245
|
-
<div className="text-2xl font-bold text-[var(--color-primary-600)]">
|
|
246
|
-
{frdData.permissions.length}
|
|
247
|
-
</div>
|
|
248
|
-
<div className="text-sm text-[var(--text-secondary)]">{t('stats.permissions')}</div>
|
|
249
|
-
</div>
|
|
250
|
-
</div>
|
|
251
|
-
</NumberedSection>
|
|
252
|
-
|
|
253
|
-
{/* Section 2: Cas d'utilisation */}
|
|
254
|
-
<NumberedSection number={2} title={t('sections.useCases')} icon={Users}>
|
|
255
|
-
<div className="space-y-4">
|
|
256
|
-
{frdData.useCases.map((uc) => (
|
|
257
|
-
<div key={uc.id} className="border border-[var(--border-color)] rounded-lg p-4">
|
|
258
|
-
<div className="flex items-center justify-between mb-2">
|
|
259
|
-
<h3 className="font-semibold flex items-center gap-2">
|
|
260
|
-
<span className="px-2 py-0.5 rounded bg-[var(--color-primary-600)]/10 text-[var(--color-primary-600)] text-xs font-mono">
|
|
261
|
-
{uc.id}
|
|
262
|
-
</span>
|
|
263
|
-
{uc.name}
|
|
264
|
-
</h3>
|
|
265
|
-
<span className="text-sm text-[var(--text-secondary)]">
|
|
266
|
-
{t('labels.actor')}: {uc.actor}
|
|
267
|
-
</span>
|
|
268
|
-
</div>
|
|
269
|
-
<p className="text-sm text-[var(--text-secondary)] mb-2">{uc.description}</p>
|
|
270
|
-
<div className="flex items-center gap-2 text-xs">
|
|
271
|
-
<Shield className="w-3 h-3 text-amber-500" />
|
|
272
|
-
<code className="bg-[var(--bg-secondary)] px-2 py-0.5 rounded">{uc.permission}</code>
|
|
273
|
-
</div>
|
|
274
|
-
</div>
|
|
275
|
-
))}
|
|
276
|
-
</div>
|
|
277
|
-
</NumberedSection>
|
|
278
|
-
|
|
279
|
-
{/* Section 3: Règles métier */}
|
|
280
|
-
<NumberedSection number={3} title={t('sections.businessRules')} icon={CheckCircle}>
|
|
281
|
-
<div className="overflow-x-auto">
|
|
282
|
-
<table className="w-full text-sm">
|
|
283
|
-
<thead>
|
|
284
|
-
<tr className="bg-[var(--bg-secondary)]">
|
|
285
|
-
<th className="text-left py-2 px-3 rounded-tl-lg">ID</th>
|
|
286
|
-
<th className="text-left py-2 px-3">{t('labels.rule')}</th>
|
|
287
|
-
<th className="text-left py-2 px-3">{t('labels.category')}</th>
|
|
288
|
-
<th className="text-left py-2 px-3 rounded-tr-lg">{t('labels.priority')}</th>
|
|
289
|
-
</tr>
|
|
290
|
-
</thead>
|
|
291
|
-
<tbody>
|
|
292
|
-
{frdData.businessRules.map((br, idx) => (
|
|
293
|
-
<tr key={br.id} className={idx % 2 === 1 ? 'bg-[var(--bg-secondary)]/50' : ''}>
|
|
294
|
-
<td className="py-2 px-3 font-mono text-[var(--color-primary-600)]">{br.id}</td>
|
|
295
|
-
<td className="py-2 px-3">{br.rule}</td>
|
|
296
|
-
<td className="py-2 px-3 text-[var(--text-secondary)]">{br.category}</td>
|
|
297
|
-
<td className="py-2 px-3"><PriorityBadge priority={br.priority} /></td>
|
|
298
|
-
</tr>
|
|
299
|
-
))}
|
|
300
|
-
</tbody>
|
|
301
|
-
</table>
|
|
302
|
-
</div>
|
|
303
|
-
</NumberedSection>
|
|
304
|
-
|
|
305
|
-
{/* Section 4: Permissions */}
|
|
306
|
-
<NumberedSection number={4} title={t('sections.permissions')} icon={Shield}>
|
|
307
|
-
<div className="space-y-3">
|
|
308
|
-
{frdData.permissions.map((perm) => (
|
|
309
|
-
<div key={perm.path} className="flex items-center justify-between p-3 rounded-lg bg-[var(--bg-secondary)]">
|
|
310
|
-
<div>
|
|
311
|
-
<code className="text-sm font-mono text-[var(--color-primary-600)]">{perm.path}</code>
|
|
312
|
-
<p className="text-sm text-[var(--text-secondary)] mt-1">{perm.description}</p>
|
|
313
|
-
</div>
|
|
314
|
-
<div className="flex gap-1">
|
|
315
|
-
{perm.roles.map((role) => (
|
|
316
|
-
<span key={role} className="px-2 py-0.5 rounded bg-[var(--bg-tertiary)] text-xs">
|
|
317
|
-
{role}
|
|
318
|
-
</span>
|
|
319
|
-
))}
|
|
320
|
-
</div>
|
|
321
|
-
</div>
|
|
322
|
-
))}
|
|
323
|
-
</div>
|
|
324
|
-
|
|
325
|
-
{/* Avertissement permissions */}
|
|
326
|
-
<div className="mt-4 p-4 rounded-lg bg-amber-500/10 border border-amber-500/20 flex items-start gap-3">
|
|
327
|
-
<AlertTriangle className="w-5 h-5 text-amber-600 flex-shrink-0 mt-0.5" />
|
|
328
|
-
<div>
|
|
329
|
-
<div className="font-medium text-amber-600">{t('warnings.permissionCheck')}</div>
|
|
330
|
-
<p className="text-sm text-[var(--text-secondary)]">
|
|
331
|
-
{t('warnings.permissionCheckDescription')}
|
|
332
|
-
</p>
|
|
333
|
-
</div>
|
|
334
|
-
</div>
|
|
335
|
-
</NumberedSection>
|
|
336
|
-
|
|
337
|
-
{/* Section 5: Wireframes */}
|
|
338
|
-
<NumberedSection number={5} title={t('sections.wireframes')} icon={Layout}>
|
|
339
|
-
<div className="border-2 border-dashed border-[var(--border-color)] rounded-lg p-6">
|
|
340
|
-
<div className="text-center text-sm text-[var(--text-tertiary)] mb-4">
|
|
341
|
-
{t('common.wireframePreview')}
|
|
342
|
-
</div>
|
|
343
|
-
{/* Wireframe simplifié */}
|
|
344
|
-
<div className="space-y-4">
|
|
345
|
-
<div className="h-12 bg-[var(--bg-secondary)] rounded flex items-center px-4 justify-between">
|
|
346
|
-
<span className="text-sm">[Header + Navigation]</span>
|
|
347
|
-
<span className="text-sm">[User Menu]</span>
|
|
348
|
-
</div>
|
|
349
|
-
<div className="grid grid-cols-4 gap-4">
|
|
350
|
-
<div className="col-span-1 h-64 bg-[var(--bg-secondary)] rounded p-4">
|
|
351
|
-
<span className="text-sm">[Filters]</span>
|
|
352
|
-
</div>
|
|
353
|
-
<div className="col-span-3 h-64 bg-[var(--bg-secondary)] rounded p-4">
|
|
354
|
-
<span className="text-sm">[Data Table]</span>
|
|
355
|
-
</div>
|
|
356
|
-
</div>
|
|
357
|
-
</div>
|
|
358
|
-
</div>
|
|
359
|
-
</NumberedSection>
|
|
360
|
-
|
|
361
|
-
{/* Section 6: API Endpoints */}
|
|
362
|
-
<NumberedSection number={6} title={t('sections.api')} icon={Database}>
|
|
363
|
-
<div className="overflow-x-auto">
|
|
364
|
-
<table className="w-full text-sm font-mono">
|
|
365
|
-
<thead>
|
|
366
|
-
<tr className="bg-[var(--bg-secondary)]">
|
|
367
|
-
<th className="text-left py-2 px-3 rounded-tl-lg">Method</th>
|
|
368
|
-
<th className="text-left py-2 px-3">Endpoint</th>
|
|
369
|
-
<th className="text-left py-2 px-3 rounded-tr-lg">Permission</th>
|
|
370
|
-
</tr>
|
|
371
|
-
</thead>
|
|
372
|
-
<tbody>
|
|
373
|
-
<tr>
|
|
374
|
-
<td className="py-2 px-3"><span className="px-2 py-0.5 rounded bg-green-500/10 text-green-600">GET</span></td>
|
|
375
|
-
<td className="py-2 px-3">/api/business/{'{module}'}</td>
|
|
376
|
-
<td className="py-2 px-3 text-[var(--text-secondary)]">.read</td>
|
|
377
|
-
</tr>
|
|
378
|
-
<tr className="bg-[var(--bg-secondary)]/50">
|
|
379
|
-
<td className="py-2 px-3"><span className="px-2 py-0.5 rounded bg-blue-500/10 text-blue-600">POST</span></td>
|
|
380
|
-
<td className="py-2 px-3">/api/business/{'{module}'}</td>
|
|
381
|
-
<td className="py-2 px-3 text-[var(--text-secondary)]">.create</td>
|
|
382
|
-
</tr>
|
|
383
|
-
<tr>
|
|
384
|
-
<td className="py-2 px-3"><span className="px-2 py-0.5 rounded bg-yellow-500/10 text-yellow-600">PUT</span></td>
|
|
385
|
-
<td className="py-2 px-3">/api/business/{'{module}'}/{'{id}'}</td>
|
|
386
|
-
<td className="py-2 px-3 text-[var(--text-secondary)]">.update</td>
|
|
387
|
-
</tr>
|
|
388
|
-
<tr className="bg-[var(--bg-secondary)]/50">
|
|
389
|
-
<td className="py-2 px-3"><span className="px-2 py-0.5 rounded bg-red-500/10 text-red-600">DELETE</span></td>
|
|
390
|
-
<td className="py-2 px-3">/api/business/{'{module}'}/{'{id}'}</td>
|
|
391
|
-
<td className="py-2 px-3 text-[var(--text-secondary)]">.delete</td>
|
|
392
|
-
</tr>
|
|
393
|
-
</tbody>
|
|
394
|
-
</table>
|
|
395
|
-
</div>
|
|
396
|
-
</NumberedSection>
|
|
397
|
-
|
|
398
|
-
{/* Navigation footer */}
|
|
399
|
-
<div className="flex justify-between pt-6 border-t border-[var(--border-color)]">
|
|
400
|
-
<Link
|
|
401
|
-
to={`/docs/business/${frdData.applicationName.toLowerCase()}`}
|
|
402
|
-
className="flex items-center gap-2 text-[var(--text-secondary)] hover:text-[var(--color-primary-600)]"
|
|
403
|
-
>
|
|
404
|
-
<ArrowRight className="w-4 h-4 rotate-180" />
|
|
405
|
-
{t('nav.backToApp')}
|
|
406
|
-
</Link>
|
|
407
|
-
<Link
|
|
408
|
-
to="/docs/business"
|
|
409
|
-
className="flex items-center gap-2 text-[var(--color-primary-600)]"
|
|
410
|
-
>
|
|
411
|
-
{t('nav.allModules')}
|
|
412
|
-
<ArrowRight className="w-4 h-4" />
|
|
413
|
-
</Link>
|
|
414
|
-
</div>
|
|
415
|
-
</div>
|
|
416
|
-
);
|
|
417
|
-
}
|
|
418
|
-
```
|
|
419
|
-
|
|
420
|
-
---
|
|
421
|
-
|
|
422
|
-
## Template i18n docs-business.json
|
|
423
|
-
|
|
424
|
-
```json
|
|
425
|
-
{
|
|
426
|
-
"breadcrumb": {
|
|
427
|
-
"docs": "Documentation",
|
|
428
|
-
"business": "Business"
|
|
429
|
-
},
|
|
430
|
-
"common": {
|
|
431
|
-
"tableOfContents": "Table of Contents",
|
|
432
|
-
"wireframePreview": "Wireframe Preview"
|
|
433
|
-
},
|
|
434
|
-
"sections": {
|
|
435
|
-
"overview": "Overview",
|
|
436
|
-
"useCases": "Use Cases",
|
|
437
|
-
"businessRules": "Business Rules",
|
|
438
|
-
"permissions": "Permissions",
|
|
439
|
-
"wireframes": "Wireframes",
|
|
440
|
-
"api": "API Endpoints"
|
|
441
|
-
},
|
|
442
|
-
"labels": {
|
|
443
|
-
"actor": "Actor",
|
|
444
|
-
"rule": "Rule",
|
|
445
|
-
"category": "Category",
|
|
446
|
-
"priority": "Priority"
|
|
447
|
-
},
|
|
448
|
-
"stats": {
|
|
449
|
-
"useCases": "Use Cases",
|
|
450
|
-
"businessRules": "Business Rules",
|
|
451
|
-
"permissions": "Permissions"
|
|
452
|
-
},
|
|
453
|
-
"warnings": {
|
|
454
|
-
"permissionCheck": "Permission Check Required",
|
|
455
|
-
"permissionCheckDescription": "Ensure all permissions are registered in PermissionConfiguration.cs before deployment."
|
|
456
|
-
},
|
|
457
|
-
"nav": {
|
|
458
|
-
"backToApp": "Back to Application",
|
|
459
|
-
"allModules": "All Modules"
|
|
460
|
-
},
|
|
461
|
-
"apps": {
|
|
462
|
-
"{app}": {
|
|
463
|
-
"name": "{Application Name}",
|
|
464
|
-
"description": "{Application description}"
|
|
465
|
-
}
|
|
466
|
-
},
|
|
467
|
-
"modules": {
|
|
468
|
-
"{module}": {
|
|
469
|
-
"name": "{Module Name}",
|
|
470
|
-
"title": "{Module Title}",
|
|
471
|
-
"subtitle": "{Module subtitle description}",
|
|
472
|
-
"overview": "{Detailed overview of the module functionality}"
|
|
473
|
-
}
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
|
-
```
|
|
477
|
-
|
|
478
|
-
---
|
|
479
|
-
|
|
480
|
-
## Template Index Application
|
|
481
|
-
|
|
482
|
-
```tsx
|
|
483
|
-
// web/smartstack-web/src/pages/docs/business/{app}/index.tsx
|
|
484
|
-
|
|
485
|
-
import { Link } from 'react-router-dom';
|
|
486
|
-
import { useTranslation } from 'react-i18next';
|
|
487
|
-
import { Folder, FileText, ChevronRight } from 'lucide-react';
|
|
488
|
-
|
|
489
|
-
interface ModuleLink {
|
|
490
|
-
id: string;
|
|
491
|
-
name: string;
|
|
492
|
-
description: string;
|
|
493
|
-
features: number;
|
|
494
|
-
path: string;
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
const modules: ModuleLink[] = [
|
|
498
|
-
{
|
|
499
|
-
id: '{module}',
|
|
500
|
-
name: '{Module Name}',
|
|
501
|
-
description: '{Module description}',
|
|
502
|
-
features: 3,
|
|
503
|
-
path: '/docs/business/{app}/{module}'
|
|
504
|
-
}
|
|
505
|
-
];
|
|
506
|
-
|
|
507
|
-
export function {App}DocsIndexPage() {
|
|
508
|
-
const { t } = useTranslation('docs-business');
|
|
509
|
-
|
|
510
|
-
return (
|
|
511
|
-
<div className="space-y-8">
|
|
512
|
-
{/* Breadcrumb */}
|
|
513
|
-
<nav className="flex items-center gap-2 text-sm text-[var(--text-secondary)]">
|
|
514
|
-
<Link to="/docs">{t('breadcrumb.docs')}</Link>
|
|
515
|
-
<span>/</span>
|
|
516
|
-
<Link to="/docs/business">{t('breadcrumb.business')}</Link>
|
|
517
|
-
<span>/</span>
|
|
518
|
-
<span>{t('apps.{app}.name')}</span>
|
|
519
|
-
</nav>
|
|
520
|
-
|
|
521
|
-
{/* Header */}
|
|
522
|
-
<header>
|
|
523
|
-
<h1 className="text-3xl font-bold mb-4 flex items-center gap-3">
|
|
524
|
-
<Folder className="w-8 h-8 text-[var(--color-primary-600)]" />
|
|
525
|
-
{t('apps.{app}.name')}
|
|
526
|
-
</h1>
|
|
527
|
-
<p className="text-lg text-[var(--text-secondary)]">
|
|
528
|
-
{t('apps.{app}.description')}
|
|
529
|
-
</p>
|
|
530
|
-
</header>
|
|
531
|
-
|
|
532
|
-
{/* Modules list */}
|
|
533
|
-
<section>
|
|
534
|
-
<h2 className="text-xl font-semibold mb-4">{t('common.modules')}</h2>
|
|
535
|
-
<div className="grid gap-4">
|
|
536
|
-
{modules.map((module) => (
|
|
537
|
-
<Link
|
|
538
|
-
key={module.id}
|
|
539
|
-
to={module.path}
|
|
540
|
-
className="card p-4 hover:border-[var(--color-primary-600)] transition-colors group"
|
|
541
|
-
>
|
|
542
|
-
<div className="flex items-center justify-between">
|
|
543
|
-
<div className="flex items-center gap-3">
|
|
544
|
-
<FileText className="w-6 h-6 text-[var(--color-primary-600)]" />
|
|
545
|
-
<div>
|
|
546
|
-
<h3 className="font-semibold group-hover:text-[var(--color-primary-600)]">
|
|
547
|
-
{module.name}
|
|
548
|
-
</h3>
|
|
549
|
-
<p className="text-sm text-[var(--text-secondary)]">
|
|
550
|
-
{module.description}
|
|
551
|
-
</p>
|
|
552
|
-
</div>
|
|
553
|
-
</div>
|
|
554
|
-
<div className="flex items-center gap-4">
|
|
555
|
-
<span className="text-sm text-[var(--text-secondary)]">
|
|
556
|
-
{module.features} features
|
|
557
|
-
</span>
|
|
558
|
-
<ChevronRight className="w-5 h-5 text-[var(--text-tertiary)] group-hover:text-[var(--color-primary-600)]" />
|
|
559
|
-
</div>
|
|
560
|
-
</div>
|
|
561
|
-
</Link>
|
|
562
|
-
))}
|
|
563
|
-
</div>
|
|
564
|
-
</section>
|
|
565
|
-
</div>
|
|
566
|
-
);
|
|
567
|
-
}
|
|
568
|
-
```
|
|
569
|
-
|
|
570
|
-
---
|
|
571
|
-
|
|
572
|
-
## Checklist génération
|
|
573
|
-
|
|
574
|
-
Lors de la génération avec `/business-analyse:7-doc-html`:
|
|
575
|
-
|
|
576
|
-
- [ ] Utiliser Context7 pour patterns React actuels
|
|
577
|
-
- [ ] Générer `FrdDocPage.tsx` avec données du FRD
|
|
578
|
-
- [ ] Créer/mettre à jour `docs-business.json` (4 langues)
|
|
579
|
-
- [ ] Ajouter route dans `App.tsx`
|
|
580
|
-
- [ ] Mettre à jour index parent si nouveau module
|
|
1
|
+
# Templates React - Documentation FRD
|
|
2
|
+
|
|
3
|
+
> **Usage:** Templates pour générer la documentation HTML (React) des specs fonctionnelles
|
|
4
|
+
> **Output:** `web/smartstack-web/src/pages/docs/business/{app}/{module}/`
|
|
5
|
+
> **Context7:** Utiliser pour génération de code React à jour
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## RÈGLE CONTEXT7 (OBLIGATOIRE)
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
╔══════════════════════════════════════════════════════════════════════════════╗
|
|
13
|
+
║ GÉNÉRATION REACT AVEC CONTEXT7 ║
|
|
14
|
+
╠══════════════════════════════════════════════════════════════════════════════╣
|
|
15
|
+
║ ║
|
|
16
|
+
║ TOUJOURS utiliser Context7 pour la génération de composants React: ║
|
|
17
|
+
║ ║
|
|
18
|
+
║ Prompt pattern: ║
|
|
19
|
+
║ "use context7 with /facebook/react and /i18next/react-i18next ║
|
|
20
|
+
║ to generate {component} following SmartStack patterns" ║
|
|
21
|
+
║ ║
|
|
22
|
+
║ Libraries à référencer: ║
|
|
23
|
+
║ • /facebook/react - React 19 patterns ║
|
|
24
|
+
║ • /i18next/react-i18next - Internationalization ║
|
|
25
|
+
║ • /remix-run/react-router - React Router v7 ║
|
|
26
|
+
║ • /lucide-icons/lucide-react - Icons ║
|
|
27
|
+
║ ║
|
|
28
|
+
╚══════════════════════════════════════════════════════════════════════════════╝
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Template FrdDocPage.tsx
|
|
34
|
+
|
|
35
|
+
```tsx
|
|
36
|
+
// web/smartstack-web/src/pages/docs/business/{app}/{module}/FrdDocPage.tsx
|
|
37
|
+
// GÉNÉRER AVEC: use context7 with /facebook/react
|
|
38
|
+
|
|
39
|
+
import { Link } from 'react-router-dom';
|
|
40
|
+
import { useTranslation } from 'react-i18next';
|
|
41
|
+
import {
|
|
42
|
+
FileText,
|
|
43
|
+
Users,
|
|
44
|
+
Shield,
|
|
45
|
+
CheckCircle,
|
|
46
|
+
AlertTriangle,
|
|
47
|
+
ChevronRight,
|
|
48
|
+
ArrowRight,
|
|
49
|
+
List,
|
|
50
|
+
Layout,
|
|
51
|
+
Database
|
|
52
|
+
} from 'lucide-react';
|
|
53
|
+
|
|
54
|
+
// Types pour les données FRD
|
|
55
|
+
interface UseCase {
|
|
56
|
+
id: string;
|
|
57
|
+
name: string;
|
|
58
|
+
actor: string;
|
|
59
|
+
permission: string;
|
|
60
|
+
description: string;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
interface BusinessRule {
|
|
64
|
+
id: string;
|
|
65
|
+
rule: string;
|
|
66
|
+
category: string;
|
|
67
|
+
priority: 'Must' | 'Should' | 'Could';
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
interface Permission {
|
|
71
|
+
path: string;
|
|
72
|
+
description: string;
|
|
73
|
+
roles: string[];
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
interface FrdData {
|
|
77
|
+
featureId: string;
|
|
78
|
+
moduleName: string;
|
|
79
|
+
applicationName: string;
|
|
80
|
+
version: string;
|
|
81
|
+
useCases: UseCase[];
|
|
82
|
+
businessRules: BusinessRule[];
|
|
83
|
+
permissions: Permission[];
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Données chargées depuis le FRD (à générer dynamiquement)
|
|
87
|
+
const frdData: FrdData = {
|
|
88
|
+
featureId: 'FEAT-XXX',
|
|
89
|
+
moduleName: '{ModuleName}',
|
|
90
|
+
applicationName: '{ApplicationName}',
|
|
91
|
+
version: '1.0',
|
|
92
|
+
useCases: [
|
|
93
|
+
{
|
|
94
|
+
id: 'UC-001',
|
|
95
|
+
name: '{Use Case Name}',
|
|
96
|
+
actor: '{Actor}',
|
|
97
|
+
permission: 'business.{app}.{module}.{action}',
|
|
98
|
+
description: '{Description}'
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
businessRules: [
|
|
102
|
+
{
|
|
103
|
+
id: 'BR-001',
|
|
104
|
+
rule: '{Business Rule Description}',
|
|
105
|
+
category: 'Validation',
|
|
106
|
+
priority: 'Must'
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
permissions: [
|
|
110
|
+
{
|
|
111
|
+
path: 'business.{app}.{module}.read',
|
|
112
|
+
description: 'View {module} data',
|
|
113
|
+
roles: ['Admin', 'Manager', 'User', 'ReadOnly']
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
path: 'business.{app}.{module}.create',
|
|
117
|
+
description: 'Create new {module}',
|
|
118
|
+
roles: ['Admin', 'Manager']
|
|
119
|
+
}
|
|
120
|
+
]
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
// Composant Badge de priorité
|
|
124
|
+
function PriorityBadge({ priority }: { priority: string }) {
|
|
125
|
+
const colors = {
|
|
126
|
+
Must: 'bg-red-500/10 text-red-600',
|
|
127
|
+
Should: 'bg-yellow-500/10 text-yellow-600',
|
|
128
|
+
Could: 'bg-blue-500/10 text-blue-600'
|
|
129
|
+
};
|
|
130
|
+
return (
|
|
131
|
+
<span className={`px-2 py-0.5 rounded text-xs font-medium ${colors[priority as keyof typeof colors] || 'bg-gray-500/10 text-gray-600'}`}>
|
|
132
|
+
{priority}
|
|
133
|
+
</span>
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// Composant Section numérotée
|
|
138
|
+
function NumberedSection({
|
|
139
|
+
number,
|
|
140
|
+
title,
|
|
141
|
+
icon: Icon,
|
|
142
|
+
children
|
|
143
|
+
}: {
|
|
144
|
+
number: number;
|
|
145
|
+
title: string;
|
|
146
|
+
icon: React.ComponentType<{ className?: string }>;
|
|
147
|
+
children: React.ReactNode;
|
|
148
|
+
}) {
|
|
149
|
+
return (
|
|
150
|
+
<section id={`section-${number}`} className="scroll-mt-4">
|
|
151
|
+
<h2 className="text-xl font-semibold mb-4 flex items-center gap-3">
|
|
152
|
+
<span className="w-8 h-8 rounded-full bg-[var(--color-primary-600)] text-white flex items-center justify-center text-sm font-bold">
|
|
153
|
+
{number}
|
|
154
|
+
</span>
|
|
155
|
+
<Icon className="w-5 h-5 text-[var(--color-primary-600)]" />
|
|
156
|
+
{title}
|
|
157
|
+
</h2>
|
|
158
|
+
<div className="card p-6">
|
|
159
|
+
{children}
|
|
160
|
+
</div>
|
|
161
|
+
</section>
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export function {ModuleName}FrdDocPage() {
|
|
166
|
+
const { t } = useTranslation('docs-business');
|
|
167
|
+
|
|
168
|
+
return (
|
|
169
|
+
<div className="space-y-8">
|
|
170
|
+
{/* Breadcrumb */}
|
|
171
|
+
<nav className="flex items-center gap-2 text-sm text-[var(--text-secondary)]">
|
|
172
|
+
<Link to="/docs" className="hover:text-[var(--color-primary-600)]">
|
|
173
|
+
{t('breadcrumb.docs')}
|
|
174
|
+
</Link>
|
|
175
|
+
<span>/</span>
|
|
176
|
+
<Link to="/docs/business" className="hover:text-[var(--color-primary-600)]">
|
|
177
|
+
{t('breadcrumb.business')}
|
|
178
|
+
</Link>
|
|
179
|
+
<span>/</span>
|
|
180
|
+
<Link to={`/docs/business/${frdData.applicationName.toLowerCase()}`} className="hover:text-[var(--color-primary-600)]">
|
|
181
|
+
{t(`apps.${frdData.applicationName.toLowerCase()}.name`)}
|
|
182
|
+
</Link>
|
|
183
|
+
<span>/</span>
|
|
184
|
+
<span>{t(`modules.${frdData.moduleName.toLowerCase()}.name`)}</span>
|
|
185
|
+
</nav>
|
|
186
|
+
|
|
187
|
+
{/* Header */}
|
|
188
|
+
<header>
|
|
189
|
+
<div className="flex items-center gap-2 mb-2">
|
|
190
|
+
<span className="px-2 py-0.5 rounded bg-[var(--color-primary-600)]/10 text-[var(--color-primary-600)] text-xs font-medium">
|
|
191
|
+
{frdData.featureId}
|
|
192
|
+
</span>
|
|
193
|
+
<span className="px-2 py-0.5 rounded bg-green-500/10 text-green-600 text-xs font-medium">
|
|
194
|
+
v{frdData.version}
|
|
195
|
+
</span>
|
|
196
|
+
</div>
|
|
197
|
+
<h1 className="text-3xl font-bold mb-4 flex items-center gap-3">
|
|
198
|
+
<FileText className="w-8 h-8 text-[var(--color-primary-600)]" />
|
|
199
|
+
{t(`modules.${frdData.moduleName.toLowerCase()}.title`)}
|
|
200
|
+
</h1>
|
|
201
|
+
<p className="text-lg text-[var(--text-secondary)]">
|
|
202
|
+
{t(`modules.${frdData.moduleName.toLowerCase()}.subtitle`)}
|
|
203
|
+
</p>
|
|
204
|
+
</header>
|
|
205
|
+
|
|
206
|
+
{/* Table des matières */}
|
|
207
|
+
<div className="card p-4 bg-[var(--bg-secondary)]">
|
|
208
|
+
<h2 className="font-semibold mb-3 flex items-center gap-2">
|
|
209
|
+
<List className="w-4 h-4" />
|
|
210
|
+
{t('common.tableOfContents')}
|
|
211
|
+
</h2>
|
|
212
|
+
<nav className="grid grid-cols-2 md:grid-cols-3 gap-2">
|
|
213
|
+
{['overview', 'useCases', 'businessRules', 'permissions', 'wireframes', 'api'].map((section, idx) => (
|
|
214
|
+
<a
|
|
215
|
+
key={section}
|
|
216
|
+
href={`#section-${idx + 1}`}
|
|
217
|
+
className="flex items-center gap-2 p-2 rounded hover:bg-[var(--bg-tertiary)] text-sm"
|
|
218
|
+
>
|
|
219
|
+
<ChevronRight className="w-4 h-4 text-[var(--color-primary-600)]" />
|
|
220
|
+
{t(`sections.${section}`)}
|
|
221
|
+
</a>
|
|
222
|
+
))}
|
|
223
|
+
</nav>
|
|
224
|
+
</div>
|
|
225
|
+
|
|
226
|
+
{/* Section 1: Vue d'ensemble */}
|
|
227
|
+
<NumberedSection number={1} title={t('sections.overview')} icon={Layout}>
|
|
228
|
+
<p className="text-[var(--text-secondary)] mb-4">
|
|
229
|
+
{t(`modules.${frdData.moduleName.toLowerCase()}.overview`)}
|
|
230
|
+
</p>
|
|
231
|
+
<div className="grid grid-cols-2 md:grid-cols-4 gap-4 mt-4">
|
|
232
|
+
<div className="p-4 rounded-lg bg-[var(--bg-secondary)] text-center">
|
|
233
|
+
<div className="text-2xl font-bold text-[var(--color-primary-600)]">
|
|
234
|
+
{frdData.useCases.length}
|
|
235
|
+
</div>
|
|
236
|
+
<div className="text-sm text-[var(--text-secondary)]">{t('stats.useCases')}</div>
|
|
237
|
+
</div>
|
|
238
|
+
<div className="p-4 rounded-lg bg-[var(--bg-secondary)] text-center">
|
|
239
|
+
<div className="text-2xl font-bold text-[var(--color-primary-600)]">
|
|
240
|
+
{frdData.businessRules.length}
|
|
241
|
+
</div>
|
|
242
|
+
<div className="text-sm text-[var(--text-secondary)]">{t('stats.businessRules')}</div>
|
|
243
|
+
</div>
|
|
244
|
+
<div className="p-4 rounded-lg bg-[var(--bg-secondary)] text-center">
|
|
245
|
+
<div className="text-2xl font-bold text-[var(--color-primary-600)]">
|
|
246
|
+
{frdData.permissions.length}
|
|
247
|
+
</div>
|
|
248
|
+
<div className="text-sm text-[var(--text-secondary)]">{t('stats.permissions')}</div>
|
|
249
|
+
</div>
|
|
250
|
+
</div>
|
|
251
|
+
</NumberedSection>
|
|
252
|
+
|
|
253
|
+
{/* Section 2: Cas d'utilisation */}
|
|
254
|
+
<NumberedSection number={2} title={t('sections.useCases')} icon={Users}>
|
|
255
|
+
<div className="space-y-4">
|
|
256
|
+
{frdData.useCases.map((uc) => (
|
|
257
|
+
<div key={uc.id} className="border border-[var(--border-color)] rounded-lg p-4">
|
|
258
|
+
<div className="flex items-center justify-between mb-2">
|
|
259
|
+
<h3 className="font-semibold flex items-center gap-2">
|
|
260
|
+
<span className="px-2 py-0.5 rounded bg-[var(--color-primary-600)]/10 text-[var(--color-primary-600)] text-xs font-mono">
|
|
261
|
+
{uc.id}
|
|
262
|
+
</span>
|
|
263
|
+
{uc.name}
|
|
264
|
+
</h3>
|
|
265
|
+
<span className="text-sm text-[var(--text-secondary)]">
|
|
266
|
+
{t('labels.actor')}: {uc.actor}
|
|
267
|
+
</span>
|
|
268
|
+
</div>
|
|
269
|
+
<p className="text-sm text-[var(--text-secondary)] mb-2">{uc.description}</p>
|
|
270
|
+
<div className="flex items-center gap-2 text-xs">
|
|
271
|
+
<Shield className="w-3 h-3 text-amber-500" />
|
|
272
|
+
<code className="bg-[var(--bg-secondary)] px-2 py-0.5 rounded">{uc.permission}</code>
|
|
273
|
+
</div>
|
|
274
|
+
</div>
|
|
275
|
+
))}
|
|
276
|
+
</div>
|
|
277
|
+
</NumberedSection>
|
|
278
|
+
|
|
279
|
+
{/* Section 3: Règles métier */}
|
|
280
|
+
<NumberedSection number={3} title={t('sections.businessRules')} icon={CheckCircle}>
|
|
281
|
+
<div className="overflow-x-auto">
|
|
282
|
+
<table className="w-full text-sm">
|
|
283
|
+
<thead>
|
|
284
|
+
<tr className="bg-[var(--bg-secondary)]">
|
|
285
|
+
<th className="text-left py-2 px-3 rounded-tl-lg">ID</th>
|
|
286
|
+
<th className="text-left py-2 px-3">{t('labels.rule')}</th>
|
|
287
|
+
<th className="text-left py-2 px-3">{t('labels.category')}</th>
|
|
288
|
+
<th className="text-left py-2 px-3 rounded-tr-lg">{t('labels.priority')}</th>
|
|
289
|
+
</tr>
|
|
290
|
+
</thead>
|
|
291
|
+
<tbody>
|
|
292
|
+
{frdData.businessRules.map((br, idx) => (
|
|
293
|
+
<tr key={br.id} className={idx % 2 === 1 ? 'bg-[var(--bg-secondary)]/50' : ''}>
|
|
294
|
+
<td className="py-2 px-3 font-mono text-[var(--color-primary-600)]">{br.id}</td>
|
|
295
|
+
<td className="py-2 px-3">{br.rule}</td>
|
|
296
|
+
<td className="py-2 px-3 text-[var(--text-secondary)]">{br.category}</td>
|
|
297
|
+
<td className="py-2 px-3"><PriorityBadge priority={br.priority} /></td>
|
|
298
|
+
</tr>
|
|
299
|
+
))}
|
|
300
|
+
</tbody>
|
|
301
|
+
</table>
|
|
302
|
+
</div>
|
|
303
|
+
</NumberedSection>
|
|
304
|
+
|
|
305
|
+
{/* Section 4: Permissions */}
|
|
306
|
+
<NumberedSection number={4} title={t('sections.permissions')} icon={Shield}>
|
|
307
|
+
<div className="space-y-3">
|
|
308
|
+
{frdData.permissions.map((perm) => (
|
|
309
|
+
<div key={perm.path} className="flex items-center justify-between p-3 rounded-lg bg-[var(--bg-secondary)]">
|
|
310
|
+
<div>
|
|
311
|
+
<code className="text-sm font-mono text-[var(--color-primary-600)]">{perm.path}</code>
|
|
312
|
+
<p className="text-sm text-[var(--text-secondary)] mt-1">{perm.description}</p>
|
|
313
|
+
</div>
|
|
314
|
+
<div className="flex gap-1">
|
|
315
|
+
{perm.roles.map((role) => (
|
|
316
|
+
<span key={role} className="px-2 py-0.5 rounded bg-[var(--bg-tertiary)] text-xs">
|
|
317
|
+
{role}
|
|
318
|
+
</span>
|
|
319
|
+
))}
|
|
320
|
+
</div>
|
|
321
|
+
</div>
|
|
322
|
+
))}
|
|
323
|
+
</div>
|
|
324
|
+
|
|
325
|
+
{/* Avertissement permissions */}
|
|
326
|
+
<div className="mt-4 p-4 rounded-lg bg-amber-500/10 border border-amber-500/20 flex items-start gap-3">
|
|
327
|
+
<AlertTriangle className="w-5 h-5 text-amber-600 flex-shrink-0 mt-0.5" />
|
|
328
|
+
<div>
|
|
329
|
+
<div className="font-medium text-amber-600">{t('warnings.permissionCheck')}</div>
|
|
330
|
+
<p className="text-sm text-[var(--text-secondary)]">
|
|
331
|
+
{t('warnings.permissionCheckDescription')}
|
|
332
|
+
</p>
|
|
333
|
+
</div>
|
|
334
|
+
</div>
|
|
335
|
+
</NumberedSection>
|
|
336
|
+
|
|
337
|
+
{/* Section 5: Wireframes */}
|
|
338
|
+
<NumberedSection number={5} title={t('sections.wireframes')} icon={Layout}>
|
|
339
|
+
<div className="border-2 border-dashed border-[var(--border-color)] rounded-lg p-6">
|
|
340
|
+
<div className="text-center text-sm text-[var(--text-tertiary)] mb-4">
|
|
341
|
+
{t('common.wireframePreview')}
|
|
342
|
+
</div>
|
|
343
|
+
{/* Wireframe simplifié */}
|
|
344
|
+
<div className="space-y-4">
|
|
345
|
+
<div className="h-12 bg-[var(--bg-secondary)] rounded flex items-center px-4 justify-between">
|
|
346
|
+
<span className="text-sm">[Header + Navigation]</span>
|
|
347
|
+
<span className="text-sm">[User Menu]</span>
|
|
348
|
+
</div>
|
|
349
|
+
<div className="grid grid-cols-4 gap-4">
|
|
350
|
+
<div className="col-span-1 h-64 bg-[var(--bg-secondary)] rounded p-4">
|
|
351
|
+
<span className="text-sm">[Filters]</span>
|
|
352
|
+
</div>
|
|
353
|
+
<div className="col-span-3 h-64 bg-[var(--bg-secondary)] rounded p-4">
|
|
354
|
+
<span className="text-sm">[Data Table]</span>
|
|
355
|
+
</div>
|
|
356
|
+
</div>
|
|
357
|
+
</div>
|
|
358
|
+
</div>
|
|
359
|
+
</NumberedSection>
|
|
360
|
+
|
|
361
|
+
{/* Section 6: API Endpoints */}
|
|
362
|
+
<NumberedSection number={6} title={t('sections.api')} icon={Database}>
|
|
363
|
+
<div className="overflow-x-auto">
|
|
364
|
+
<table className="w-full text-sm font-mono">
|
|
365
|
+
<thead>
|
|
366
|
+
<tr className="bg-[var(--bg-secondary)]">
|
|
367
|
+
<th className="text-left py-2 px-3 rounded-tl-lg">Method</th>
|
|
368
|
+
<th className="text-left py-2 px-3">Endpoint</th>
|
|
369
|
+
<th className="text-left py-2 px-3 rounded-tr-lg">Permission</th>
|
|
370
|
+
</tr>
|
|
371
|
+
</thead>
|
|
372
|
+
<tbody>
|
|
373
|
+
<tr>
|
|
374
|
+
<td className="py-2 px-3"><span className="px-2 py-0.5 rounded bg-green-500/10 text-green-600">GET</span></td>
|
|
375
|
+
<td className="py-2 px-3">/api/business/{'{module}'}</td>
|
|
376
|
+
<td className="py-2 px-3 text-[var(--text-secondary)]">.read</td>
|
|
377
|
+
</tr>
|
|
378
|
+
<tr className="bg-[var(--bg-secondary)]/50">
|
|
379
|
+
<td className="py-2 px-3"><span className="px-2 py-0.5 rounded bg-blue-500/10 text-blue-600">POST</span></td>
|
|
380
|
+
<td className="py-2 px-3">/api/business/{'{module}'}</td>
|
|
381
|
+
<td className="py-2 px-3 text-[var(--text-secondary)]">.create</td>
|
|
382
|
+
</tr>
|
|
383
|
+
<tr>
|
|
384
|
+
<td className="py-2 px-3"><span className="px-2 py-0.5 rounded bg-yellow-500/10 text-yellow-600">PUT</span></td>
|
|
385
|
+
<td className="py-2 px-3">/api/business/{'{module}'}/{'{id}'}</td>
|
|
386
|
+
<td className="py-2 px-3 text-[var(--text-secondary)]">.update</td>
|
|
387
|
+
</tr>
|
|
388
|
+
<tr className="bg-[var(--bg-secondary)]/50">
|
|
389
|
+
<td className="py-2 px-3"><span className="px-2 py-0.5 rounded bg-red-500/10 text-red-600">DELETE</span></td>
|
|
390
|
+
<td className="py-2 px-3">/api/business/{'{module}'}/{'{id}'}</td>
|
|
391
|
+
<td className="py-2 px-3 text-[var(--text-secondary)]">.delete</td>
|
|
392
|
+
</tr>
|
|
393
|
+
</tbody>
|
|
394
|
+
</table>
|
|
395
|
+
</div>
|
|
396
|
+
</NumberedSection>
|
|
397
|
+
|
|
398
|
+
{/* Navigation footer */}
|
|
399
|
+
<div className="flex justify-between pt-6 border-t border-[var(--border-color)]">
|
|
400
|
+
<Link
|
|
401
|
+
to={`/docs/business/${frdData.applicationName.toLowerCase()}`}
|
|
402
|
+
className="flex items-center gap-2 text-[var(--text-secondary)] hover:text-[var(--color-primary-600)]"
|
|
403
|
+
>
|
|
404
|
+
<ArrowRight className="w-4 h-4 rotate-180" />
|
|
405
|
+
{t('nav.backToApp')}
|
|
406
|
+
</Link>
|
|
407
|
+
<Link
|
|
408
|
+
to="/docs/business"
|
|
409
|
+
className="flex items-center gap-2 text-[var(--color-primary-600)]"
|
|
410
|
+
>
|
|
411
|
+
{t('nav.allModules')}
|
|
412
|
+
<ArrowRight className="w-4 h-4" />
|
|
413
|
+
</Link>
|
|
414
|
+
</div>
|
|
415
|
+
</div>
|
|
416
|
+
);
|
|
417
|
+
}
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
---
|
|
421
|
+
|
|
422
|
+
## Template i18n docs-business.json
|
|
423
|
+
|
|
424
|
+
```json
|
|
425
|
+
{
|
|
426
|
+
"breadcrumb": {
|
|
427
|
+
"docs": "Documentation",
|
|
428
|
+
"business": "Business"
|
|
429
|
+
},
|
|
430
|
+
"common": {
|
|
431
|
+
"tableOfContents": "Table of Contents",
|
|
432
|
+
"wireframePreview": "Wireframe Preview"
|
|
433
|
+
},
|
|
434
|
+
"sections": {
|
|
435
|
+
"overview": "Overview",
|
|
436
|
+
"useCases": "Use Cases",
|
|
437
|
+
"businessRules": "Business Rules",
|
|
438
|
+
"permissions": "Permissions",
|
|
439
|
+
"wireframes": "Wireframes",
|
|
440
|
+
"api": "API Endpoints"
|
|
441
|
+
},
|
|
442
|
+
"labels": {
|
|
443
|
+
"actor": "Actor",
|
|
444
|
+
"rule": "Rule",
|
|
445
|
+
"category": "Category",
|
|
446
|
+
"priority": "Priority"
|
|
447
|
+
},
|
|
448
|
+
"stats": {
|
|
449
|
+
"useCases": "Use Cases",
|
|
450
|
+
"businessRules": "Business Rules",
|
|
451
|
+
"permissions": "Permissions"
|
|
452
|
+
},
|
|
453
|
+
"warnings": {
|
|
454
|
+
"permissionCheck": "Permission Check Required",
|
|
455
|
+
"permissionCheckDescription": "Ensure all permissions are registered in PermissionConfiguration.cs before deployment."
|
|
456
|
+
},
|
|
457
|
+
"nav": {
|
|
458
|
+
"backToApp": "Back to Application",
|
|
459
|
+
"allModules": "All Modules"
|
|
460
|
+
},
|
|
461
|
+
"apps": {
|
|
462
|
+
"{app}": {
|
|
463
|
+
"name": "{Application Name}",
|
|
464
|
+
"description": "{Application description}"
|
|
465
|
+
}
|
|
466
|
+
},
|
|
467
|
+
"modules": {
|
|
468
|
+
"{module}": {
|
|
469
|
+
"name": "{Module Name}",
|
|
470
|
+
"title": "{Module Title}",
|
|
471
|
+
"subtitle": "{Module subtitle description}",
|
|
472
|
+
"overview": "{Detailed overview of the module functionality}"
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
```
|
|
477
|
+
|
|
478
|
+
---
|
|
479
|
+
|
|
480
|
+
## Template Index Application
|
|
481
|
+
|
|
482
|
+
```tsx
|
|
483
|
+
// web/smartstack-web/src/pages/docs/business/{app}/index.tsx
|
|
484
|
+
|
|
485
|
+
import { Link } from 'react-router-dom';
|
|
486
|
+
import { useTranslation } from 'react-i18next';
|
|
487
|
+
import { Folder, FileText, ChevronRight } from 'lucide-react';
|
|
488
|
+
|
|
489
|
+
interface ModuleLink {
|
|
490
|
+
id: string;
|
|
491
|
+
name: string;
|
|
492
|
+
description: string;
|
|
493
|
+
features: number;
|
|
494
|
+
path: string;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
const modules: ModuleLink[] = [
|
|
498
|
+
{
|
|
499
|
+
id: '{module}',
|
|
500
|
+
name: '{Module Name}',
|
|
501
|
+
description: '{Module description}',
|
|
502
|
+
features: 3,
|
|
503
|
+
path: '/docs/business/{app}/{module}'
|
|
504
|
+
}
|
|
505
|
+
];
|
|
506
|
+
|
|
507
|
+
export function {App}DocsIndexPage() {
|
|
508
|
+
const { t } = useTranslation('docs-business');
|
|
509
|
+
|
|
510
|
+
return (
|
|
511
|
+
<div className="space-y-8">
|
|
512
|
+
{/* Breadcrumb */}
|
|
513
|
+
<nav className="flex items-center gap-2 text-sm text-[var(--text-secondary)]">
|
|
514
|
+
<Link to="/docs">{t('breadcrumb.docs')}</Link>
|
|
515
|
+
<span>/</span>
|
|
516
|
+
<Link to="/docs/business">{t('breadcrumb.business')}</Link>
|
|
517
|
+
<span>/</span>
|
|
518
|
+
<span>{t('apps.{app}.name')}</span>
|
|
519
|
+
</nav>
|
|
520
|
+
|
|
521
|
+
{/* Header */}
|
|
522
|
+
<header>
|
|
523
|
+
<h1 className="text-3xl font-bold mb-4 flex items-center gap-3">
|
|
524
|
+
<Folder className="w-8 h-8 text-[var(--color-primary-600)]" />
|
|
525
|
+
{t('apps.{app}.name')}
|
|
526
|
+
</h1>
|
|
527
|
+
<p className="text-lg text-[var(--text-secondary)]">
|
|
528
|
+
{t('apps.{app}.description')}
|
|
529
|
+
</p>
|
|
530
|
+
</header>
|
|
531
|
+
|
|
532
|
+
{/* Modules list */}
|
|
533
|
+
<section>
|
|
534
|
+
<h2 className="text-xl font-semibold mb-4">{t('common.modules')}</h2>
|
|
535
|
+
<div className="grid gap-4">
|
|
536
|
+
{modules.map((module) => (
|
|
537
|
+
<Link
|
|
538
|
+
key={module.id}
|
|
539
|
+
to={module.path}
|
|
540
|
+
className="card p-4 hover:border-[var(--color-primary-600)] transition-colors group"
|
|
541
|
+
>
|
|
542
|
+
<div className="flex items-center justify-between">
|
|
543
|
+
<div className="flex items-center gap-3">
|
|
544
|
+
<FileText className="w-6 h-6 text-[var(--color-primary-600)]" />
|
|
545
|
+
<div>
|
|
546
|
+
<h3 className="font-semibold group-hover:text-[var(--color-primary-600)]">
|
|
547
|
+
{module.name}
|
|
548
|
+
</h3>
|
|
549
|
+
<p className="text-sm text-[var(--text-secondary)]">
|
|
550
|
+
{module.description}
|
|
551
|
+
</p>
|
|
552
|
+
</div>
|
|
553
|
+
</div>
|
|
554
|
+
<div className="flex items-center gap-4">
|
|
555
|
+
<span className="text-sm text-[var(--text-secondary)]">
|
|
556
|
+
{module.features} features
|
|
557
|
+
</span>
|
|
558
|
+
<ChevronRight className="w-5 h-5 text-[var(--text-tertiary)] group-hover:text-[var(--color-primary-600)]" />
|
|
559
|
+
</div>
|
|
560
|
+
</div>
|
|
561
|
+
</Link>
|
|
562
|
+
))}
|
|
563
|
+
</div>
|
|
564
|
+
</section>
|
|
565
|
+
</div>
|
|
566
|
+
);
|
|
567
|
+
}
|
|
568
|
+
```
|
|
569
|
+
|
|
570
|
+
---
|
|
571
|
+
|
|
572
|
+
## Checklist génération
|
|
573
|
+
|
|
574
|
+
Lors de la génération avec `/business-analyse:7-doc-html`:
|
|
575
|
+
|
|
576
|
+
- [ ] Utiliser Context7 pour patterns React actuels
|
|
577
|
+
- [ ] Générer `FrdDocPage.tsx` avec données du FRD
|
|
578
|
+
- [ ] Créer/mettre à jour `docs-business.json` (4 langues)
|
|
579
|
+
- [ ] Ajouter route dans `App.tsx`
|
|
580
|
+
- [ ] Mettre à jour index parent si nouveau module
|