Document startup hydration and write-through persistence

This commit is contained in:
2026-02-24 23:13:25 +01:00
parent 5c199b4468
commit 1d512d321b
3 changed files with 7 additions and 1 deletions

4
FAQ.md
View File

@@ -23,3 +23,7 @@ Backend state is persisted via EF Core + SQLite.
- Non-development default: `RpgRoller/App_Data/rpgroller.db`
To start with a clean backend state, stop the app and remove the corresponding SQLite file.
## Does the backend read SQLite on every API call?
No. The backend loads state from SQLite once during startup into in-memory state and serves requests from memory. Successful state mutations are then written back to SQLite.

View File

@@ -13,6 +13,7 @@ Backend state persistence:
- Development DB: `RpgRoller/App_Data/rpgroller.development.db`
- Default DB: `RpgRoller/App_Data/rpgroller.db`
- Database schema is created automatically on startup (`EnsureCreated`)
- Runtime state is loaded once at startup into memory and written back to SQLite on successful state changes
## Prerequisites

View File

@@ -6,7 +6,7 @@
- Backend/full-stack project: `RpgRoller` (Minimal API + static `wwwroot` frontend)
- Frontend source: `RpgRoller/frontend` (TypeScript)
- Test project: `RpgRoller.Tests` (xUnit + `WebApplicationFactory` integration tests)
- Persistence: EF Core + SQLite (`RpgRoller/Data/RpgRollerDbContext.cs`)
- Persistence: EF Core + SQLite (`RpgRoller/Data/RpgRollerDbContext.cs`) with in-memory runtime cache in `GameService`
- OpenAPI source: `openapi/RpgRoller.json`
- Generated client source: `RpgRoller/frontend/generated/api-client.ts`
- Generated client output: `RpgRoller/wwwroot/generated/api-client.js`
@@ -18,6 +18,7 @@
- ASP.NET Core Minimal API on .NET 10.
- EF Core with SQLite file persistence in current project (single-node deployment).
- Game state is hydrated once on startup and then served from in-memory state; writes are persisted back to SQLite after successful mutations.
- Cookie authentication (`HttpOnly`, `SameSite=Strict`, secure in production).
- A minimal frontend framework supporting mixing 3D graphics with 2D elements, or a modern framework-less alternative (HTMl/CSS/TypeScript).
- OpenAPI generated from backend and consumed by generated client.