Remove legacy TypeScript frontend and npm pipeline
This commit is contained in:
38
TECH.md
38
TECH.md
@@ -3,20 +3,17 @@
|
||||
## 0) Current scaffold status
|
||||
|
||||
- Root solution: `RpgRoller.sln`
|
||||
- Backend/full-stack project: `RpgRoller` (Minimal API + static `wwwroot` frontend)
|
||||
- Frontend source: `RpgRoller/frontend` (TypeScript)
|
||||
- Frontend module split: `RpgRoller/frontend/app/*` (dom/state/loaders/render/events/actions)
|
||||
- Backend/full-stack project: `RpgRoller` (Minimal API + Blazor frontend host)
|
||||
- Frontend source: `RpgRoller/Components/*` + `RpgRoller/wwwroot/*`
|
||||
- Test project: `RpgRoller.Tests` (xUnit + `WebApplicationFactory` integration tests)
|
||||
- Test file split: concern-based API tests (`RpgRoller.Tests/Api/*`), service tests (`RpgRoller.Tests/Services/*`), and shared helpers (`RpgRoller.Tests/Support/*`)
|
||||
- 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`
|
||||
- Local CI parity entrypoint: `scripts/ci-local.ps1`
|
||||
- API endpoint modules: `RpgRoller/Api/*Endpoints.cs` + shared session/auth helpers
|
||||
- Service boundary model: API request DTOs are mapped to explicit service method parameters before workflow execution
|
||||
- Current backend features: auth/session, campaign/character/skill management, ruleset-aware rolls, filtered campaign logs, and SSE state updates.
|
||||
- Current frontend features: authenticated campaign workspace with live log updates and full roll workflow controls.
|
||||
- Current frontend features: Blazor-based authenticated campaign workspace with live log updates and full roll workflow controls.
|
||||
|
||||
## 1) Stack and baseline choices
|
||||
|
||||
@@ -24,8 +21,8 @@
|
||||
- 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.
|
||||
- Blazor frontend host with Razor components and minimal JS interop for browser APIs.
|
||||
- OpenAPI generated from backend as contract documentation.
|
||||
- xUnit integration-heavy test suite with isolated SQLite test databases and coverage gates.
|
||||
|
||||
## 2) Architecture patterns to keep
|
||||
@@ -94,22 +91,10 @@ This pattern is a strong baseline for low to medium scale and should be the defa
|
||||
|
||||
### 2.6 Frontend architecture
|
||||
|
||||
- modules split by concern:
|
||||
- API wrapper
|
||||
- Data loaders
|
||||
- UI composition
|
||||
- Feature-specific renderers/handlers
|
||||
- Shared utils and runtime dependency injection
|
||||
- Single runtime state object with deliberate clear/reset logic.
|
||||
- Refresh scheduler:
|
||||
- Serialized refreshes (no overlap)
|
||||
- Adaptive polling backoff
|
||||
- SSE-triggered immediate refresh for state mutations
|
||||
- Visibility-aware refresh suppression
|
||||
- API client is generated from OpenAPI operation ids, not handwritten endpoints.
|
||||
- Internationalization:
|
||||
- translation file validation at startup
|
||||
- language-specific FAQ markdown loading with fallback to default language
|
||||
- Blazor component tree rooted in `Components/App.razor` and `Components/Pages/Home.razor(.cs)`.
|
||||
- Browser API calls and SSE are handled via `wwwroot/js/rpgroller-api.js` interop.
|
||||
- UI state is maintained server-side per circuit with session/tab persistence for campaign + screen selection.
|
||||
- SSE-driven campaign refresh with reconnect backoff and explicit offline/manual-refresh fallback.
|
||||
|
||||
### 2.7 Testing strategy patterns
|
||||
|
||||
@@ -127,8 +112,7 @@ This pattern is a strong baseline for low to medium scale and should be the defa
|
||||
### 2.8 Tooling and contract discipline
|
||||
|
||||
- OpenAPI generated during build (`openapi/RpgRoller.json`).
|
||||
- Client generated from OpenAPI with required operation-id checks.
|
||||
- Separate lint + format + tests + coverage threshold checks.
|
||||
- Separate build + tests + coverage threshold checks.
|
||||
- Build configured with warnings as errors in CI/local script.
|
||||
|
||||
## 3) Concrete feature set
|
||||
@@ -158,7 +142,6 @@ Use this as a reusable "starter scope menu" for the new app:
|
||||
- trusted proxy/host settings explicit
|
||||
- Contract:
|
||||
- OpenAPI generation enabled in build
|
||||
- generated client wired into frontend
|
||||
- operation-id stability tested
|
||||
- Data integrity:
|
||||
- enforce critical invariants both app-side and DB-side
|
||||
@@ -179,7 +162,6 @@ Keep:
|
||||
- Shared service result abstraction.
|
||||
- Explicit middleware order.
|
||||
- SSE + ETag state sync.
|
||||
- Generated API client from OpenAPI.
|
||||
- DB-enforced invariants.
|
||||
- Regression tests for security-sensitive UI rendering.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user