3.2 KiB
3.2 KiB
RpgRoller
Fresh full-stack starter scaffold:
RpgRoller/: ASP.NET Core backend + static frontend output (wwwroot)RpgRoller/frontend/: TypeScript frontend sourceRpgRoller.Tests/: xUnit integration-heavy test projectRpgRoller.sln: solution used by local CI script
Code Organization
Backend:
RpgRoller/Program.cs: thin app bootstrap onlyRpgRoller/Hosting/: service registration + startup initializationRpgRoller/Api/: endpoint mapping modules, API-to-service request mapping, auth/session filter helpersRpgRoller/Services/: game workflows and service-layer command models (*Commandrecords)
Frontend:
RpgRoller/frontend/app.ts: orchestration entrypointRpgRoller/frontend/app/: split modules (dom,state,loaders,render,events,actions)RpgRoller/frontend/generated/: generated API client sourceRpgRoller/wwwroot/: compiled browser assets
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) - Runtime state is loaded once at startup into memory and written back to SQLite on successful state changes
Prerequisites
- .NET SDK 10.0+
- Node.js 22+ and npm
- PowerShell 7+
Local Development
- Run the local CI parity script:
pwsh ./scripts/ci-local.ps1 - Start the backend:
dotnet run --project RpgRoller/RpgRoller.csproj - 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 - TypeScript build output config:
tsconfig.frontend.json - API client generation + frontend compile:
npm run generate:api-client - Frontend lint checks:
npm run lint - Frontend format checks:
npm run format:check
Test and Coverage
- Tests:
dotnet test RpgRoller.Tests/RpgRoller.Tests.csproj --collect:"XPlat Code Coverage" --settings RpgRoller.Tests/coverlet.runsettings - Coverage gate:
pwsh ./scripts/check-coverage.ps1 -MinLineRate 0.90 -MinBranchRate 0.70 - Coverage collector scope:
RpgRoller.Tests/coverlet.runsettingsnow measures the full backend assembly (RpgRoller), not only service namespace files.
Implemented Backend Scope
- Auth: register, login, logout, current user context
- Session cookie:
HttpOnly,SameSite=Strict,Securewhen served over HTTPS - Rulesets: d6 and dnd5e validation rules
- Campaigns: create/list/read
- Characters: create/update/activate/current-campaign list
- Skills: create/update with ruleset-aware dice expression validation
- Rolls: public/private skill rolls with append-only campaign log
- State stream: SSE endpoint for campaign version updates
Implemented Frontend Scope
- TypeScript-driven UI for:
- registration, login, logout
- campaign creation and selection
- character creation and activation
- skill creation and editing
- public/private rolling and campaign log viewing
- SSE-backed live refresh for selected campaign state/log