How manu-7/diagnosense works
DiagnoSense connects patient symptom triage and diagnostic bookings with center-side report processing and patient-facing results. The frontend routes role-specific journeys through a shared API client; the FastAPI backend handles catalog, booking, and report requests, while Celery supports asynchronous report analysis and notifications. Report analysis combines measured values, rule-based anomaly checks, retrieval-grounded explanations, and private PDF storage. README capability descriptions supplement sampled code for unsampled routes; edges are limited to relationships shown in excerpts, the SOURCE INDEX, or README.
Main entry points: reports.py Report endpoints · tasks.py Async tasks · main.py FastAPI app · App.jsx Web app routes
Components 27
Web client
- Web app routes
frontend/src/App.jsx - Auth context
frontend/src/context/AuthContext.jsx - API client
frontend/src/api/client.js - Patient pages
frontend/src/pages - Center pages
frontend/src/pages
Backend API
- FastAPI app
backend/app/main.py - Authentication
backend/app/routers/auth.py - Center catalog
backend/app/routers/centers.py - Symptom triage
backend/app/routers/ai.py - Bookings and payment
backend/app/routers/bookings.py - Report endpoints
backend/app/routers/reports.py
Report analysis
- AI and anomaly rules
backend/app/services/ai_service.py - Reference retrieval
backend/app/services/rag_service.py - Text embeddings
backend/app/services/embedding_service.py - Lab value extraction
backend/app/services/extraction_service.py - PDF generation
backend/app/services/pdf_report_service.py - Async tasks
backend/app/tasks/tasks.py
Data and integrations
- Domain models
backend/app/models - Report schema
backend/app/schemas/report.py - PostgreSQL and pgvector
backend/app/database.py - Redis cache and broker
backend/app/core/redis_client.py - Report object storage
backend/app/services/storage_service.py - Razorpay
- Groq LLM
- Email delivery
backend/app/services/email_service.py
Other components
- Patient
- Center user
Connections 37
- Patient → Web app routes: uses
- Center user → Web app routes: uses
- Web app routes → Patient pages: routes to
frontend/src/App.jsx - Web app routes → Center pages: routes to
frontend/src/App.jsx - Web app routes → Auth context: provides auth
- Auth context → API client: calls
frontend/src/context/AuthContext.jsx - Patient pages → API client: requests data
frontend/src/pages/ReportDetail.jsx - Center pages → API client: requests data
frontend/src/pages/CenterBookings.jsx - API client → FastAPI app: HTTPS REST
- FastAPI app → Authentication: registers
backend/app/main.py - FastAPI app → Center catalog: registers
backend/app/main.py - FastAPI app → Symptom triage: registers
backend/app/main.py - FastAPI app → Bookings and payment: registers
backend/app/main.py - FastAPI app → Report endpoints: registers
backend/app/main.py - Symptom triage → AI and anomaly rules: requests recommendations
backend/app/routers/ai.py - Symptom triage → Redis cache and broker: caches catalogue
backend/app/routers/ai.py - Bookings and payment → Razorpay: creates and verifies payment
- Bookings and payment → Async tasks: queues notifications
backend/app/routers/bookings.py - Bookings and payment → Domain models: reads and writes bookings
backend/app/routers/bookings.py - Report endpoints → Domain models: reads and writes reports
backend/app/routers/reports.py - Report endpoints → Report schema: uses
backend/app/routers/reports.py - Report endpoints → PDF generation: generates PDF
backend/app/routers/reports.py - Report endpoints → Report object storage: uploads and signs access
backend/app/routers/reports.py - Report endpoints → AI and anomaly rules: flags anomalies
backend/app/routers/reports.py - Report endpoints → Reference retrieval: requests explanation
backend/app/routers/reports.py - Report endpoints → Async tasks: queues analysis
backend/app/routers/reports.py - Async tasks → Report object storage: downloads report
backend/app/tasks/tasks.py - Async tasks → Lab value extraction: extracts values
backend/app/tasks/tasks.py - Async tasks → AI and anomaly rules: flags anomalies
backend/app/tasks/tasks.py - Async tasks → Reference retrieval: requests explanation
backend/app/tasks/tasks.py - Async tasks → PostgreSQL and pgvector: persists analysis
backend/app/tasks/tasks.py - Async tasks → Email delivery: sends notifications
backend/app/tasks/tasks.py - Reference retrieval → Text embeddings: embeds query
backend/app/services/rag_service.py - Reference retrieval → PostgreSQL and pgvector: retrieves snippets
backend/app/services/rag_service.py - Reference retrieval → AI and anomaly rules: grounds explanation
backend/app/services/rag_service.py - AI and anomaly rules → Groq LLM: requests generation
- PostgreSQL and pgvector → Domain models: stores domain data
backend/app/models/reference_snippet.py