How purshathali-hub/liver-disease-prediction works
This React application collects patient demographics and liver laboratory values, submits them to a Gemini-backed service for an educational risk estimate, and displays the result, risk factors, and recommendations. App.tsx owns submission, loading, and error state; the form and result components handle the corresponding user-interface stages. The README describes a Jupyter/scikit-learn model, but the sampled runtime calls Gemini instead, so no connection from the notebook to prediction is asserted.
Main entry points: App.tsx App state and submission · PredictionForm.tsx Patient data form · geminiService.ts Gemini prediction service · ResultDisplay.tsx Risk result display
Components 12
User interface
- React entry
index.tsx - Patient data form
components/PredictionForm.tsx - Risk result display
components/ResultDisplay.tsx - Loading indicator
components/Loader.tsx - Application header
components/Header.tsx - Medical disclaimer
components/Footer.tsx
Prediction flow
- App state and submission
App.tsx - Gemini prediction service
services/geminiService.ts
Data contracts
- Form fields and defaults
constants.ts - Patient and result types
types.ts
Other components
- Patient
- Google Gemini API
Connections 17
- React entry → App state and submission: mounts
index.tsx - App state and submission → Application header: renders
App.tsx - App state and submission → Patient data form: renders
App.tsx - App state and submission → Loading indicator: renders
App.tsx - App state and submission → Risk result display: renders
App.tsx - App state and submission → Medical disclaimer: renders
App.tsx - Patient → Patient data form: enters data
components/PredictionForm.tsx - Patient data form → Form fields and defaults: reads field definitions
components/PredictionForm.tsx - Patient data form → App state and submission: submits and reports changes
components/PredictionForm.tsx - App state and submission → Form fields and defaults: initializes patient data
App.tsx - App state and submission → Gemini prediction service: requests prediction
App.tsx - Gemini prediction service → Google Gemini API: requests generated analysis
services/geminiService.ts - Gemini prediction service → App state and submission: returns prediction
App.tsx - App state and submission → Risk result display: passes prediction
App.tsx - Patient data form → Patient and result types: uses patient types
components/PredictionForm.tsx - Gemini prediction service → Patient and result types: uses prediction types
services/geminiService.ts - Risk result display → Patient and result types: uses result type
components/ResultDisplay.tsx