This file provides guidance for AI coding assistants working on the Valour codebase.
Before making changes to core systems, review the documentation in the Docs/ directory:
Docs/ReactiveModelSystem.md- Explains the ClientModel, ModelStore, HybridEvent, and real-time update architecture. Essential reading before modifying:Valour/Sdk/ModelLogic/(ClientModel, ModelStore, ModelChange, etc.)Valour/Sdk/Nodes/Node.csValour/Shared/Utilities/HybridEvent.csValour/Server/Hubs/CoreHub.csValour/Server/Services/CoreHubService.cs
Valour/
├── Config/ # Configuration classes
├── Valour/
│ ├── Client/ # Blazor WASM client (deprecated, being migrated)
│ ├── Client.Blazor/ # New Blazor client
│ ├── Database/ # Entity Framework models and DbContext
│ ├── Sdk/ # Client SDK (models, services, SignalR client)
│ │ ├── ModelLogic/ # Reactive model system
│ │ ├── Models/ # Client-side model implementations
│ │ ├── Nodes/ # SignalR connection management
│ │ └── Services/ # Client-side services
│ ├── Server/ # ASP.NET Core server
│ │ ├── Api/ # REST API endpoints
│ │ ├── Cdn/ # CDN and file handling
│ │ ├── Hubs/ # SignalR hubs
│ │ └── Services/ # Server-side services
│ └── Shared/ # Shared code between client and server
│ ├── Cdn/ # CDN utilities
│ ├── Models/ # Shared model interfaces
│ └── Utilities/ # HybridEvent, etc.
└── Docs/ # Architecture documentation
Models sync in real-time via SignalR. See Docs/ReactiveModelSystem.md.
ModelStoreusesSyncLockfor all collection operations- Events are fired outside locks to prevent deadlocks
HybridEventuses double-checked locking for initialization
Valour supports multiple server nodes. Clients connect to specific nodes based on which planets they're accessing.
- Don't hold locks while firing events - Can cause deadlocks
- ModelStore is thread-safe - Don't add external locking
- HybridEvent async handlers are fire-and-forget - Don't rely on completion
- Don't store event data in async handlers - May be pooled/recycled
# Build everything
dotnet build
# Run server
cd Valour/Server && dotnet run
# Run tests
dotnet testWhen modifying core systems:
- Read relevant documentation in
Docs/ - Understand the threading model
- Maintain existing patterns
- Update documentation if you change architecture