How martincostello/dotnet-minimal-api-integration-testing works
Main Components
a. Frontend Layer:
• Razor Pages (Pages directory)
• TypeScript Client (scripts/ts directory)
• Static Assets (wwwroot directory)
b. Backend Layer:
• Minimal API Endpoints (ApiEndpoints.cs, AuthenticationEndpoints.cs)
• Services Layer (Services directory)
• Data Access Layer (Data directory)
c. External Services:
• GitHub OAuth Authentication
• SQLite Database
Component Relationships
• Client Browser → Frontend Layer
• Frontend Layer → Backend API Layer
• Backend API Layer → Services Layer
• Services Layer → Data Access Layer
• Backend → GitHub OAuth
• Data Access Layer → SQLite Database
Specific Implementation Details
Technical components:
• EF Core context (TodoContext)
• Repository Pattern (ITodoRepository, TodoRepository)
• TypeScript Models (TodoItem.ts, TodoList.ts)
• API Models (CreateTodoItemModel, TodoItemModel)
Architecture Pattern Representation
Following patterns:
• Clean Architecture layers
• Repository Pattern
• Dependency Injection flow
• OAuth authentication flow
[Browser Client]
• ↓
[Frontend Layer]
• Razor Pages
• TypeScript Client
• Static Assets
• ↓
[Backend API Layer (Minimal APIs)]
• API Endpoints
• Authentication Endpoints
• ↓
[Services Layer]
• TodoService
• ↓
[Data Access Layer]
• TodoContext (EF Core)
• Repository Interface
• Repository Implementation
• ↓
[SQLite Database]
[GitHub OAuth]
• ↑
• [Authentication Flow]
• Blue: Frontend components
• Green: API layer
• Yellow: Service layer
• Orange: Data access layer
• Gray: External services
• Purple: Authentication flow
Additional Visualization Guidelines:
Testing infrastructure
• WebApplicationFactory
• Playwright UI testing
• HttpClient interception points
A separate view for the testing architecture
• Integration test setup
• UI test configuration
• Mock points for external services
Remember to maintain a balance between detail and clarity, focusing on the architectural decisions that make this project unique, such as the minimal API approach and the integration testing strategy.