How rapepan/data_dashboard works
DATA BSTH is a hospital operations dashboard for near-real-time service statistics, with public viewing and additional staff/admin features. The main workflow is a user selecting an operational report and date range, the frontend requesting it from the API, and backend report logic returning data (currently mostly mock); cached report results reduce repeated HOSxP queries. Authentication, feedback, administration, and scheduled cache prewarming are meaningful supporting branches. Some subsystem links are based on README architecture documentation because their implementation was not sampled.
Main entry points: report-registry.ts Report registry · feedback.controller.ts Feedback handling · server.ts HTTP server · auth.service.ts Authentication service
Components 25
Dashboard frontend
- React application
frontend/src/App.tsx - Report pages
frontend/src/pages - Report data hooks
frontend/src/hooks - API services
frontend/src/services - API client
frontend/src/services/apiClient.ts
Backend API
- HTTP server
backend/src/server.ts - API routes
backend/src/routes - Request controllers
backend/src/controllers
Reports and cache
- Report services
backend/src/services - Report registry
backend/src/cache/report-registry.ts - Report cache
backend/src/cache/report-cache.ts - Cache prewarming
backend/src/cache/prewarm.ts - HOSxP repository
backend/src/repositories/hosxp.repository.ts
Identity and operations
- Authentication controller
backend/src/controllers/auth.controller.ts - Authentication service
backend/src/auth/auth.service.ts - Session and access checks
backend/src/middleware/auth.ts - Application database
backend/src/repositories/app-db.ts - Audit log
backend/src/auth/audit-log.ts - Feedback handling
backend/src/controllers/feedback.controller.ts - Feedback storage
backend/src/feedback/feedback-store.ts - Feedback images
backend/src/feedback/feedback-images.ts - Telegram notifications
backend/src/services/notify.service.ts
Other components
- Hospital user
- HOSxP staff accounts
- Telegram
Connections 24
- Hospital user → React application: opens
README.md - React application → Report pages: routes to
- Report pages → Report data hooks: loads reports
frontend/src/pages/Icd10SearchPage.tsx - Report data hooks → API services: requests data
frontend/src/hooks/useDashboardData.ts - API services → API client: uses
frontend/src/services/feedbackService.ts - API client → HTTP server: calls API
frontend/src/services/apiClient.ts - HTTP server → API routes: builds app
- API routes → Request controllers: routes requests
README.md - Request controllers → Report services: calls services
README.md - Report services → Report registry: loads report data
README.md - Report registry → Report cache: uses cache
README.md - Cache prewarming → Report cache: prewarms
backend/src/cache/prewarm.ts - Cache prewarming → Report registry: loads reports
backend/src/cache/prewarm.ts - Report registry → HOSxP repository: queries optionally
README.md - HOSxP staff accounts → Authentication controller: submits login
README.md - Authentication controller → Authentication service: verifies credentials
backend/src/controllers/auth.controller.ts - Authentication service → HOSxP repository: checks account
backend/src/auth/auth.service.ts - Authentication service → Application database: checks throttle
backend/src/auth/auth.service.ts - HTTP server → Session and access checks: registers
backend/src/server.ts - Session and access checks → Audit log: records access
backend/src/middleware/auth.ts - Feedback handling → Feedback storage: reads and writes
backend/src/controllers/feedback.controller.ts - Feedback handling → Feedback images: parses images
backend/src/controllers/feedback.controller.ts - Feedback handling → Telegram notifications: notifies
backend/src/controllers/feedback.controller.ts - Telegram notifications → Telegram: sends alerts
README.md