@atlashub/smartstack-cli 1.4.1 → 1.5.1
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/agents.html +5 -1
- package/.documentation/apex.html +5 -1
- package/.documentation/business-analyse.html +5 -1
- package/.documentation/commands.html +5 -1
- package/.documentation/css/styles.css +2168 -2168
- package/.documentation/efcore.html +5 -1
- package/.documentation/gitflow.html +5 -1
- package/.documentation/hooks.html +5 -1
- package/.documentation/index.html +5 -1
- package/.documentation/init.html +565 -0
- package/.documentation/installation.html +92 -6
- package/.documentation/js/app.js +794 -794
- package/.documentation/ralph-loop.html +534 -530
- package/.documentation/test-web.html +5 -1
- package/dist/index.js +817 -277
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/templates/agents/efcore/conflicts.md +44 -17
- package/templates/agents/efcore/db-status.md +27 -6
- package/templates/agents/efcore/scan.md +43 -13
- package/templates/commands/ai-prompt.md +315 -315
- package/templates/commands/application/create.md +362 -362
- package/templates/commands/controller/create.md +216 -216
- package/templates/commands/controller.md +59 -0
- package/templates/commands/documentation/module.md +202 -202
- package/templates/commands/efcore/_env-check.md +153 -153
- package/templates/commands/efcore/conflicts.md +109 -192
- package/templates/commands/efcore/db-status.md +101 -89
- package/templates/commands/efcore/migration.md +23 -11
- package/templates/commands/efcore/scan.md +115 -119
- package/templates/commands/efcore.md +54 -6
- package/templates/commands/feature-full.md +267 -267
- package/templates/commands/gitflow/11-finish.md +145 -11
- 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 +120 -10
- package/templates/commands/gitflow/3-commit.md +150 -0
- package/templates/commands/gitflow/7-pull-request.md +134 -5
- package/templates/commands/gitflow/9-merge.md +142 -1
- package/templates/commands/implement.md +663 -663
- package/templates/commands/init.md +567 -0
- package/templates/commands/mcp-integration.md +330 -0
- package/templates/commands/notification.md +129 -129
- package/templates/commands/validate.md +233 -0
- package/templates/commands/workflow.md +193 -193
- 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/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
|
@@ -0,0 +1,567 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Initialize a new SmartStack project with backend (.NET) and frontend (React)
|
|
3
|
+
args: [project_name]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# SmartStack Init - Project Scaffolding
|
|
7
|
+
|
|
8
|
+
You are an expert in SmartStack architecture. Initialize a new project based on the SmartStack template.
|
|
9
|
+
|
|
10
|
+
> **CLAUDE INSTRUCTION:** The `AskUserQuestion({...})` blocks below are instructions for using the `AskUserQuestion` tool **interactively**. You MUST execute the tool with these parameters to get the user's response BEFORE continuing. DO NOT display this code - WAIT for the response.
|
|
11
|
+
|
|
12
|
+
**Argument:** `$ARGUMENTS` = project name (required)
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## ETAPE 0: VALIDATION PRE-INIT
|
|
17
|
+
|
|
18
|
+
### 0.1 Verification des serveurs MCP
|
|
19
|
+
|
|
20
|
+
> **CRITIQUE:** Les serveurs MCP SmartStack et Context7 sont requis pour le developpement optimal avec SmartStack.
|
|
21
|
+
|
|
22
|
+
**Verifier les MCP installes:**
|
|
23
|
+
```bash
|
|
24
|
+
# Lister les serveurs MCP actifs
|
|
25
|
+
claude mcp list
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
**MCP requis:**
|
|
29
|
+
|
|
30
|
+
| Serveur | Fonction | Installation |
|
|
31
|
+
|---------|----------|--------------|
|
|
32
|
+
| **SmartStack MCP** | Validation conventions, scaffolding, API docs | `claude mcp add smartstack` |
|
|
33
|
+
| **Context7 MCP** | Documentation libraries, exemples de code | `claude mcp add context7 -- npx @upstash/context7-mcp -- --api-key YOUR_API_KEY` |
|
|
34
|
+
|
|
35
|
+
**Si un MCP manque:**
|
|
36
|
+
```
|
|
37
|
+
┌──────────────────────────────────────────────────────────────────────────────┐
|
|
38
|
+
│ ⚠️ MCP SERVERS MISSING │
|
|
39
|
+
├──────────────────────────────────────────────────────────────────────────────┤
|
|
40
|
+
│ Les serveurs MCP suivants ne sont pas installes: │
|
|
41
|
+
│ • SmartStack MCP │
|
|
42
|
+
│ • Context7 MCP │
|
|
43
|
+
│ │
|
|
44
|
+
│ INSTALLATION: │
|
|
45
|
+
│ → SmartStack MCP: claude mcp add smartstack │
|
|
46
|
+
│ → Context7 MCP: claude mcp add context7 │
|
|
47
|
+
└──────────────────────────────────────────────────────────────────────────────┘
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**Demander confirmation si MCP manquants:**
|
|
51
|
+
```javascript
|
|
52
|
+
if (mcpMissing.length > 0) {
|
|
53
|
+
AskUserQuestion({
|
|
54
|
+
questions: [{
|
|
55
|
+
question: "Des serveurs MCP sont manquants. Continuer sans eux ?",
|
|
56
|
+
header: "MCP",
|
|
57
|
+
options: [
|
|
58
|
+
{ label: "Non, installer d'abord", description: "Recommande - installer les MCP avant de continuer" },
|
|
59
|
+
{ label: "Oui, continuer", description: "Le projet sera cree mais certaines fonctionnalites seront limitees" }
|
|
60
|
+
],
|
|
61
|
+
multiSelect: false
|
|
62
|
+
}]
|
|
63
|
+
})
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### 0.2 Verification des prerequis systeme
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
# Verifier .NET SDK
|
|
71
|
+
dotnet --version
|
|
72
|
+
|
|
73
|
+
# Verifier Node.js
|
|
74
|
+
node --version
|
|
75
|
+
|
|
76
|
+
# Verifier npm
|
|
77
|
+
npm --version
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
**Si un prerequis manque:**
|
|
81
|
+
```
|
|
82
|
+
PREREQUIS MANQUANTS
|
|
83
|
+
==========================================
|
|
84
|
+
[ ] .NET 10.0+ SDK
|
|
85
|
+
[ ] Node.js 18+
|
|
86
|
+
[ ] npm 9+
|
|
87
|
+
|
|
88
|
+
Installez les prerequis avant de continuer.
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### 0.3 Verification du repertoire
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
# Verifier que le repertoire cible n'existe pas
|
|
95
|
+
if [ -d "$PROJECT_NAME" ]; then
|
|
96
|
+
echo "Le repertoire '$PROJECT_NAME' existe deja."
|
|
97
|
+
exit 1
|
|
98
|
+
fi
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## ETAPE 1: CONFIGURATION DU PROJET
|
|
104
|
+
|
|
105
|
+
### 1.1 Collecter les informations
|
|
106
|
+
|
|
107
|
+
```javascript
|
|
108
|
+
AskUserQuestion({
|
|
109
|
+
questions: [
|
|
110
|
+
{
|
|
111
|
+
question: "Quel type de projet voulez-vous creer ?",
|
|
112
|
+
header: "Type",
|
|
113
|
+
options: [
|
|
114
|
+
{ label: "Full Stack", description: "Backend .NET + Frontend React (Recommande)" },
|
|
115
|
+
{ label: "Backend Only", description: "API .NET uniquement" },
|
|
116
|
+
{ label: "Frontend Only", description: "Application React uniquement" }
|
|
117
|
+
],
|
|
118
|
+
multiSelect: false
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
question: "Quelle base de donnees utiliser ?",
|
|
122
|
+
header: "Database",
|
|
123
|
+
options: [
|
|
124
|
+
{ label: "SQL Server", description: "Microsoft SQL Server (Recommande)" },
|
|
125
|
+
{ label: "PostgreSQL", description: "PostgreSQL avec Npgsql" },
|
|
126
|
+
{ label: "SQLite", description: "SQLite pour developpement local" }
|
|
127
|
+
],
|
|
128
|
+
multiSelect: false
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
question: "Quels modules SmartStack activer ?",
|
|
132
|
+
header: "Modules",
|
|
133
|
+
options: [
|
|
134
|
+
{ label: "Auth", description: "Authentication JWT + OAuth (Google, Microsoft)" },
|
|
135
|
+
{ label: "Navigation", description: "Menu dynamique et navigation" },
|
|
136
|
+
{ label: "AI", description: "Integration OpenAI/Claude" },
|
|
137
|
+
{ label: "Notifications", description: "Notifications temps reel (SignalR)" }
|
|
138
|
+
],
|
|
139
|
+
multiSelect: true
|
|
140
|
+
}
|
|
141
|
+
]
|
|
142
|
+
})
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## ETAPE 2: CREATION DE LA STRUCTURE
|
|
148
|
+
|
|
149
|
+
### 2.1 Structure Backend (.NET)
|
|
150
|
+
|
|
151
|
+
```
|
|
152
|
+
{ProjectName}/
|
|
153
|
+
├── src/
|
|
154
|
+
│ ├── {ProjectName}.Domain/
|
|
155
|
+
│ │ ├── Entities/
|
|
156
|
+
│ │ ├── Interfaces/
|
|
157
|
+
│ │ └── {ProjectName}.Domain.csproj
|
|
158
|
+
│ ├── {ProjectName}.Application/
|
|
159
|
+
│ │ ├── Services/
|
|
160
|
+
│ │ ├── DTOs/
|
|
161
|
+
│ │ └── {ProjectName}.Application.csproj
|
|
162
|
+
│ ├── {ProjectName}.Infrastructure/
|
|
163
|
+
│ │ ├── Data/
|
|
164
|
+
│ │ │ └── {ProjectName}DbContext.cs
|
|
165
|
+
│ │ ├── Repositories/
|
|
166
|
+
│ │ └── {ProjectName}.Infrastructure.csproj
|
|
167
|
+
│ └── {ProjectName}.Api/
|
|
168
|
+
│ ├── Controllers/
|
|
169
|
+
│ ├── Program.cs
|
|
170
|
+
│ └── {ProjectName}.Api.csproj
|
|
171
|
+
├── tests/
|
|
172
|
+
│ └── {ProjectName}.Tests/
|
|
173
|
+
├── web/
|
|
174
|
+
│ └── {projectname}-web/
|
|
175
|
+
│ ├── src/
|
|
176
|
+
│ ├── package.json
|
|
177
|
+
│ └── vite.config.ts
|
|
178
|
+
├── {ProjectName}.sln
|
|
179
|
+
├── Directory.Build.props
|
|
180
|
+
└── README.md
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### 2.2 Creer la solution .NET
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
# Creer le repertoire
|
|
187
|
+
mkdir -p "$PROJECT_NAME"
|
|
188
|
+
cd "$PROJECT_NAME"
|
|
189
|
+
|
|
190
|
+
# Creer la solution
|
|
191
|
+
dotnet new sln -n "$PROJECT_NAME"
|
|
192
|
+
|
|
193
|
+
# Creer les projets
|
|
194
|
+
dotnet new classlib -n "$PROJECT_NAME.Domain" -o "src/$PROJECT_NAME.Domain"
|
|
195
|
+
dotnet new classlib -n "$PROJECT_NAME.Application" -o "src/$PROJECT_NAME.Application"
|
|
196
|
+
dotnet new classlib -n "$PROJECT_NAME.Infrastructure" -o "src/$PROJECT_NAME.Infrastructure"
|
|
197
|
+
dotnet new webapi -n "$PROJECT_NAME.Api" -o "src/$PROJECT_NAME.Api"
|
|
198
|
+
|
|
199
|
+
# Ajouter a la solution
|
|
200
|
+
dotnet sln add "src/$PROJECT_NAME.Domain"
|
|
201
|
+
dotnet sln add "src/$PROJECT_NAME.Application"
|
|
202
|
+
dotnet sln add "src/$PROJECT_NAME.Infrastructure"
|
|
203
|
+
dotnet sln add "src/$PROJECT_NAME.Api"
|
|
204
|
+
|
|
205
|
+
# Ajouter les references entre projets
|
|
206
|
+
dotnet add "src/$PROJECT_NAME.Application" reference "src/$PROJECT_NAME.Domain"
|
|
207
|
+
dotnet add "src/$PROJECT_NAME.Infrastructure" reference "src/$PROJECT_NAME.Domain"
|
|
208
|
+
dotnet add "src/$PROJECT_NAME.Infrastructure" reference "src/$PROJECT_NAME.Application"
|
|
209
|
+
dotnet add "src/$PROJECT_NAME.Api" reference "src/$PROJECT_NAME.Application"
|
|
210
|
+
dotnet add "src/$PROJECT_NAME.Api" reference "src/$PROJECT_NAME.Infrastructure"
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
### 2.3 Installer les packages NuGet
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
# EF Core packages (Infrastructure)
|
|
217
|
+
dotnet add "src/$PROJECT_NAME.Infrastructure" package Microsoft.EntityFrameworkCore
|
|
218
|
+
dotnet add "src/$PROJECT_NAME.Infrastructure" package Microsoft.EntityFrameworkCore.Design
|
|
219
|
+
|
|
220
|
+
# Database provider (selon base de donnees selectionnee)
|
|
221
|
+
# SQL Server:
|
|
222
|
+
dotnet add "src/$PROJECT_NAME.Infrastructure" package Microsoft.EntityFrameworkCore.SqlServer
|
|
223
|
+
|
|
224
|
+
# PostgreSQL:
|
|
225
|
+
# dotnet add "src/$PROJECT_NAME.Infrastructure" package Npgsql.EntityFrameworkCore.PostgreSQL
|
|
226
|
+
|
|
227
|
+
# SQLite:
|
|
228
|
+
# dotnet add "src/$PROJECT_NAME.Infrastructure" package Microsoft.EntityFrameworkCore.Sqlite
|
|
229
|
+
|
|
230
|
+
# API packages
|
|
231
|
+
dotnet add "src/$PROJECT_NAME.Api" package Microsoft.AspNetCore.Authentication.JwtBearer
|
|
232
|
+
dotnet add "src/$PROJECT_NAME.Api" package Swashbuckle.AspNetCore
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
## ETAPE 3: CREATION DU FRONTEND (si Full Stack)
|
|
238
|
+
|
|
239
|
+
### 3.1 Creer le projet React
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
mkdir -p "web/${PROJECT_NAME_LOWER}-web"
|
|
243
|
+
cd "web/${PROJECT_NAME_LOWER}-web"
|
|
244
|
+
|
|
245
|
+
# Initialiser avec Vite
|
|
246
|
+
npm create vite@latest . -- --template react-ts
|
|
247
|
+
|
|
248
|
+
# Installer les dependances
|
|
249
|
+
npm install
|
|
250
|
+
|
|
251
|
+
# Installer SmartStack React
|
|
252
|
+
npm install @atlashub/smartstack-react
|
|
253
|
+
|
|
254
|
+
# Installer les peer dependencies
|
|
255
|
+
npm install axios react-router-dom i18next react-i18next
|
|
256
|
+
|
|
257
|
+
# Installer Tailwind CSS
|
|
258
|
+
npm install -D tailwindcss @tailwindcss/vite
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### 3.2 Configurer le projet React
|
|
262
|
+
|
|
263
|
+
Creer `vite.config.ts`:
|
|
264
|
+
```typescript
|
|
265
|
+
import { defineConfig } from 'vite'
|
|
266
|
+
import react from '@vitejs/plugin-react'
|
|
267
|
+
import tailwindcss from '@tailwindcss/vite'
|
|
268
|
+
|
|
269
|
+
export default defineConfig({
|
|
270
|
+
plugins: [react(), tailwindcss()],
|
|
271
|
+
server: {
|
|
272
|
+
port: 5173,
|
|
273
|
+
proxy: {
|
|
274
|
+
'/api': {
|
|
275
|
+
target: 'https://localhost:5001',
|
|
276
|
+
changeOrigin: true,
|
|
277
|
+
secure: false
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
})
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
Creer `src/main.tsx`:
|
|
285
|
+
```tsx
|
|
286
|
+
import { StrictMode } from 'react'
|
|
287
|
+
import { createRoot } from 'react-dom/client'
|
|
288
|
+
import { BrowserRouter } from 'react-router-dom'
|
|
289
|
+
import { SmartStackProvider } from '@atlashub/smartstack-react'
|
|
290
|
+
import '@atlashub/smartstack-react/styles'
|
|
291
|
+
import App from './App'
|
|
292
|
+
|
|
293
|
+
createRoot(document.getElementById('root')!).render(
|
|
294
|
+
<StrictMode>
|
|
295
|
+
<BrowserRouter>
|
|
296
|
+
<SmartStackProvider apiUrl="https://localhost:5001/api">
|
|
297
|
+
<App />
|
|
298
|
+
</SmartStackProvider>
|
|
299
|
+
</BrowserRouter>
|
|
300
|
+
</StrictMode>
|
|
301
|
+
)
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
306
|
+
## ETAPE 4: CONFIGURATION
|
|
307
|
+
|
|
308
|
+
### 4.1 Creer Directory.Build.props
|
|
309
|
+
|
|
310
|
+
```xml
|
|
311
|
+
<Project>
|
|
312
|
+
<PropertyGroup>
|
|
313
|
+
<TargetFramework>net10.0</TargetFramework>
|
|
314
|
+
<Nullable>enable</Nullable>
|
|
315
|
+
<ImplicitUsings>enable</ImplicitUsings>
|
|
316
|
+
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
|
317
|
+
</PropertyGroup>
|
|
318
|
+
</Project>
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
### 4.2 Configurer appsettings.json
|
|
322
|
+
|
|
323
|
+
```json
|
|
324
|
+
{
|
|
325
|
+
"ConnectionStrings": {
|
|
326
|
+
"DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database={ProjectName};Trusted_Connection=True;MultipleActiveResultSets=true"
|
|
327
|
+
},
|
|
328
|
+
"SmartStack": {
|
|
329
|
+
"Modules": {
|
|
330
|
+
"Auth": true,
|
|
331
|
+
"Navigation": true,
|
|
332
|
+
"AI": false,
|
|
333
|
+
"Notifications": true
|
|
334
|
+
}
|
|
335
|
+
},
|
|
336
|
+
"Jwt": {
|
|
337
|
+
"Secret": "CHANGE_THIS_SECRET_IN_PRODUCTION_MIN_32_CHARS",
|
|
338
|
+
"Issuer": "{ProjectName}",
|
|
339
|
+
"Audience": "{ProjectName}",
|
|
340
|
+
"ExpirationMinutes": 60
|
|
341
|
+
},
|
|
342
|
+
"Logging": {
|
|
343
|
+
"LogLevel": {
|
|
344
|
+
"Default": "Information"
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
### 4.3 Configurer Program.cs
|
|
351
|
+
|
|
352
|
+
```csharp
|
|
353
|
+
using SmartStack.Api.Core;
|
|
354
|
+
using SmartStack.Infrastructure;
|
|
355
|
+
using {ProjectName}.Infrastructure.Data;
|
|
356
|
+
|
|
357
|
+
var builder = WebApplication.CreateBuilder(args);
|
|
358
|
+
|
|
359
|
+
// SmartStack services
|
|
360
|
+
builder.Services.AddSmartStackCore(builder.Configuration);
|
|
361
|
+
builder.Services.AddSmartStackInfrastructure<{ProjectName}DbContext>(builder.Configuration);
|
|
362
|
+
|
|
363
|
+
// Add controllers
|
|
364
|
+
builder.Services.AddControllers();
|
|
365
|
+
builder.Services.AddEndpointsApiExplorer();
|
|
366
|
+
builder.Services.AddOpenApi();
|
|
367
|
+
|
|
368
|
+
var app = builder.Build();
|
|
369
|
+
|
|
370
|
+
// SmartStack middleware
|
|
371
|
+
app.UseSmartStackMiddleware();
|
|
372
|
+
|
|
373
|
+
if (app.Environment.IsDevelopment())
|
|
374
|
+
{
|
|
375
|
+
app.MapOpenApi();
|
|
376
|
+
app.UseScalar();
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
app.UseHttpsRedirection();
|
|
380
|
+
app.UseAuthentication();
|
|
381
|
+
app.UseAuthorization();
|
|
382
|
+
app.MapControllers();
|
|
383
|
+
|
|
384
|
+
app.Run();
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
### 4.4 Creer le DbContext
|
|
388
|
+
|
|
389
|
+
```csharp
|
|
390
|
+
using Microsoft.EntityFrameworkCore;
|
|
391
|
+
using SmartStack.Infrastructure.Data;
|
|
392
|
+
|
|
393
|
+
namespace {ProjectName}.Infrastructure.Data;
|
|
394
|
+
|
|
395
|
+
public class {ProjectName}DbContext : SmartStackDbContext
|
|
396
|
+
{
|
|
397
|
+
public {ProjectName}DbContext(DbContextOptions<{ProjectName}DbContext> options)
|
|
398
|
+
: base(options)
|
|
399
|
+
{
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
403
|
+
{
|
|
404
|
+
base.OnModelCreating(modelBuilder);
|
|
405
|
+
|
|
406
|
+
// Add your entity configurations here
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
---
|
|
412
|
+
|
|
413
|
+
## ETAPE 5: INITIALISATION GIT
|
|
414
|
+
|
|
415
|
+
```bash
|
|
416
|
+
cd "$PROJECT_NAME"
|
|
417
|
+
|
|
418
|
+
# Initialiser Git
|
|
419
|
+
git init
|
|
420
|
+
|
|
421
|
+
# Creer .gitignore
|
|
422
|
+
cat > .gitignore << 'EOF'
|
|
423
|
+
## .NET
|
|
424
|
+
bin/
|
|
425
|
+
obj/
|
|
426
|
+
*.user
|
|
427
|
+
*.suo
|
|
428
|
+
.vs/
|
|
429
|
+
|
|
430
|
+
## Node
|
|
431
|
+
node_modules/
|
|
432
|
+
dist/
|
|
433
|
+
|
|
434
|
+
## IDE
|
|
435
|
+
.idea/
|
|
436
|
+
.vscode/
|
|
437
|
+
|
|
438
|
+
## Environment
|
|
439
|
+
*.env
|
|
440
|
+
*.env.local
|
|
441
|
+
appsettings.*.json
|
|
442
|
+
!appsettings.json
|
|
443
|
+
!appsettings.Development.json
|
|
444
|
+
|
|
445
|
+
## Build
|
|
446
|
+
*.log
|
|
447
|
+
EOF
|
|
448
|
+
|
|
449
|
+
# Premier commit
|
|
450
|
+
git add .
|
|
451
|
+
git commit -m "chore: initial SmartStack project setup"
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
---
|
|
455
|
+
|
|
456
|
+
## ETAPE 6: VERIFICATION
|
|
457
|
+
|
|
458
|
+
### 6.1 Build Backend
|
|
459
|
+
|
|
460
|
+
```bash
|
|
461
|
+
dotnet restore
|
|
462
|
+
dotnet build
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
### 6.2 Build Frontend (si applicable)
|
|
466
|
+
|
|
467
|
+
```bash
|
|
468
|
+
cd "web/${PROJECT_NAME_LOWER}-web"
|
|
469
|
+
npm run build
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
---
|
|
473
|
+
|
|
474
|
+
## RESUME FINAL
|
|
475
|
+
|
|
476
|
+
```
|
|
477
|
+
================================================================================
|
|
478
|
+
SMARTSTACK PROJECT INITIALIZED
|
|
479
|
+
================================================================================
|
|
480
|
+
|
|
481
|
+
Projet: {ProjectName}
|
|
482
|
+
Type: {Full Stack|Backend Only|Frontend Only}
|
|
483
|
+
Database: {SQL Server|PostgreSQL|SQLite}
|
|
484
|
+
Modules: {Auth, Navigation, ...}
|
|
485
|
+
|
|
486
|
+
STRUCTURE CREEE:
|
|
487
|
+
src/
|
|
488
|
+
├── {ProjectName}.Domain/
|
|
489
|
+
├── {ProjectName}.Application/
|
|
490
|
+
├── {ProjectName}.Infrastructure/
|
|
491
|
+
└── {ProjectName}.Api/
|
|
492
|
+
web/
|
|
493
|
+
└── {projectname}-web/
|
|
494
|
+
|
|
495
|
+
PACKAGES INSTALLES:
|
|
496
|
+
NuGet:
|
|
497
|
+
✓ Microsoft.EntityFrameworkCore
|
|
498
|
+
✓ Microsoft.EntityFrameworkCore.Design
|
|
499
|
+
✓ Microsoft.EntityFrameworkCore.SqlServer (ou PostgreSQL/SQLite)
|
|
500
|
+
✓ Microsoft.AspNetCore.Authentication.JwtBearer
|
|
501
|
+
✓ Swashbuckle.AspNetCore
|
|
502
|
+
npm:
|
|
503
|
+
✓ @atlashub/smartstack-react
|
|
504
|
+
✓ tailwindcss
|
|
505
|
+
|
|
506
|
+
PROCHAINES ETAPES:
|
|
507
|
+
1. Configurer la connection string dans appsettings.json
|
|
508
|
+
2. Creer la migration initiale:
|
|
509
|
+
dotnet ef migrations add InitialCreate -p src/{ProjectName}.Infrastructure -s src/{ProjectName}.Api
|
|
510
|
+
3. Appliquer la migration:
|
|
511
|
+
dotnet ef database update -p src/{ProjectName}.Infrastructure -s src/{ProjectName}.Api
|
|
512
|
+
4. Lancer le backend:
|
|
513
|
+
dotnet run --project src/{ProjectName}.Api
|
|
514
|
+
5. Lancer le frontend:
|
|
515
|
+
cd web/{projectname}-web && npm run dev
|
|
516
|
+
|
|
517
|
+
DOCUMENTATION:
|
|
518
|
+
- SmartStack: https://docs.smartstack.app
|
|
519
|
+
- API Reference: https://localhost:5001/scalar
|
|
520
|
+
|
|
521
|
+
================================================================================
|
|
522
|
+
```
|
|
523
|
+
|
|
524
|
+
---
|
|
525
|
+
|
|
526
|
+
## MODES
|
|
527
|
+
|
|
528
|
+
| Commande | Action |
|
|
529
|
+
|----------|--------|
|
|
530
|
+
| `smartstack init {name}` | Creer projet avec wizard interactif |
|
|
531
|
+
| `smartstack init {name} --full-stack` | Full stack (defaut) |
|
|
532
|
+
| `smartstack init {name} --backend` | Backend .NET uniquement |
|
|
533
|
+
| `smartstack init {name} --frontend` | Frontend React uniquement |
|
|
534
|
+
| `smartstack init {name} --db sqlserver` | Specifier la DB |
|
|
535
|
+
| `smartstack init {name} --dry-run` | Simulation |
|
|
536
|
+
| `smartstack init {name} --skip-mcp-check` | Ignorer verification MCP |
|
|
537
|
+
|
|
538
|
+
---
|
|
539
|
+
|
|
540
|
+
## MCP SERVERS
|
|
541
|
+
|
|
542
|
+
Les projets SmartStack utilisent les serveurs MCP pour ameliorer l'experience de developpement:
|
|
543
|
+
|
|
544
|
+
### SmartStack MCP
|
|
545
|
+
|
|
546
|
+
Fournit:
|
|
547
|
+
- `validate_conventions` - Valide les conventions SQL, migrations, services, namespaces
|
|
548
|
+
- `check_migrations` - Analyse les conflits EF Core entre branches
|
|
549
|
+
- `scaffold_extension` - Genere du code (services, entites, controllers, components)
|
|
550
|
+
- `api_docs` - Documentation API Swagger/OpenAPI
|
|
551
|
+
|
|
552
|
+
### Context7 MCP
|
|
553
|
+
|
|
554
|
+
Fournit:
|
|
555
|
+
- `resolve-library-id` - Trouve l'ID Context7 d'une bibliotheque
|
|
556
|
+
- `query-docs` - Recupere la documentation et exemples de code a jour
|
|
557
|
+
|
|
558
|
+
**Installation:**
|
|
559
|
+
```bash
|
|
560
|
+
# SmartStack MCP
|
|
561
|
+
claude mcp add smartstack
|
|
562
|
+
|
|
563
|
+
# Context7 MCP (remplacez YOUR_API_KEY par votre cle)
|
|
564
|
+
claude mcp add context7 -- npx @upstash/context7-mcp -- --api-key YOUR_API_KEY
|
|
565
|
+
```
|
|
566
|
+
|
|
567
|
+
> **Note:** Obtenez votre cle API Context7 gratuite sur [context7.io](https://context7.io)
|