How anjithrao/rxreader-medical-ai works
RxReader turns a prescription image into structured medicine information, then offers reference translation, medicine-scoped Q&A, and nearby pharmacy discovery with routing. The main path runs from upload through OCR and name correction to enriched results; chat and pharmacy search are separate follow-on workflows. The README documents key processing and integrations; source excerpts and the SOURCE INDEX confirm selected wiring, but several route and service implementations were not shown, so uncertain internal links are omitted.
Main entry points: api.js REST client · main.py FastAPI app · App.jsx App flow · ocr.py OCR endpoint
Components 27
Web experience
- App flow
src/App.jsx - Prescription upload
src/components/UploadZone.jsx - Medicine results
src/pages/ResultsPage.jsx - Medicine chat
src/components/RagChat.jsx - Pharmacy search
src/pages/PharmaciesPage.jsx - REST client
src/api.js
API workflows
- FastAPI app
app/main.py - OCR endpoint
app/routes/ocr.py - Reference endpoint
app/routes/reference.py - Chat endpoint
app/routes/chat.py - Pharmacy endpoints
app/routes/pharmacy.py
Medicine processing
- OCR model registry
app/models/registry.py - Image OCR
app/services/ocr_service.py - Text normalization
app/utils/text.py - Medicine correction
correct.py - Extraction and translation
app/services/gemini_service.py - Medicine references
app/services/reference_service.py
RAG assistant
- Hybrid retrieval and answers
app/services/rag_service.py - Vector store
app/services/vector_store.py - Embeddings
app/services/embedding_service.py - Medicine index builder
app/data/build_index.py
Pharmacy discovery
- Nearby search and routes
app/services/pharmacy_service.py - Geospatial helpers
app/utils/geo.py
Other components
- User
- Gemini API
- OpenFDA and local data
- OSM, Overpass, OSRM
Connections 34
- User → Prescription upload: submits image
README.md - Prescription upload → App flow: passes image
- App flow → REST client: processes image
src/App.jsx - REST client → OCR endpoint: POST /process
src/api.js - FastAPI app → OCR endpoint: registers route
app/main.py - OCR endpoint → Image OCR: invokes OCR
app/routes/ocr.py - OCR endpoint → Extraction and translation: requests extraction
app/routes/ocr.py - Image OCR → OCR model registry: uses models
app/routes/ocr.py - Image OCR → Text normalization: normalizes text
app/routes/ocr.py - Text normalization → Medicine correction: corrects names
README.md - Extraction and translation → Gemini API: extracts medicines
app/services/gemini_service.py - Extraction and translation → Medicine references: resolves references
app/services/gemini_service.py - Medicine references → OCR model registry: checks dictionary
app/services/reference_service.py - Medicine references → OpenFDA and local data: uses fallback data
README.md - App flow → Medicine results: shows results
src/App.jsx - Medicine results → Medicine chat: opens assistant
src/pages/ResultsPage.jsx - Medicine chat → REST client: asks question
src/components/RagChat.jsx - REST client → Chat endpoint: POST /chat
src/api.js - FastAPI app → Chat endpoint: registers route
app/main.py - Chat endpoint → Hybrid retrieval and answers: requests answer
app/routes/chat.py - Hybrid retrieval and answers → Vector store: retrieves documents
app/services/rag_service.py - Vector store → Embeddings: gets embeddings
app/services/vector_store.py - Medicine index builder → Vector store: builds index
app/data/build_index.py - Hybrid retrieval and answers → Gemini API: generates answer
README.md - App flow → Pharmacy search: opens search
src/App.jsx - Pharmacy search → REST client: requests search and route
src/pages/PharmaciesPage.jsx - REST client → Pharmacy endpoints: calls endpoints
src/api.js - FastAPI app → Pharmacy endpoints: registers route
app/main.py - Pharmacy endpoints → Nearby search and routes: delegates requests
app/routes/pharmacy.py - Nearby search and routes → Geospatial helpers: uses geo helpers
app/services/pharmacy_service.py - Nearby search and routes → OSM, Overpass, OSRM: searches and routes
README.md - REST client → Reference endpoint: POST translation
src/api.js - FastAPI app → Reference endpoint: registers route
app/main.py - Reference endpoint → Extraction and translation: translates references
app/routes/reference.py