How ayush-hassan07/liverguard works
LiverGuard is an educational NAFLD-risk prediction web application. Users enter health markers in the frontend, which submits them through the ASP.NET API to the FastAPI inference service; the result page presents the score, threshold, model scores, and SHAP feature contributions. The README documents this service chain and the model’s capabilities. Backend implementation details were not excerpted, so its internal handling is summarized rather than decomposed; unsampled informational pages are retained as distinct product capabilities.
Main entry points: main.py FastAPI endpoints · PredictionForm.tsx Marker form · inference.py Preprocessing and ensemble inference · api.ts API client
Components 16
Web experience
- Home page
frontend/app/page.tsx - Model overview
frontend/app/about-model/page.tsx - Privacy information
frontend/app/privacy/page.tsx - Prediction page
frontend/app/predict/page.tsx - Marker form
frontend/components/PredictionForm.tsx - API client
frontend/lib/api.ts - Results and explanations
frontend/app/results/page.tsx
API boundary
- ASP.NET prediction API
backend/Program.cs
Inference service
- FastAPI endpoints
ml-service/app/main.py - Request and response schemas
ml-service/app/schemas.py - Artifact loader
ml-service/app/model_loader.py - Preprocessing and ensemble inference
ml-service/app/inference.py - SHAP contributions
ml-service/app/inference.py
Model artifacts
- Model configuration
ml-service/app/config.py - Trained models and thresholds
ml-service/models
Other components
- User browser
Connections 18
- User browser → Home page: opens
README.md - User browser → Prediction page: enters markers
README.md - Prediction page → Marker form: renders
frontend/app/predict/page.tsx - Marker form → API client: submits payload
frontend/components/PredictionForm.tsx - API client → ASP.NET prediction API: POSTs prediction
README.md - ASP.NET prediction API → FastAPI endpoints: calls ML service
README.md - FastAPI endpoints → Request and response schemas: validates and returns
ml-service/app/main.py - FastAPI endpoints → Artifact loader: loads artifacts
ml-service/app/main.py - FastAPI endpoints → Preprocessing and ensemble inference: dispatches prediction
ml-service/app/main.py - Artifact loader → Trained models and thresholds: loads models
ml-service/app/model_loader.py - Preprocessing and ensemble inference → Trained models and thresholds: uses ensemble
ml-service/app/inference.py - Preprocessing and ensemble inference → SHAP contributions: computes SHAP
ml-service/app/inference.py - Marker form → Results and explanations: stores result
frontend/components/PredictionForm.tsx - Results and explanations → API client: uses response type
frontend/app/results/page.tsx - User browser → Model overview: reads about model
- User browser → Privacy information: reads privacy details
- FastAPI endpoints → Model configuration: configures service
ml-service/app/main.py - Model configuration → Trained models and thresholds: locates model files
ml-service/app/config.py