How aayushsharma141/dr-sr works
Kalyan Hospital’s stated goal is a shared, offline-LAN patient and physiotherapy platform. The README distinguishes that target from the legacy PySide6/SQLite desktop app; the tree also contains React and FastAPI code, so the graph shows both rather than treating them as one deployed system. The main web workflow is browser navigation to role-based clinical or reception work, API requests, and server-side record handling. Several domain branches are documented or represented by modules but were not sampled; their internal links are therefore omitted or marked unverified.
Main entry points: main.py FastAPI application · router.tsx Role-based routes · auth.py Authentication routes · session.py Database sessions
Components 28
Web client
- Web application
frontend/src/main.tsx - Role-based routes
frontend/src/router.tsx - Clinical workspace
frontend/src/pages/ClinicalEncounterWorkspace.tsx - Patient registration
frontend/src/pages/PatientRegister.tsx - Reception workflows
frontend/src/pages - Administration
frontend/src/pages/admin - API queries
frontend/src/api/queries.ts - HTTP client
frontend/src/api/client.ts
LAN API
- FastAPI application
backend/src/kalyan_api/main.py - Authentication routes
backend/src/kalyan_api/routers/auth.py - Patient records
backend/src/kalyan_api/routers/patients.py - Clinical records
backend/src/kalyan_api/routers/encounters.py - Appointments
backend/src/kalyan_api/routers/appointments.py - Billing
backend/src/kalyan_api/routers/billing.py - Other API domains
backend/src/kalyan_api/routers - Authentication service
backend/src/kalyan_api/services/auth_service.py - Audit service
backend/src/kalyan_api/services/audit_service.py - Runtime settings
backend/src/kalyan_api/config.py
Persistence and files
- Database sessions
backend/src/kalyan_api/db/session.py - Domain models
backend/src/kalyan_api/models.py - Central database
- Private file storage
backend/src/kalyan_api/config.py
Legacy desktop
- Desktop interface
legacy/app/ui/main_window.py - Desktop authentication
legacy/app/services/auth_service.py - Patient services
legacy/app/services/patient_service.py - Local SQLite
legacy/app/db/connection.py
Other components
- Hospital staff
- LAN browser
Connections 29
- Hospital staff → LAN browser: uses
README.md - LAN browser → Web application: opens
- Web application → Role-based routes: renders
frontend/src/main.tsx - Role-based routes → Clinical workspace: routes to
frontend/src/router.tsx - Role-based routes → Patient registration: routes to
frontend/src/router.tsx - Role-based routes → Reception workflows: routes to
frontend/src/router.tsx - Role-based routes → Administration: routes to
frontend/src/router.tsx - Clinical workspace → HTTP client: requests
frontend/src/pages/ClinicalEncounterWorkspace.tsx - API queries → HTTP client: calls
frontend/src/api/queries.ts - Administration → API queries: uses
frontend/src/pages/admin/BackupManagerPage.tsx - HTTP client → FastAPI application: sends requests
- FastAPI application → Authentication routes: registers
backend/src/kalyan_api/main.py - FastAPI application → Patient records: registers
backend/src/kalyan_api/main.py - FastAPI application → Clinical records: registers
backend/src/kalyan_api/main.py - FastAPI application → Appointments: registers
backend/src/kalyan_api/main.py - FastAPI application → Billing: registers
backend/src/kalyan_api/main.py - FastAPI application → Other API domains: registers
backend/src/kalyan_api/main.py - Authentication routes → Authentication service: calls
backend/src/kalyan_api/routers/auth.py - Authentication routes → Audit service: records events
backend/src/kalyan_api/routers/auth.py - Authentication service → Domain models: uses
backend/src/kalyan_api/services/auth_service.py - Audit service → Domain models: uses
backend/src/kalyan_api/services/audit_service.py - Database sessions → Runtime settings: configures
backend/src/kalyan_api/db/session.py - FastAPI application → Database sessions: initializes
backend/src/kalyan_api/main.py - Database sessions → Central database: connects
- Domain models → Central database: maps records
- Runtime settings → Private file storage: sets locations
backend/src/kalyan_api/config.py - Desktop interface → Patient services: uses
legacy/app/ui/main_window.py - Desktop interface → Local SQLite: initializes
legacy/app/ui/main_window.py - Desktop authentication → Local SQLite: queries
legacy/app/services/auth_service.py