This commit is contained in:
DatTT127
2026-06-24 10:33:07 +07:00
parent 16a91bd17e
commit f705113711
77 changed files with 8999 additions and 14 deletions

View File

@@ -0,0 +1,41 @@
# Frontend Specification
## Purpose
Provides interactive clinical workspace, runs edge models (LiteRT, MediaPipe), handles client-side encryption (WebCrypto), offline sync via IndexedDB/Service Worker, and renders UI viewport with graphics adapter fallback.
## Owner
Web Experience Team
## Boundary
PWA service worker, graphics adapter layer (IGraphicsViewport), local browser storage (IndexedDB), and UI components (React, Zustand).
## Internal Design
- Built as a Single Page Application (SPA) using React with TypeScript.
- State managed via Zustand store.
- Client-side encryption via WebCrypto API (AES-256-GCM) before local storage.
- Offline synchronization via Dexie.js (IndexedDB) and Service Worker that queues actions and retries on reconnection.
- Graphics rendering abstracted via IGraphicsViewport interface with WebGLThreeAdapter (Three.js) and CPUSpriteAdapter fallback.
- Edge ML executed in Web Workers: DICOM parser (cornerstone-core), LiteRT angle classifier (MobileNetV4), MediaPipe ROI pre-cropper.
- UI components render multi-layered canvas, workspace controls, diagnostic ribbons, and explanation panels.
- Communication with backend via HTTPS to NGINX gateway, JWT-based authentication, role-based access control (RBAC).
## Interface Contract
See `bento/frontend/spec/interface-contract.md`.
## Consumers
(None)
## Breaking-change Policy
See `bento/frontend/spec/interface-contract.md`.
## References
- NFR-1 (Collaborative Rendering Speed ≤3s)
- NFR-4 (Client Memory Footprint ≤150MB)
- NFR-14 (Legacy Hardware Compatibility)
- UC-48376 (Load Patient Scan Session)
- UC-47988 (Review Suggested Synovitis Grade)
- UC-25637 (Expose Pixel-Level Activation Logic)
- UC-60739 (Isolate Visual Noise/Artifacts)
- SOFTWARE_SYSTEM_DESIGN_FR_25.md (Sections 2.4, 3.1, 3.2, 3.3)
- SOLUTION_ARCHITECTURE_SPEC.md (Section 2.4)
- PROJECT_VIS.md (Section 3.1, 3.2)

View File

@@ -0,0 +1,39 @@
# Frontend Interface Contract
## Purpose
Provides interactive clinical workspace, runs edge models (LiteRT, MediaPipe), handles client-side encryption (WebCrypto), offline sync via IndexedDB/Service Worker, and renders UI viewport with graphics adapter fallback.
## Owner
Web Experience Team
## Provides
- ui viewport (interactive canvas, overlays, controls)
- edge ml (angle classification, inflammation detection, ROI pre-cropping)
- offline sync (local cache, sync queue, background synchronization)
## Consumes
- backend:api-spec (REST API endpoints for session, analysis, reporting, feedback)
- knowledge:guideline-spec (GraphRAG pipeline for grounded explanations, evidence arbitration)
## Consumers
(None)
## Not Directly Consumable
- backend internals (e.g., FastAPI route implementations, Triton model details)
- knowledge internals (Qdrant vectors, ladybugDB graph structure)
- data internals (Postgres schema, S3 object layout)
## Breaking-change Policy
- API versioning via path (e.g., /api/v1/).
- Backward compatibility maintained for one minor version.
- Deprecation notices issued in release notes.
- Breaking changes require major version bump.
## References
- NFR-1 (Collaborative Rendering Speed ≤3s)
- NFR-4 (Client Memory Footprint ≤150MB)
- NFR-14 (Legacy Hardware Compatibility)
- UC-48376 (Load Patient Scan Session)
- UC-47988 (Review Suggested Synovitis Grade)
- UC-25637 (Expose Pixel-Level Activation Logic)
- UC-60739 (Isolate Visual Noise/Artifacts)