Update der Dokumentation

This commit is contained in:
Tim Krampitz
2026-08-08 12:50:15 +02:00
parent bbc6ad6080
commit 118a62a804
15 changed files with 460 additions and 139 deletions

View File

@@ -1,8 +1,14 @@
---
type: Reference
title: Source Code Map & Navigation Directory
description: Practical navigation guide mapping source files across projects to system domains and responsibilities.
tags: [source-map, navigation, directory, projects]
description: Practical navigation guide mapping source files across projects to system domains, viewmodels, services, and responsibilities.
tags: [source-map, navigation, directory, projects, maui, mvvm]
openwiki:
roles: [repository]
change_kinds: [public-api]
source_paths: [SlipItIn/MauiProgram.cs, SlipItIn.Server/Program.cs, SlipItIn.AppHost/AppHost.cs]
symbols: [MauiProgram, Program, AppHost]
validation_commands: ["dotnet build SlipItIn.slnx"]
---
# Source Code Map & Navigation Directory
@@ -19,9 +25,9 @@ This navigation map [indexes backend architecture files described in](/openwiki/
SlipItIn.slnx
├── SlipItIn.AppHost/ # Aspire distributed orchestrator
├── SlipItIn.Server/ # Web API & SignalR real-time server
├── SlipItIn.Shared/ # Shared models & data transfer objects
├── SlipItIn.Shared/ # Shared models, DTOs & enums
├── SlipItIn.ServiceDefaults/ # Aspire OpenTelemetry & health checks
├── SlipItIn/ # .NET MAUI multi-platform client
├── SlipItIn/ # .NET MAUI multi-platform client (MVVM)
└── Agents/ # Architecture & planning briefs
```
@@ -41,7 +47,7 @@ SlipItIn.slnx
- **`Controllers/AuthController.cs`**: REST API controller providing `/api/auth/register`, `/api/auth/login`, and `/api/auth/me`. Handles BCrypt password hashing and JWT token generation.
- **`Hubs/GameHub.cs`**: SignalR hub mapped to `/hubs/game`. Performs JWT claim extraction (`GetAuthenticatedUserId`), player/host authorization checks (`ValidatePlayerAccessAsync`, `ValidateHostAccessAsync`), connection ID tracking, and real-time event broadcasting.
- **`Services/IGameService.cs`**: Contract interface defining backend game operations.
- **`Services/GameService.cs`**: Core engine implementation. Handles game creation, player joining, card dealing from active phrases, slip submission, challenge creation, penalty resolution, and state serialization (`GetGameStateAsync`, `GetPlayerHandAsync`).
- **`Services/GameService.cs`**: Core engine implementation. Handles game creation, player joining, card dealing from active phrases, slip submission, challenge creation, penalty resolution, and state serialization (`GetGameStateAsync`, `GetPlayerHandAsync`). Adds `hostPlayer` directly to `game.Players` before `context.Games.Add(game)` for EF Core navigation safety.
- **`Data/SlipItInDbContext.cs`**: Entity Framework Core DbContext mapping `Users`, `Games`, `Players`, `Phrases`, `PlayerCards`, `GameRounds`, and `SlipChallenges` to PostgreSQL tables.
- **`Migrations/`**: Auto-generated EF Core migration snapshots (`20260723193505_InitialCreate.cs`).
- **`appsettings.json` & `appsettings.Development.json`**: JWT secret keys, issuer/audience defaults, and database connection strings.
@@ -58,12 +64,35 @@ SlipItIn.slnx
- **`DTOs/GameStateDto.cs`**: DTOs for public state (`GameStateDto`, `PlayerInfoDto`), private hand state (`PlayerHandDto`, `PlayerCardDto`), and challenge alerts (`SlipChallengeDto`).
### `Cross-Platform MAUI Client` (`SlipItIn`)
- **`MauiProgram.cs`**: Client builder configuring MAUI app shell, fonts, and logging debug extensions.
- **`MauiProgram.cs`**: Client app builder. Configures dependency injection for ViewModels and Services, fonts, debug logging, and sets up `ServiceHelper.Services`.
- **`App.xaml` & `App.xaml.cs`**: Root MAUI application class.
- **`AppShell.xaml` & `AppShell.xaml.cs`**: AppShell routing container.
- **`MainPage.xaml` & `MainPage.xaml.cs`**: Initial entry view.
- **`AppShell.xaml` & `AppShell.xaml.cs`**: Shell navigation container routing between `LoginPage`, `RegisterPage`, `LobbyPage`, and `GameBoardPage`.
- **`Infrastructure/ServiceHelper.cs`**: Static service locator bridge for runtime DI resolution.
- **`Services/`**:
- `SignalRService.cs` (`ISignalRService`): WebSocket SignalR client, hub method invoker, and auto-reconnect engine.
- `GameStateService.cs` (`IGameStateService`): Central game state holder, messenger bridge (`WeakReferenceMessenger`), and offline action queue manager.
- `LocalStorageService.cs` (`ILocalStorageService`): Dual-layer local persistence (`SecureStorage` for tokens, `Preferences` for game state/offline queue).
- `AuthSessionService.cs` (`IAuthSessionService`): Authenticated user session state manager.
- `ApiService.cs` (`IApiService`): REST HTTP client for authentication endpoints.
- `AppConfigurationService.cs` (`IAppConfigurationService`): Configuration provider for API base URL and SignalR Hub URL.
- **`ViewModels/`**:
- `BaseViewModel.cs`: Abstract base ViewModel providing `IsBusy`, `StatusMessage`, and error handling helper `RunSafeAsync`.
- `LoginViewModel.cs`: Handles email/password authentication and navigation to `LobbyPage`.
- `RegisterViewModel.cs`: Handles user registration.
- `LobbyViewModel.cs`: Manages lobby creation, joining, player readiness, and game start. Implements `IRecipient` interfaces for real-time messages.
- `GameBoardViewModel.cs`: Manages game board state, player cards, slip submission, challenging, challenge resolution, and offline queueing.
- **`Views/`**:
- `LoginPage.xaml` / `.cs`: XAML login UI view.
- `RegisterPage.xaml` / `.cs`: XAML registration UI view.
- `LobbyPage.xaml` / `.cs`: XAML lobby UI view displaying lobby code and player list.
- `GameBoardPage.xaml` / `.cs`: XAML game board UI view displaying cards and player list.
- `ChallengeNotificationOverlay.xaml` / `.cs`: Reusable overlay view for challenge alerts.
- **`Messages/`**:
- `LobbyCreatedMessage.cs`, `GameStateChangedMessage.cs`, `GameStartedMessage.cs`, `PlayerHandChangedMessage.cs`, `ChallengeReceivedMessage.cs`, `ErrorOccurredMessage.cs`, `ConnectionStateChangedMessage.cs`: Strongly-typed `CommunityToolkit.Mvvm.Messaging` payloads.
- **`Models/`**:
- `QueuedGameAction.cs`: Data model for offline game action queueing.
- **`Platforms/`**: Platform-specific entry points for Android, iOS, MacCatalyst, and Windows.
### `Documentation & Specifications` (`Agents/`)
- **`Agents/Architecture.md`**: Specification document defining Phase 2b backend security (JWT validation, `IDbContextFactory`, privacy DTOs) and Phase 3b MAUI stability patterns (`WeakReferenceMessenger`, auto-reconnect, dual-layer storage).
- **`Agents/ProjectPlan.md`**: Project plan breakdown covering phases 1 through 4.
- **`Agents/Architecture.md`**: Specification document defining backend security and client MVVM/stability patterns.
- **`Agents/ProjectPlan.md`**: Project plan breakdown covering development phases.