siesa-agents 2.1.25 → 2.1.26-dev.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/README.md +8 -0
- package/bin/install.js +5 -1
- package/bmad-core/agents/analyst.md +1 -1
- package/bmad-core/agents/architect.md +22 -2
- package/bmad-core/agents/backend-agent.md +74 -86
- package/bmad-core/agents/bmad-master.md +2 -2
- package/bmad-core/agents/bmad-orchestrator.md +2 -2
- package/bmad-core/agents/dev.md +1 -1
- package/bmad-core/agents/frontend-agent.md +4 -4
- package/bmad-core/agents/pm.md +4 -1
- package/bmad-core/agents/po.md +4 -1
- package/bmad-core/agents/qa.md +1 -1
- package/bmad-core/agents/sm.md +1 -1
- package/bmad-core/agents/ux-expert.md +1 -1
- package/bmad-core/checklists/architect-checklist.md +2 -0
- package/bmad-core/checklists/backend-checklist.md +10 -6
- package/bmad-core/data/architecture-patterns.md +279 -125
- package/bmad-core/data/backend-standards.md +718 -278
- package/bmad-core/data/bmad-kb.md +1 -1
- package/bmad-core/data/frontend-standards.md +1 -1
- package/bmad-core/data/technical-preferences-ux.md +1 -1
- package/bmad-core/data/technical-preferences.md +106 -1
- package/bmad-core/data/technology-stack.md +155 -1
- package/bmad-core/tasks/apply-qa-fixes.md +4 -4
- package/bmad-core/tasks/create-doc.md +59 -0
- package/bmad-core/tasks/create-entity.md +3 -3
- package/bmad-core/tasks/create-next-story.md +1 -1
- package/bmad-core/tasks/create-service.md +3 -3
- package/bmad-core/tasks/nfr-assess.md +3 -3
- package/bmad-core/tasks/qa-gate.md +2 -2
- package/bmad-core/tasks/review-story.md +1 -1
- package/bmad-core/tasks/scaffold-backend.md +13 -9
- package/bmad-core/tasks/scaffold-frontend.md +2 -2
- package/bmad-core/templates/architecture-tmpl.yaml +2 -2
- package/bmad-core/templates/front-end-architecture-tmpl.yaml +1 -1
- package/bmad-core/templates/story-tmpl.yaml +1 -1
- package/bmad-core/user-guide.md +1 -1
- package/claude/commands/BMad/agents/analyst.md +1 -1
- package/claude/commands/BMad/agents/architect.md +21 -1
- package/claude/commands/BMad/agents/backend.md +86 -99
- package/claude/commands/BMad/agents/bmad-master.md +2 -2
- package/claude/commands/BMad/agents/bmad-orchestrator.md +2 -2
- package/claude/commands/BMad/agents/dev.md +1 -1
- package/claude/commands/BMad/agents/frontend.md +4 -4
- package/claude/commands/BMad/agents/pm.md +4 -1
- package/claude/commands/BMad/agents/po.md +4 -1
- package/claude/commands/BMad/agents/qa.md +1 -1
- package/claude/commands/BMad/agents/sm.md +1 -1
- package/claude/commands/BMad/agents/ux-expert.md +1 -1
- package/claude/commands/BMad/tasks/apply-qa-fixes.md +4 -4
- package/claude/commands/BMad/tasks/create-doc.md +48 -0
- package/claude/commands/BMad/tasks/create-next-story.md +1 -1
- package/claude/commands/BMad/tasks/nfr-assess.md +3 -3
- package/claude/commands/BMad/tasks/qa-gate.md +2 -2
- package/claude/commands/BMad/tasks/review-story.md +1 -1
- package/claude/hooks/file-restriction-hook.py +51 -0
- package/claude/hooks/track-agent.py +67 -0
- package/claude/settings.local.json +55 -2
- package/github/chatmodes/architect.chatmode.md +7 -1
- package/github/chatmodes/backend.chatmode.md +133 -109
- package/github/chatmodes/dev.chatmode.md +12 -4
- package/github/chatmodes/frontend.chatmode.md +3 -3
- package/github/chatmodes/qa.chatmode.md +9 -3
- package/kiro/steering/agent-detection.md +16 -16
- package/package.json +1 -1
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
### Folder Structure
|
|
9
9
|
|
|
10
|
-
Next.js
|
|
10
|
+
Next.js 16 App Router Structure with Clean Architecture + DDD:
|
|
11
11
|
|
|
12
12
|
```
|
|
13
13
|
├── app/ # Next.js App Router directory
|
|
@@ -107,7 +107,7 @@ Use MCP to install Shadcn components instead of creating manually.
|
|
|
107
107
|
|
|
108
108
|
### Framework Selection Rules
|
|
109
109
|
|
|
110
|
-
**Default**: Always use Next.js
|
|
110
|
+
**Default**: Always use Next.js 16 with App Router unless explicitly told otherwise.
|
|
111
111
|
|
|
112
112
|
**Exceptions**: Only use pure React + Vite when user specifically mentions offline-first functionality or requests non-Next.js setup.
|
|
113
113
|
|
|
@@ -116,146 +116,300 @@ Use MCP to install Shadcn components instead of creating manually.
|
|
|
116
116
|
## Backend Architecture
|
|
117
117
|
|
|
118
118
|
### Architecture Style
|
|
119
|
-
- **
|
|
119
|
+
- **Clean Architecture** + **Domain-Driven Design (DDD)** + **Microservices**
|
|
120
|
+
|
|
121
|
+
### Technology Stack
|
|
122
|
+
- **.NET 10** with **C# Minimal API**
|
|
123
|
+
- **Entity Framework Core** with **PostgreSQL**
|
|
124
|
+
- **UUID (Guid)** primary keys mandatory
|
|
125
|
+
- **linq2db**, **DynamicLinq**, **LinqKit** for advanced queries
|
|
126
|
+
- **FluentValidation** for validation
|
|
127
|
+
- **xUnit** for testing
|
|
128
|
+
- **Scalar** for API documentation (NO Swagger)
|
|
129
|
+
- **QuestPDF** for PDF generation
|
|
120
130
|
|
|
121
131
|
### Folder Structure
|
|
122
132
|
|
|
123
|
-
|
|
133
|
+
.NET Solution Structure with Clean Architecture + DDD + Microservices:
|
|
124
134
|
|
|
125
135
|
```
|
|
126
|
-
├──
|
|
127
|
-
│ ├──
|
|
128
|
-
│ │ ├──
|
|
129
|
-
│ │ │ ├──
|
|
130
|
-
│ │ │ │ ├──
|
|
131
|
-
│ │ │ │
|
|
132
|
-
│ │ │ │
|
|
133
|
-
│ │ │ │ │
|
|
134
|
-
│ │ │ │ │
|
|
135
|
-
│ │ │ │
|
|
136
|
-
│ │ │ │
|
|
137
|
-
│ │ │ │
|
|
138
|
-
│ │ │ │
|
|
139
|
-
│ │ │
|
|
140
|
-
│ │ │ │
|
|
141
|
-
│ │ │ │ │
|
|
142
|
-
│ │ │ │ │ │ ├──
|
|
143
|
-
│ │ │ │ │ │
|
|
144
|
-
│ │ │ │ │
|
|
145
|
-
│ │ │ │ │
|
|
146
|
-
│ │ │ │ │
|
|
147
|
-
│ │ │ │ │
|
|
148
|
-
│ │ │ │ │
|
|
149
|
-
│ │ │ │
|
|
150
|
-
│ │ │
|
|
151
|
-
│ │ │ │
|
|
152
|
-
│ │ │ │
|
|
153
|
-
│ │ │ │
|
|
154
|
-
│ │ │ │
|
|
155
|
-
│ │ │ ├──
|
|
156
|
-
│ │ │ ├──
|
|
157
|
-
│ │ │
|
|
158
|
-
│ │
|
|
159
|
-
│ │ ├──
|
|
160
|
-
│ │ │ ├──
|
|
161
|
-
│ │ │ └──
|
|
162
|
-
│ │
|
|
136
|
+
├── src/
|
|
137
|
+
│ ├── Services/ # Microservices
|
|
138
|
+
│ │ ├── Sales/ # Sales domain microservice
|
|
139
|
+
│ │ │ ├── Sales.API/ # Minimal API project
|
|
140
|
+
│ │ │ │ ├── Program.cs # Application entry point
|
|
141
|
+
│ │ │ │ ├── appsettings.json
|
|
142
|
+
│ │ │ │ ├── Endpoints/ # Minimal API endpoints
|
|
143
|
+
│ │ │ │ │ ├── UserEndpoints.cs
|
|
144
|
+
│ │ │ │ │ └── QuoteEndpoints.cs
|
|
145
|
+
│ │ │ │ ├── Filters/
|
|
146
|
+
│ │ │ │ ├── Middleware/
|
|
147
|
+
│ │ │ │ └── Sales.API.csproj
|
|
148
|
+
│ │ │ │
|
|
149
|
+
│ │ │ ├── Sales.Application/ # Application layer
|
|
150
|
+
│ │ │ │ ├── Quotes/ # Bounded context
|
|
151
|
+
│ │ │ │ │ ├── Commands/
|
|
152
|
+
│ │ │ │ │ │ ├── CreateQuoteCommand.cs
|
|
153
|
+
│ │ │ │ │ │ └── CreateQuoteCommandHandler.cs
|
|
154
|
+
│ │ │ │ │ ├── Queries/
|
|
155
|
+
│ │ │ │ │ │ ├── GetQuoteByIdQuery.cs
|
|
156
|
+
│ │ │ │ │ │ └── GetQuoteByIdQueryHandler.cs
|
|
157
|
+
│ │ │ │ │ ├── DTOs/
|
|
158
|
+
│ │ │ │ │ │ └── QuoteResponseDto.cs
|
|
159
|
+
│ │ │ │ │ ├── Validators/ # FluentValidation
|
|
160
|
+
│ │ │ │ │ │ └── CreateQuoteCommandValidator.cs
|
|
161
|
+
│ │ │ │ │ └── Interfaces/ # Repository interfaces
|
|
162
|
+
│ │ │ │ │ └── IQuoteRepository.cs
|
|
163
|
+
│ │ │ │ └── Sales.Application.csproj
|
|
164
|
+
│ │ │ │
|
|
165
|
+
│ │ │ ├── Sales.Domain/ # Domain layer
|
|
166
|
+
│ │ │ │ ├── Quotes/ # Bounded context
|
|
167
|
+
│ │ │ │ │ ├── Entities/
|
|
168
|
+
│ │ │ │ │ │ └── QuoteEntity.cs
|
|
169
|
+
│ │ │ │ │ ├── ValueObjects/
|
|
170
|
+
│ │ │ │ │ │ ├── QuoteNumber.cs
|
|
171
|
+
│ │ │ │ │ │ └── Money.cs
|
|
172
|
+
│ │ │ │ │ ├── Aggregates/
|
|
173
|
+
│ │ │ │ │ │ └── QuoteAggregate.cs
|
|
174
|
+
│ │ │ │ │ ├── Events/
|
|
175
|
+
│ │ │ │ │ │ └── QuoteCreatedEvent.cs
|
|
176
|
+
│ │ │ │ │ └── Services/ # Domain services
|
|
177
|
+
│ │ │ │ │ └── QuotePricingService.cs
|
|
178
|
+
│ │ │ │ └── Sales.Domain.csproj
|
|
179
|
+
│ │ │ │
|
|
180
|
+
│ │ │ └── Sales.Infrastructure/ # Infrastructure layer
|
|
181
|
+
│ │ │ ├── Data/
|
|
182
|
+
│ │ │ │ ├── ApplicationDbContext.cs
|
|
183
|
+
│ │ │ │ ├── Configurations/ # EF Core configurations
|
|
184
|
+
│ │ │ │ │ ├── QuoteConfiguration.cs
|
|
185
|
+
│ │ │ │ │ └── UserConfiguration.cs
|
|
186
|
+
│ │ │ │ └── Migrations/ # EF Core migrations
|
|
187
|
+
│ │ │ ├── Repositories/ # Repository implementations
|
|
188
|
+
│ │ │ │ └── QuoteRepository.cs
|
|
189
|
+
│ │ │ ├── Services/ # External service adapters
|
|
190
|
+
│ │ │ │ └── EmailService.cs
|
|
191
|
+
│ │ │ └── Sales.Infrastructure.csproj
|
|
192
|
+
│ │ │
|
|
193
|
+
│ │ ├── Inventory/ # Inventory microservice (independent DB)
|
|
194
|
+
│ │ │ ├── Inventory.API/
|
|
195
|
+
│ │ │ ├── Inventory.Application/
|
|
196
|
+
│ │ │ ├── Inventory.Domain/
|
|
197
|
+
│ │ │ └── Inventory.Infrastructure/
|
|
198
|
+
│ │ │ └── Data/ # Separate PostgreSQL DB
|
|
199
|
+
│ │ │ └── InventoryDbContext.cs
|
|
200
|
+
│ │ │
|
|
201
|
+
│ │ └── Users/ # Users microservice (independent DB)
|
|
202
|
+
│ │ ├── Users.API/
|
|
203
|
+
│ │ ├── Users.Application/
|
|
204
|
+
│ │ ├── Users.Domain/
|
|
205
|
+
│ │ └── Users.Infrastructure/
|
|
206
|
+
│ │ └── Data/ # Separate PostgreSQL DB
|
|
207
|
+
│ │ └── UsersDbContext.cs
|
|
163
208
|
│ │
|
|
164
|
-
│
|
|
165
|
-
│
|
|
209
|
+
│ └── Shared/ # Shared libraries
|
|
210
|
+
│ ├── Shared.Domain/ # Shared domain concepts
|
|
211
|
+
│ │ ├── Base/
|
|
212
|
+
│ │ │ ├── AggregateRoot.cs
|
|
213
|
+
│ │ │ ├── Entity.cs
|
|
214
|
+
│ │ │ ├── ValueObject.cs
|
|
215
|
+
│ │ │ └── DomainEvent.cs
|
|
216
|
+
│ │ ├── Interfaces/
|
|
217
|
+
│ │ │ ├── IRepository.cs
|
|
218
|
+
│ │ │ └── IUnitOfWork.cs
|
|
219
|
+
│ │ └── Shared.Domain.csproj
|
|
220
|
+
│ │
|
|
221
|
+
│ ├── Shared.Infrastructure/ # Shared infrastructure
|
|
222
|
+
│ │ ├── Data/
|
|
223
|
+
│ │ │ ├── BaseRepository.cs
|
|
224
|
+
│ │ │ └── UnitOfWork.cs
|
|
225
|
+
│ │ ├── Filters/
|
|
226
|
+
│ │ │ └── ValidationFilter.cs
|
|
227
|
+
│ │ ├── Middleware/
|
|
228
|
+
│ │ │ ├── ExceptionHandlingMiddleware.cs
|
|
229
|
+
│ │ │ └── LoggingMiddleware.cs
|
|
230
|
+
│ │ └── Shared.Infrastructure.csproj
|
|
231
|
+
│ │
|
|
232
|
+
│ └── Shared.Common/ # Common utilities
|
|
233
|
+
│ ├── Extensions/
|
|
234
|
+
│ │ ├── StringExtensions.cs
|
|
235
|
+
│ │ └── GuidExtensions.cs
|
|
236
|
+
│ ├── Helpers/
|
|
237
|
+
│ │ └── DateTimeHelper.cs
|
|
238
|
+
│ ├── Constants/
|
|
239
|
+
│ │ └── ErrorMessages.cs
|
|
240
|
+
│ └── Shared.Common.csproj
|
|
166
241
|
│
|
|
167
|
-
├──
|
|
168
|
-
│ ├──
|
|
169
|
-
│ │ ├──
|
|
170
|
-
│ │
|
|
171
|
-
│ │
|
|
172
|
-
│
|
|
173
|
-
│ │
|
|
174
|
-
│ │
|
|
175
|
-
│ │
|
|
176
|
-
│
|
|
177
|
-
│
|
|
178
|
-
│
|
|
179
|
-
|
|
180
|
-
│
|
|
181
|
-
│
|
|
182
|
-
│
|
|
183
|
-
│
|
|
184
|
-
│
|
|
185
|
-
│ │ │ │ └── domain-event.ts
|
|
186
|
-
│ │ │ ├── interfaces/
|
|
187
|
-
│ │ │ └── exceptions/
|
|
188
|
-
│ │ └── package.json
|
|
189
|
-
│ │
|
|
190
|
-
│ └── database/ # Shared database utilities
|
|
191
|
-
│ ├── src/
|
|
192
|
-
│ │ ├── base-repository.ts
|
|
193
|
-
│ │ ├── transaction.decorator.ts
|
|
194
|
-
│ │ └── prisma.service.ts
|
|
195
|
-
│ └── package.json
|
|
242
|
+
├── tests/ # Test projects
|
|
243
|
+
│ ├── Sales.UnitTests/
|
|
244
|
+
│ │ ├── Domain/
|
|
245
|
+
│ │ ├── Application/
|
|
246
|
+
│ │ └── Sales.UnitTests.csproj
|
|
247
|
+
│ ├── Sales.IntegrationTests/
|
|
248
|
+
│ │ ├── Repositories/
|
|
249
|
+
│ │ ├── API/
|
|
250
|
+
│ │ └── Sales.IntegrationTests.csproj
|
|
251
|
+
│ ├── Inventory.UnitTests/
|
|
252
|
+
│ └── Users.UnitTests/
|
|
253
|
+
│
|
|
254
|
+
├── docker/ # Docker configurations (Production only)
|
|
255
|
+
│ ├── docker-compose.yml
|
|
256
|
+
│ └── Dockerfiles/
|
|
257
|
+
│ ├── Sales.Dockerfile
|
|
258
|
+
│ ├── Inventory.Dockerfile
|
|
259
|
+
│ └── Users.Dockerfile
|
|
196
260
|
│
|
|
197
|
-
|
|
198
|
-
├── nx.json # Nx workspace configuration
|
|
199
|
-
├── package.json # Root package.json
|
|
200
|
-
└── tsconfig.base.json # Base TypeScript config
|
|
261
|
+
└── YourSolution.sln # Solution file
|
|
201
262
|
```
|
|
202
263
|
|
|
203
|
-
###
|
|
264
|
+
### Microservices Communication Patterns
|
|
265
|
+
|
|
266
|
+
#### 1. Synchronous Communication (REST)
|
|
267
|
+
```csharp
|
|
268
|
+
// HTTP client for inter-service communication
|
|
269
|
+
public class InventoryServiceClient
|
|
270
|
+
{
|
|
271
|
+
private readonly HttpClient _httpClient;
|
|
272
|
+
|
|
273
|
+
public InventoryServiceClient(HttpClient httpClient)
|
|
274
|
+
{
|
|
275
|
+
_httpClient = httpClient;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
public async Task<ProductAvailabilityDto> CheckProductAvailabilityAsync(
|
|
279
|
+
Guid productId,
|
|
280
|
+
CancellationToken cancellationToken)
|
|
281
|
+
{
|
|
282
|
+
var response = await _httpClient.GetAsync(
|
|
283
|
+
$"/api/products/{productId}/availability",
|
|
284
|
+
cancellationToken);
|
|
285
|
+
response.EnsureSuccessStatusCode();
|
|
286
|
+
return await response.Content.ReadFromJsonAsync<ProductAvailabilityDto>(cancellationToken);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
```
|
|
204
290
|
|
|
205
|
-
####
|
|
206
|
-
|
|
207
|
-
-
|
|
208
|
-
-
|
|
209
|
-
- **Infrastructure Layer**: Adapters implementing ports (Prisma repos, HTTP clients, message publishers)
|
|
210
|
-
- **API Layer**: Primary adapters exposing application via REST/GraphQL (controllers, resolvers)
|
|
291
|
+
#### 2. Asynchronous Communication (Message Broker)
|
|
292
|
+
- **RabbitMQ** or **Azure Service Bus** for event-driven architecture
|
|
293
|
+
- Each microservice publishes domain events
|
|
294
|
+
- Other services subscribe to relevant events
|
|
211
295
|
|
|
212
|
-
####
|
|
213
|
-
|
|
214
|
-
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
#### Dependency Rules
|
|
221
|
-
- Domain layer has zero dependencies on frameworks or external libraries
|
|
222
|
-
- All dependencies point inward toward the domain core
|
|
223
|
-
- Use dependency inversion for all external concerns (databases, APIs, messaging)
|
|
224
|
-
- Interfaces defined in application layer, implementations in infrastructure layer
|
|
225
|
-
|
|
226
|
-
#### Microservices Independence
|
|
227
|
-
- Each microservice has its own database (no shared databases)
|
|
228
|
-
- Shared code through libraries only (common, domain-core, database)
|
|
229
|
-
- Independent deployment pipelines per service
|
|
230
|
-
- Service-to-service communication via events (async messaging)
|
|
296
|
+
#### 3. gRPC for High-Performance Communication
|
|
297
|
+
- Use for internal high-throughput service-to-service calls
|
|
298
|
+
- Protocol Buffers for efficient serialization
|
|
299
|
+
|
|
300
|
+
### Database per Microservice Pattern
|
|
301
|
+
|
|
302
|
+
**Key Principles:**
|
|
303
|
+
- Each microservice has its own PostgreSQL database
|
|
231
304
|
- No direct database access between services
|
|
305
|
+
- Data consistency via eventual consistency and sagas
|
|
306
|
+
- Each database uses UUID (Guid) primary keys
|
|
307
|
+
|
|
308
|
+
**Connection String Pattern:**
|
|
309
|
+
```json
|
|
310
|
+
{
|
|
311
|
+
"ConnectionStrings": {
|
|
312
|
+
"SalesDb": "Host=localhost;Database=sales_db;Username=admin;Password=***",
|
|
313
|
+
"InventoryDb": "Host=localhost;Database=inventory_db;Username=admin;Password=***",
|
|
314
|
+
"UsersDb": "Host=localhost;Database=users_db;Username=admin;Password=***"
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
```
|
|
232
318
|
|
|
233
|
-
|
|
234
|
-
- Unit tests for domain entities, value objects, and use cases
|
|
235
|
-
- Integration tests for repository implementations
|
|
236
|
-
- E2E tests for complete API workflows
|
|
237
|
-
- TDD approach: write tests before implementation
|
|
238
|
-
|
|
239
|
-
#### Type Safety & Validation
|
|
240
|
-
- Leverage TypeScript strict mode for compile-time safety
|
|
241
|
-
- Domain validation in value objects and entities
|
|
242
|
-
- DTO validation at API boundaries with class-validator
|
|
243
|
-
- No `any` types allowed
|
|
244
|
-
|
|
245
|
-
#### Security by Design
|
|
246
|
-
- Authentication and authorization at every layer
|
|
247
|
-
- Input validation on all endpoints
|
|
248
|
-
- OWASP Top 10 compliance
|
|
249
|
-
- Audit logging for critical operations
|
|
319
|
+
### Core Backend Principles
|
|
250
320
|
|
|
251
|
-
|
|
321
|
+
#### Clean Architecture Layers
|
|
322
|
+
1. **Domain Layer** - Business entities, value objects, domain services (no dependencies)
|
|
323
|
+
2. **Application Layer** - Commands, queries, validators, interfaces (depends on Domain)
|
|
324
|
+
3. **Infrastructure Layer** - EF Core, repositories, external services (depends on Application)
|
|
325
|
+
4. **Presentation Layer** - Minimal API endpoints (depends on Application)
|
|
252
326
|
|
|
253
|
-
|
|
327
|
+
#### UUID Primary Keys
|
|
328
|
+
```csharp
|
|
329
|
+
public abstract class Entity
|
|
330
|
+
{
|
|
331
|
+
public Guid Id { get; protected set; } = Guid.NewGuid();
|
|
332
|
+
}
|
|
333
|
+
```
|
|
254
334
|
|
|
255
|
-
|
|
335
|
+
#### Entity Framework Core Configuration
|
|
336
|
+
```csharp
|
|
337
|
+
public class QuoteConfiguration : IEntityTypeConfiguration<QuoteEntity>
|
|
338
|
+
{
|
|
339
|
+
public void Configure(EntityTypeBuilder<QuoteEntity> builder)
|
|
340
|
+
{
|
|
341
|
+
builder.ToTable("Quotes");
|
|
342
|
+
builder.HasKey(q => q.Id);
|
|
343
|
+
|
|
344
|
+
builder.Property(q => q.Id)
|
|
345
|
+
.HasColumnType("uuid")
|
|
346
|
+
.IsRequired();
|
|
347
|
+
|
|
348
|
+
builder.OwnsOne(q => q.QuoteNumber, qn =>
|
|
349
|
+
{
|
|
350
|
+
qn.Property(n => n.Value)
|
|
351
|
+
.HasColumnName("QuoteNumber")
|
|
352
|
+
.HasMaxLength(50)
|
|
353
|
+
.IsRequired();
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
```
|
|
256
358
|
|
|
257
|
-
|
|
359
|
+
#### Test-Driven Development
|
|
360
|
+
- Write xUnit tests before or alongside implementation
|
|
361
|
+
- Use EF Core InMemory for fast unit tests
|
|
362
|
+
- Use PostgreSQL Test Containers for integration tests
|
|
363
|
+
- Mock external dependencies
|
|
364
|
+
|
|
365
|
+
#### FluentValidation Usage
|
|
366
|
+
```csharp
|
|
367
|
+
public class CreateQuoteCommandValidator : AbstractValidator<CreateQuoteCommand>
|
|
368
|
+
{
|
|
369
|
+
public CreateQuoteCommandValidator()
|
|
370
|
+
{
|
|
371
|
+
RuleFor(x => x.CustomerId)
|
|
372
|
+
.NotEmpty()
|
|
373
|
+
.WithMessage("Customer ID is required");
|
|
374
|
+
|
|
375
|
+
RuleFor(x => x.Items)
|
|
376
|
+
.NotEmpty()
|
|
377
|
+
.WithMessage("At least one item is required");
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
```
|
|
258
381
|
|
|
259
|
-
|
|
382
|
+
#### Scalar API Documentation
|
|
383
|
+
Register Scalar instead of Swagger in Program.cs:
|
|
384
|
+
```csharp
|
|
385
|
+
app.MapScalarApiReference(); // NOT app.UseSwagger()
|
|
386
|
+
```
|
|
260
387
|
|
|
261
|
-
|
|
388
|
+
## Summary
|
|
389
|
+
|
|
390
|
+
### Frontend
|
|
391
|
+
- **Framework**: Next.js 16 with TypeScript and App Router
|
|
392
|
+
- **Architecture**: Clean Architecture + DDD
|
|
393
|
+
- **State**: Zustand
|
|
394
|
+
- **UI**: shadcn/ui + Radix UI + TailwindCSS v4
|
|
395
|
+
- **Testing**: Vitest + React Testing Library
|
|
396
|
+
- **Validation**: Zod + React Hook Form
|
|
397
|
+
|
|
398
|
+
### Backend
|
|
399
|
+
- **Framework**: .NET 10 with C# Minimal API
|
|
400
|
+
- **Architecture**: Clean Architecture + DDD + Microservices
|
|
401
|
+
- **Database**: PostgreSQL (one per microservice)
|
|
402
|
+
- **ORM**: Entity Framework Core + linq2db + DynamicLinq + LinqKit
|
|
403
|
+
- **Validation**: FluentValidation
|
|
404
|
+
- **Testing**: xUnit + EF Core InMemory + PostgreSQL Test Containers
|
|
405
|
+
- **Documentation**: Scalar (NO Swagger)
|
|
406
|
+
- **Primary Keys**: UUID (Guid) mandatory
|
|
407
|
+
- **PDF Generation**: QuestPDF
|
|
408
|
+
|
|
409
|
+
### Key Principles
|
|
410
|
+
1. **Clean Architecture** - Strict layer separation in both frontend and backend
|
|
411
|
+
2. **Domain-Driven Design** - Business logic drives all decisions
|
|
412
|
+
3. **Test-Driven Development** - Tests before/alongside implementation
|
|
413
|
+
4. **Database per Microservice** - Complete isolation between services
|
|
414
|
+
5. **Type Safety** - TypeScript (frontend) and C# (backend) strong typing
|
|
415
|
+
6. **Docker for Production** - Local development without containers
|