How kailasss2k05/trackr_hospital_navigation_ecosystem- works
1. This repo is a three-part hospital platform, not a single app: a Flutter navigation client (navigation_app), a React/TypeScript operations dashboard (digital_twin), and Python backend services (serverside, plus a smaller analytics/data service in analytics_dashboard).
2. navigation_app is the patient-facing mobile/runtime client. Its core code lives in lib/ with feature screens such as search, route display, hospital details, street map, landmark directions, and a welcome flow. The app is asset-heavy: animations, videos, and images support the navigation experience.
3. The navigation app’s service layer is where the domain logic sits. campus_routing_service, hospital_api_service, landmark_directions_service, image_hash_service, and notification_service indicate a split between route computation, backend lookups, visual/media matching, and event/alert delivery. That means the Flutter UI is mostly a presentation shell over routing and live data services.
4. The route-planning boundary in the mobile app is important. From the README and file names, the app consumes hospital topology and real-time state to compute routes, then renders them through route and map screens. This is the main data flow for the mobile side: backend/route data → service layer → route UI.
5. digital_twin is the admin-facing real-time dashboard. It is a Vite-based React 18 + TypeScript application with a componentized UI in src/components/dashboard/, a page entry in src/pages/Index.tsx, and shared UI primitives under src/components/ui/. The structure suggests a single-page dashboard assembled from modular panels rather than a multi-route web app.
6. The dashboard’s state/data boundary is concentrated in hooks and API helpers. src/hooks/useHospitalData.ts and src/lib/api.ts are the main integration points, feeding panels such as alerts, maintenance, wards, capacity charts, summary cards, and live indicators. This is the dashboard’s key flow: backend data → hook/API client → dashboard panels.
7. analytics_dashboard is a separate Python analytics/data service layer. Its main.py, data.py, models.py, and routers for alerts, maintenance, realtime, and wards suggest it serves operational telemetry and simulated hospital events. In the architecture, this looks like the domain-specific data engine for the dashboard side.
8. serverside is the shared system-of-record backend. It contains FastAPI route handlers for auth and health, SQLAlchemy database setup (db/), ORM models (models/user.py), Pydantic schemas (schemas/auth.py), and auth/security helpers (jwt_handler, oauth2, security). This is the trust boundary for identity and core backend access.
9. Persistence is centered on PostgreSQL. The README names PostgreSQL as the persistent store, and the backend’s db/ and models/ layout matches that. The backend likely holds user records and shared hospital data, while the analytics service focuses on live operational state and event generation.
10. The main system boundary is between two clients and the backend services. The Flutter app serves visitors/patients and prioritizes navigation, while the React dashboard serves staff/admins and prioritizes monitoring. Both depend on live backend data, but serverside handles authentication/core APIs, and the analytics-oriented Python service(s) provide ward/alert/realtime operational feeds.
11. Infrastructure and tooling are straightforward but relevant: Flutter targets multiple platforms, React uses Vite + TypeScript + Tailwind-style component primitives, and the backend includes a Dockerfile for containerized deployment. Testing exists in all three areas: Flutter widget tests, Vitest for the dashboard, and backend test scaffolding.
12. For an architecture diagram, the clearest picture is: two frontends at the edge, a shared authenticated backend in the middle, and a separate analytics/realtime data layer feeding operational views. The important arrows are navigation service calls, dashboard data polling/streaming, auth requests, and database persistence behind the Python services.
Main entry points: serverside Serverside · analytics_dashboard Analytics Service · navigation_app Navigation App · services Route Services
Components 19
Navigation App
Flutter patient-facing mobile and desktop client.
- Navigation App · Patient-facing navigation runtime with route, map, and hospital discovery flows.
navigation_app - Mobile UI · Welcome, search, detail, route display, street map, and landmark direction screens.
navigation_app/lib/screens - Route Services · Campus routing, hospital API access, landmark directions, image matching, and notifications.
navigation_app/lib/services - Media Assets · Animations, reference images, icons, and video used by the navigation experience.
navigation_app/assets
Operations Dashboard
React/TypeScript staff dashboard.
- Digital Twin · Staff-facing operations dashboard built with React, TypeScript, and Vite.
digital_twin - Dashboard Page · Main application entry that assembles the dashboard workspace.
digital_twin/src/pages/Index.tsx - Dashboard Panels · Alerts, maintenance, capacity, ward, summary, and status panels composing the live view.
digital_twin/src/components/dashboard - Data Hooks · Hospital data hook that feeds the dashboard from backend state.
digital_twin/src/hooks/useHospitalData.ts - API Client · Shared request layer for hospital data integration.
digital_twin/src/lib/api.ts
Analytics Service
Python operational telemetry and event service.
- Analytics Service · Operational data engine for alerts, wards, realtime state, and maintenance feeds.
analytics_dashboard - Service App · Service entry point wiring telemetry and operational routes.
analytics_dashboard/main.py - Telemetry Routes · Alerts, maintenance, realtime, and wards endpoints.
analytics_dashboard/routers - Data Layer · Operational data helpers and domain models backing the analytics service.
analytics_dashboard/data.py
Core Backend
Shared authenticated backend and persistence layer.
- Serverside · Shared authenticated system-of-record backend.
serverside - Auth APIs · Authentication and health endpoints exposed by the backend.
serverside/api/routes - Auth Stack · JWT, OAuth2, and security helpers for identity and access control.
serverside/auth - Database Layer · Database session and base wiring for persistent storage.
serverside/db - User Model · Core user persistence model.
serverside/models/user.py - PostgreSQL · Shared relational persistence for users and hospital system data.
Connections 21
- Navigation App → Mobile UI: renders · The Flutter app is primarily a presentation shell over its screen flow.
- Navigation App → Route Services: uses · UI depends on domain services for routing, hospital lookup, and notifications.
- Navigation App → Media Assets: loads · Navigation experience uses rich media assets for guidance and presentation.
- Route Services → Serverside: queries · Mobile services fetch hospital and routing data from backend APIs.
- Route Services → Analytics Service: consumes · Route and navigation logic can incorporate live operational state feeds.
- Digital Twin → Dashboard Page: starts at · Vite app boots through the main dashboard page.
- Dashboard Page → Dashboard Panels: composes · The page assembles the dashboard from modular panels.
- Dashboard Panels → Data Hooks: binds data · Panels receive live hospital state through hooks.
- Data Hooks → API Client: calls · Hook layer delegates network access to the API client.
- API Client → Analytics Service: reads from · Dashboard requests operational telemetry and ward data from the analytics service.
- API Client → Serverside: authenticates with · Shared backend provides identity and core API access for staff workflows.
- Analytics Service → Service App: exposes · Service entry point wires the Python analytics application.
- Service App → Telemetry Routes: mounts · Main app organizes operational endpoints into route modules.
- Service App → Data Layer: uses · Service app relies on local data helpers and models.
- Analytics Service → Serverside: shares data with · Operational service complements the system-of-record backend.
- Serverside → Auth APIs: serves · Backend exposes auth and health endpoints.
- Serverside → Auth Stack: secures · JWT and OAuth2 helpers define the trust boundary.
- Serverside → Database Layer: persists via · Backend persistence flows through database session and base setup.
- Database Layer → PostgreSQL: stores in · Database layer connects the backend to PostgreSQL.
- User Model → Database Layer: maps onto · ORM model is materialized through the database layer.
- Data Layer → PostgreSQL: may read/write · Analytics service data structures can be backed by shared relational storage.