From f212636febf0e4fac49683d5b8336228e89cb0a0 Mon Sep 17 00:00:00 2001 From: Frank Tovar Date: Tue, 24 Feb 2026 22:48:32 +0100 Subject: [PATCH] Document SQLite persistence and local reset behavior --- FAQ.md | 9 +++++++++ README.md | 9 +++++++++ TECH.md | 7 ++++--- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/FAQ.md b/FAQ.md index c2ac55b..5c5064d 100644 --- a/FAQ.md +++ b/FAQ.md @@ -14,3 +14,12 @@ This keeps the first commit small while preserving CI discipline. Additional too ## Is frontend JavaScript handwritten? No. Frontend source code lives in `RpgRoller/frontend/*.ts` and is compiled to `RpgRoller/wwwroot/*.js` for browser delivery. + +## Where is backend state stored locally? + +Backend state is persisted via EF Core + SQLite. + +- Development default: `RpgRoller/App_Data/rpgroller.development.db` +- Non-development default: `RpgRoller/App_Data/rpgroller.db` + +To start with a clean backend state, stop the app and remove the corresponding SQLite file. diff --git a/README.md b/README.md index 508dae4..0771dfb 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,13 @@ Fresh full-stack starter scaffold: - `RpgRoller.Tests/`: xUnit integration-heavy test project - `RpgRoller.sln`: solution used by local CI script +Backend state persistence: + +- EF Core with SQLite (`Microsoft.EntityFrameworkCore.Sqlite`) +- Development DB: `RpgRoller/App_Data/rpgroller.development.db` +- Default DB: `RpgRoller/App_Data/rpgroller.db` +- Database schema is created automatically on startup (`EnsureCreated`) + ## Prerequisites - .NET SDK 10.0+ @@ -25,6 +32,8 @@ Fresh full-stack starter scaffold: ``` 3. Open `http://localhost:5000` (or the port shown in the console). +To use a custom SQLite database path, set `ConnectionStrings__RpgRoller`. + ## Frontend Tooling - OpenAPI contract: `openapi/RpgRoller.json` diff --git a/TECH.md b/TECH.md index ad2c019..6d0fc87 100644 --- a/TECH.md +++ b/TECH.md @@ -6,6 +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`) - OpenAPI source: `openapi/RpgRoller.json` - Generated client source: `RpgRoller/frontend/generated/api-client.ts` - Generated client output: `RpgRoller/wwwroot/generated/api-client.js` @@ -16,11 +17,11 @@ ## 1) Stack and baseline choices - ASP.NET Core Minimal API on .NET 10. -- EF Core + Database in current project (single-node deployment). +- EF Core with SQLite file persistence in current project (single-node deployment). - 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. -- xUnit integration-heavy test suite with in-memory Database and coverage gates. +- xUnit integration-heavy test suite with isolated SQLite test databases and coverage gates. ## 2) Architecture patterns to keep @@ -78,7 +79,7 @@ This pattern is a strong baseline for low to medium scale and should be the defa ### 2.5 Data and invariants -- Strong DB models +- Strong DB models backed by SQLite - DB-level guardrails (trigger) to complement app-level checks - EF patterns: - `AsNoTracking()` for read-only queries