How harsha33983/medical-bot- works
This is a full-stack symptom-prediction chatbot: users register or sign in, enter symptoms by text or voice, and receive condition predictions, descriptions, precautions, and a severity-based response. The React chatbot calls FastAPI through a shared API client; the backend authenticates protected predictions, matches symptoms to its loaded model feature list, and returns results from two classifiers plus reference data. It also generates speech audio for playback. The graph reflects the README and sampled source; some chatbot steps and data wiring are documented but not fully visible in the excerpts.
Main entry points: app.py API handlers · Chatbot.jsx Consultation chat · App.jsx Route shell · api.js API client
Components 23
Web experience
- Route shell
frontend/src/App.jsx - Home page
frontend/src/pages/Home.jsx - Sign in
frontend/src/pages/Login.jsx - Registration
frontend/src/pages/Register.jsx - Consultation chat
frontend/src/pages/Chatbot.jsx - API client
frontend/src/services/api.js - Speech recognition
frontend/src/pages/Chatbot.jsx
Backend API
- API handlers
backend/app.py - Token auth
backend/auth.py - Request schemas
backend/schemas.py - Speech synthesis
backend/app.py - Generated audio
backend/static
Prediction data
- Symptom vocabulary
backend/data/list_of_symptoms.pickle - SVC and tree
backend/models - Severity weights
backend/data/Symptom-severity.csv - Condition descriptions
backend/data/symptom_Description.csv - Precaution guidance
backend/data/symptom_precaution.csv
Identity and state
- DB session
backend/db.py - User model
backend/db_models.py - User database
backend/medical_chatbot.db
Other components
- User
- Browser speech
- pyttsx3
Connections 33
- User → Home page: opens
- User → Sign in: signs in
- User → Registration: registers
- User → Consultation chat: enters symptoms
- Route shell → Home page: routes
- Route shell → Sign in: routes
- Route shell → Registration: routes
- Route shell → Consultation chat: routes
- Sign in → API client: sends credentials
- Registration → API client: sends credentials
- Consultation chat → API client: requests symptoms
- API client → API handlers: HTTP API
- API handlers → Request schemas: validates
- API handlers → Token auth: authenticates
- API handlers → DB session: opens session
- API handlers → User model: queries users
- DB session → User database: connects
- User model → User database: reads and writes
- API handlers → Symptom vocabulary: loads vocabulary
- API handlers → SVC and tree: loads models
- API handlers → Severity weights: loads weights
- API handlers → Condition descriptions: loads descriptions
- API handlers → Precaution guidance: loads precautions
- API handlers → SVC and tree: predicts with
- API handlers → Severity weights: matches symptoms
- API handlers → Condition descriptions: looks up condition
- API handlers → Precaution guidance: looks up guidance
- API handlers → Speech synthesis: dispatches speech
- Speech synthesis → pyttsx3: synthesizes
- Speech synthesis → Generated audio: writes WAV
- Consultation chat → Speech recognition: starts recognition
- Browser speech → Speech recognition: provides speech API
- Speech recognition → Consultation chat: returns transcript