Initial commit with inital CMS

This commit is contained in:
2026-06-15 17:00:16 +02:00
commit 95d986790e
132 changed files with 7624 additions and 0 deletions
@@ -0,0 +1,63 @@
# Orchestration Design — Unit 04: API Shell & Integration
Dit document beschrijft de technische implementatie van de module orkestratie.
## 1. ModuleOrchestrator
De orchestrator is verantwoordelijk voor de lifecycle van modules.
- **Discovery**:
- Gebruikt Reflection om alle typen in geladen assemblies te scannen.
- Filtert op klassen die `IModule` implementeren en niet abstract zijn.
- **Error Handling (Soft Fail)**:
- Bij het laden van een module wordt de aanroep van `RegisterServices` en `UseModule` omgeven door een `try-catch` blok.
- Fouten worden gelogd als `Error` naar de `ILogger`.
- De orkestratie gaat door naar de volgende module om de algehele beschikbaarheid te maximaliseren.
## 2. Route Conventions
De `/api/v1/` prefix wordt afgedwongen via een custom `IApplicationModelConvention`:
```csharp
public class ApiPrefixConvention : IApplicationModelConvention
{
public void Apply(ApplicationModel application)
{
foreach (var controller in application.Controllers)
{
foreach (var selector in controller.Selectors)
{
// Voeg prefix toe aan bestaande route
var routePrefix = new AttributeRouteModel(new RouteAttribute("api/v1"));
selector.AttributeRouteModel = selector.AttributeRouteModel != null
? AttributeRouteModel.CombineAttributeRouteModels(routePrefix, selector.AttributeRouteModel)
: routePrefix;
}
}
}
}
```
## 3. Swagger & Security Design
Swagger wordt geconfigureerd in `Program.cs`:
- **Groepering**: Gebruik van `DocInclusionPredicate` om controllers te taggen op basis van hun assembly prefix (bijv. `Availability`).
- **JWT Support**:
- `AddSecurityDefinition("Bearer", ...)`
- `AddSecurityRequirement(...)`
- **Pad**: Beschikbaar op `/swagger` via `app.UseSwaggerUI(c => c.RoutePrefix = "swagger")`.
## 4. CORS Global Configuration
De Shell leest de `CorsSettings` uit `appsettings.json` en configureert een globale policy:
```json
{
"CorsSettings": {
"AllowedOrigins": ["https://portal.slp-modular.local"],
"AllowAnyHeader": true,
"AllowAnyMethod": true
}
}
```