How puni6553-collab/nethra-clinic works
NetraCare is a clinic booking and patient-chat portal: users sign in, find or request appointments, and receive clinic-document answers; backend rules and safety checks govern booking. Separate branches cover doctor-leave rebooking, clinical LLM features, partner integrations, and the documented evaluation harness. Edges use README and indexed source references; several implementation modules were not sampled, so their internal calls are not asserted.
Main entry points: main.py FastAPI application · database.py Clinic database · appointments.py Appointment routes · chat.py Chat routes
Components 28
Portal experience
- React routes
frontend/src/App.jsx - Booking and role screens
frontend/src/screens - API client
frontend/src/api.js
Clinic operations
- FastAPI application
backend/app/main.py - Login and identity
backend/app/security.py - Auth routes
backend/app/routers/auth.py - Appointment routes
backend/app/routers/appointments.py - Clinic rules
backend/app/rules.py - Slot generation
backend/app/slots.py - Booking actions
backend/app/actions.py - Leave rebooking
backend/app/leave.py - Leave routes
backend/app/routers/leave.py - Clinic database
backend/app/database.py - Clinic records
backend/app/models.py - Clinic data loading
backend/app/seed.py
Chat and clinical AI
- Chat routes
backend/app/routers/chat.py - Booking agent
backend/app/agent.py - Agent tools
backend/app/tools.py - Document search and answers
backend/app/rag.py - Clinical LLM services
backend/app/llm.py - Clinical AI routes
backend/app/routers/llm_routes.py - Agent skills
backend/app/skills.py
Partner integrations
- NetraCare MCP server
backend/mcp_server.py - Partner lab client
backend/app/lab.py - CityCare lab server
partner-lab/citycare_lab_mcp.py
Evaluation
- Evaluation harness and judges
evals/harness.py
Other components
- Patient, staff, doctor
- Partner applications
Connections 37
- Patient, staff, doctor → React routes: uses portal
- React routes → Booking and role screens: routes to
frontend/src/App.jsx - Booking and role screens → API client: requests data
frontend/src/screens/DoctorHome.jsx - API client → FastAPI application: calls API
frontend/src/api.js - FastAPI application → Auth routes: mounts routes
backend/app/main.py - FastAPI application → Appointment routes: mounts routes
backend/app/main.py - FastAPI application → Chat routes: mounts routes
backend/app/main.py - FastAPI application → Leave routes: mounts routes
backend/app/main.py - FastAPI application → Clinical AI routes: mounts routes
backend/app/main.py - FastAPI application → Clinic data loading: loads data
backend/app/main.py - Auth routes → Login and identity: delegates identity
backend/app/routers/auth.py - Auth routes → Clinic database: reads and writes
backend/app/routers/auth.py - Appointment routes → Login and identity: checks identity
backend/app/routers/appointments.py - Appointment routes → Slot generation: gets availability
backend/app/routers/appointments.py - Appointment routes → Booking actions: invokes actions
backend/app/routers/appointments.py - Appointment routes → Clinic rules: applies rules
backend/app/routers/appointments.py - Appointment routes → Clinic database: reads and writes
backend/app/routers/appointments.py - Leave routes → Leave rebooking: delegates rebooking
- Leave rebooking → Clinic database: updates bookings
- Clinic data loading → Clinic database: loads records
backend/app/seed.py - Clinic database → Clinic records: creates tables
backend/app/database.py - Chat routes → Login and identity: checks identity
backend/app/routers/chat.py - Chat routes → Booking agent: runs booking agent
backend/app/routers/chat.py - Chat routes → Document search and answers: uses document answers
backend/app/routers/chat.py - Booking agent → Agent tools: uses tools
- Chat routes → Clinical LLM services: checks red flags
- Clinical AI routes → Clinical LLM services: runs AI services
backend/app/routers/llm_routes.py - Clinical LLM services → Clinic database: summarizes records
- Agent tools → Agent skills: loads skills
- FastAPI application → Partner lab client: connects optionally
backend/app/main.py - Partner lab client → CityCare lab server: calls partner service
- Partner applications → NetraCare MCP server: finds slots, books
- NetraCare MCP server → Booking actions: runs clinic booking
backend/mcp_server.py - NetraCare MCP server → Slot generation: finds availability
backend/mcp_server.py - NetraCare MCP server → Clinic database: reads and writes
backend/mcp_server.py - Evaluation harness and judges → FastAPI application: exercises endpoints
evals/harness.py - Evaluation harness and judges → Clinical LLM services: uses LLM judges