How r-rahman112/amar-dactar works
Amar Daktar is a bilingual medical consultation and health-management platform. Patients authenticate, use AI symptom/report tools, find doctors, book or join paid consultations, and manage records in a consent-controlled vault; doctors and administrators have separate management workflows. The map follows documented UI and server routing, plus sampled API, persistence, moderation, and authentication relationships. Several advertised capabilities are represented from the README; unsampled internals and their wiring are not inferred.
Main entry points: App.tsx Application shell · server.ts HTTP server · db.ts PostgreSQL access · ModerationService.ts Abuse moderation
Components 29
Patient experience
- Application shell
src/App.tsx - Consultation workspace
src/components/ConsultationWorkspace.tsx - Symptom and report tools
src/components/SymptomModal.tsx - Health vault
src/components/HealthVault.tsx - Role dashboards
src/components/PatientDashboard.tsx - Doctor tools
src/components/DoctorDashboard.tsx - Admin tools
src/components/AdminDashboard.tsx
Identity and language
- Authentication interface
src/components/AuthUI.tsx - Session context
src/contexts/AuthContext.tsx - Language context
src/contexts/LanguageContext.tsx - Firebase authentication
src/lib/firebase.ts
API and consultation
- API client
src/apiClient.ts - HTTP server
server.ts - User and role APIs
src/backend/routes/user.routes.ts - Appointments and doctors
src/backend/routes/appointment.routes.ts - Payment APIs
src/backend/routes/payment.routes.ts - Vault APIs
src/backend/routes/vault.routes.ts - AI and upload APIs
src/backend/routes/ai.routes.ts - Live consultation sockets
src/backend/socket.ts
AI and safety
- AI chat controller
src/backend/controllers/ChatController.ts - Abuse moderation
src/backend/services/ModerationService.ts - AI provider factory
src/backend/services/ai/AIFactory.ts
Data and notifications
- PostgreSQL access
src/backend/config/db.ts - Notifications
src/backend/utils/notifications.ts
Other components
- Patient
- Doctor
- Administrator
- AI services
- PostgreSQL
Connections 35
- Patient → Application shell: uses
- Doctor → Doctor tools: manages practice
- Administrator → Admin tools: manages platform
- Application shell → Consultation workspace: opens
src/App.tsx - Application shell → Symptom and report tools: opens
src/App.tsx - Application shell → Health vault: opens
src/App.tsx - Application shell → Role dashboards: routes views
src/App.tsx - Application shell → Doctor tools: routes views
src/App.tsx - Application shell → Admin tools: routes views
src/App.tsx - Authentication interface → Session context: uses
src/components/AuthUI.tsx - Session context → API client: requests sessions
src/contexts/AuthContext.tsx - Session context → Firebase authentication: observes sign-in
src/contexts/AuthContext.tsx - Application shell → Language context: provides locale
src/main.tsx - Consultation workspace → API client: calls APIs
src/components/ConsultationWorkspace.tsx - API client → HTTP server: sends requests
- HTTP server → User and role APIs: mounts routes
server.ts - HTTP server → Appointments and doctors: mounts routes
server.ts - HTTP server → Payment APIs: mounts routes
server.ts - HTTP server → Vault APIs: mounts routes
server.ts - HTTP server → AI and upload APIs: mounts routes
server.ts - HTTP server → Live consultation sockets: starts sockets
server.ts - User and role APIs → PostgreSQL access: queries
src/backend/routes/user.routes.ts - Appointments and doctors → PostgreSQL access: queries
src/backend/routes/appointment.routes.ts - Payment APIs → PostgreSQL access: queries
src/backend/routes/payment.routes.ts - Vault APIs → PostgreSQL access: queries
src/backend/routes/vault.routes.ts - AI and upload APIs → AI chat controller: dispatches
src/backend/routes/ai.routes.ts - AI chat controller → Abuse moderation: checks content
src/backend/controllers/ChatController.ts - Abuse moderation → AI provider factory: requests AI
src/backend/services/ModerationService.ts - AI provider factory → AI services: selects provider
- Abuse moderation → PostgreSQL access: records violations
src/backend/services/ModerationService.ts - PostgreSQL access → PostgreSQL: queries
src/backend/config/db.ts - Live consultation sockets → Abuse moderation: moderates sessions
src/backend/socket.ts - Live consultation sockets → PostgreSQL access: reads and writes
src/backend/socket.ts - User and role APIs → Notifications: notifies admins
src/backend/routes/user.routes.ts - Notifications → PostgreSQL access: stores notices
src/backend/utils/notifications.ts