A web-based AI preventive health platform that predicts an individual's genetically inherited disease risks using family history, personal health records, and lifestyle data β then acts as a dynamic health coach by recommending prevention plans, screening tests, and urgent consultation when needed.
Many people carry a genetic predisposition to serious conditions β Type 2 Diabetes, Coronary Artery Disease, Hereditary Cancer, Thalassemia, Sickle Cell Disease β without ever knowing until symptoms appear. Preventive healthcare, especially in India, remains reactive. Genetic testing is expensive and inaccessible. Adolescents and young adults rarely seek screening.
This platform bridges that gap: using family history and health records as a proxy for genetic risk, making early risk awareness accessible without expensive lab tests.
- Collects user profile β age, weight, height, known conditions, lifestyle habits
- Collects family medical history β up to 2 generations (parents, grandparents), including their conditions and vitals
- Optionally parses uploaded medical documents via AI-powered OCR (lab reports, prescriptions)
- Runs multi-disease risk scoring using rule-based AI models with full explainability
- Returns risk classes IβIV (Low β Very High) for each disease, with probability scores
- Generates personalized output per disease:
- Plain-language disease explanation
- Personalized prevention plan (diet, exercise, lifestyle)
- Recommended screening tests with frequency and prep instructions
- Urgency guidance β from "routine annual checkup" to "consult a doctor this week"
| Disease | Category |
|---|---|
| Type 2 Diabetes | Metabolic |
| Coronary Artery Disease | Cardiovascular |
| Hypertension | Cardiovascular |
| Familial Hypercholesterolemia | Cardiovascular |
| Hereditary Breast & Ovarian Cancer (BRCA) | Oncological |
| Thalassemia | Hematological |
| Sickle Cell Disease | Hematological |
| Asthma | Respiratory |
| Hypothyroidism | Endocrine |
| PCOS | Endocrine |
| Class | Label | Action |
|---|---|---|
| I | Low Risk | Routine annual checkup |
| II | Moderate Risk | Screen within 3β6 months |
| III | High Risk | Consult doctor within 1 month |
| IV | Very High Risk | Urgent β consult within 1β2 weeks |
Each class drives personalized prevention advice, test selection, frequency adjustments, and urgency messaging throughout the platform.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FRONTEND (React + Vite) β
β LandingPage β RegistrationForm β FamilyHistoryForm β
β β LifestyleForm β UploadReport β ResultsDashboard β
β β
β React Β· Vite Β· TailwindCSS Β· Lucide Icons Β· Axios β
βββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββ
β REST API (Axios / JSON)
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β BACKEND (FastAPI) β
β β
β POST /api/predict β prediction_service β
β POST /api/ocr β ocr_service β
β GET /api/disease-info/{id} β
β β
β FastAPI Β· Uvicorn Β· Pydantic Β· Python-dotenv β
βββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββ
β Python imports
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β AI MODULE β
β β
β ai/risk/ β
β risk_model.py β predict_risks() entry point β
β scoring_rules.py β per-disease scoring rules β
β risk_classes.py β IβIV classification logic β
β explainability.py β human-readable reasons β
β β
β ai/coaching/ β
β consult_logic.py β backendβAI bridge β
β prevention_engine.py β personalized plans β
β test_recommender.py β screening test selection β
β β
β ai/ocr/ β
β ocr_pipeline.py β medical document parsing β
β β
β ai/data/ β
β diseases_config.json β disease metadata β
β guidelines.json β prevention guidelines β
β tests_map.json β screening tests database β
β sample_inputs.json β test payloads β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
genescope/
βββ ai/
β βββ coaching/
β β βββ consult_logic.py # BackendβAI bridge, predict_risk()
β β βββ prevention_engine.py # Personalized prevention plans
β β βββ test_recommender.py # Screening test selection & prioritization
β βββ data/
β β βββ diseases_config.json # Disease metadata and descriptions
β β βββ guidelines.json # Prevention guidelines for all diseases
β β βββ sample_inputs.json # Sample request payloads for testing
β β βββ tests_map.json # Screening test database per disease
β βββ ocr/
β β βββ ocr_pipeline.py # Medical document OCR pipeline
β βββ risk/
β β βββ explainability.py # Human-readable risk reasons
β β βββ risk_classes.py # Risk class IβIV assignment
β β βββ risk_model.py # Main predict_risks() function
β β βββ scoring_rules.py # Per-disease scoring rules
β βββ requirements.txt
βββ backend/
β βββ app/
β β βββ main.py # FastAPI app entry point
β β βββ config.py # Settings and environment config
β β βββ routers/
β β β βββ diseases.py # GET /api/disease-info/
β β β βββ ocr.py # POST /api/ocr
β β β βββ predict.py # POST /api/predict
β β βββ schemas/
β β β βββ prediction.py # RiskRequest, RiskResponse schemas
β β β βββ diseases.py # Disease info schemas
β β β βββ family.py # Family member schema
β β β βββ lab_values.py # Lab results schema
β β β βββ lifestyle.py # Lifestyle inputs schema
β β β βββ profile.py # Patient profile schema
β β βββ services/
β β βββ prediction_service.py # Calls AI risk module
β β βββ ocr_service.py # Calls OCR pipeline
β β βββ disease_service.py # Disease info lookup
β βββ .env.example
β βββ requirements.txt
βββ frontend/
β βββ src/
β β βββ api/
β β β βββ client.js # Axios instance with interceptors
β β β βββ predict.js # POST /api/predict
β β β βββ ocr.js # POST /api/ocr
β β β βββ diseases.js # GET /api/disease-info/
β β βββ components/
β β β βββ FileUpload.jsx # Drag-and-drop medical document upload
β β β βββ Navbar.jsx
β β β βββ Footer.jsx
β β β βββ RiskCard.jsx # Disease risk result card
β β β βββ RiskLegend.jsx # Risk class color legend
β β β βββ ProgressStepper.jsx # Multi-step form progress indicator
β β β βββ ErrorBanner.jsx
β β β βββ LoadingSpinner.jsx
β β βββ pages/
β β β βββ LandingPage.jsx
β β β βββ RegistrationForm.jsx # Patient profile input
β β β βββ FamilyHistoryForm.jsx # Family medical history (2 generations)
β β β βββ LifestyleForm.jsx # Lifestyle habits input
β β β βββ UploadReport.jsx # Medical document upload (OCR)
β β β βββ Assessment.jsx
β β β βββ ResultsDashboard.jsx # Final results with all disease risks
β β β βββ DiseaseDetail.jsx # Per-disease detail with prevention plan
β β βββ hooks/
β β β βββ useLocalStorage.js
β β βββ utils/
β β βββ formatters.js
β β βββ validators.js
β βββ .env.example
β βββ package.json
βββ docs/
β βββ api_contract.json # Full OpenAPI-style contract
βββ render.yaml # Render.com deployment config
βββ requirements.txt
- Python 3.9+
- Node.js 18+
git clone https://github.com/Jay-Jay-Tee/genescope.git
cd genescopecd backend
cp .env.example .env
pip install -r requirements.txt
pip install -r ../ai/requirements.txt
uvicorn app.main:app --reload --port 8000The API will be running at http://localhost:8000.
cd frontend
cp .env.example .env
# Edit .env and set: VITE_API_URL=http://localhost:8000/api
npm install
npm run devThe app will be running at http://localhost:5173.
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/predict |
Submit patient + family + lifestyle data, receive disease risk results |
POST |
/api/ocr |
Upload medical document (PDF/image), extract structured health data |
GET |
/api/disease-info/ |
List all supported diseases |
GET |
/api/disease-info/{id} |
Detailed info for a specific disease |
Full API contract: docs/api_contract.json
{
"patient": {
"age": 22,
"gender": "M",
"weight": 56.7,
"height": 171,
"known_issues": ["hypertension"]
},
"lifestyle": {
"diet": "high_sugar",
"exercise": "sedentary",
"smoking": false,
"stress_level": "high",
"sleep_hours": 5
},
"family": [
{
"role": "mother",
"generation": 1,
"known_issues": ["diabetes", "hypertension", "heart-disease"]
},
{
"role": "father",
"generation": 1,
"known_issues": ["diabetes", "cancer"]
}
]
}{
"disease_name": "Type 2 Diabetes",
"disease_id": "type2_diabetes",
"probability": 0.74,
"risk_class": "III",
"reasons": [
"Mother has Type 2 Diabetes β first-degree family history significantly increases risk",
"Father has Type 2 Diabetes β bilateral parental history compounds risk",
"High-sugar diet identified as a modifiable risk factor",
"Sedentary lifestyle increases insulin resistance risk"
],
"prevention": { "diet": [...], "exercise": [...], "lifestyle": [...] },
"recommended_tests": ["HbA1c", "Fasting Blood Glucose", "..."],
"consult": "Consult doctor within 1 month"
}The risk engine is fully rule-based and explainable β no black-box ML. This was a deliberate design decision: in a health context, every factor that contributes to a risk score is surfaced to the user as a plain-language reason.
Scoring pipeline:
risk_model.pyβpredict_risks(user_data)iterates over all covered diseasesscoring_rules.pyβ per-disease rules weight family history, lifestyle, vitals, and lab values into a 0β1 probabilityrisk_classes.pyβ probability mapped to class I / II / III / IVexplainability.pyβ generates human-readable reason strings per contributing factorprevention_engine.pyβ personalized plan based on disease + class + user profiletest_recommender.pyβ selects and prioritizes screening tests; adjusts frequency by risk class
Test recommendations by risk class:
| Class | Max tests shown |
|---|---|
| I | 2 |
| II | 3 |
| III | 5 |
| IV | 6 |
Test frequency is automatically tightened as risk class increases (e.g. "Annually" β "Every 6 months" for Class III, "Every 3β6 months" for Class IV).
Deployed on Render using render.yaml.
- Backend: Python web service running
uvicorn app.main:app - Frontend: Static site β Vite builds to
dist/, served as a static deploy
Environment variables on Render:
| Variable | Where | Description |
|---|---|---|
VITE_API_URL |
Frontend build env | Backend API base URL |
| Backend secrets | Backend service env | See backend/.env.example |
SDG 3: Good Health and Well-Being
GeneScope directly addresses the gap between knowing a disease runs in your family and understanding what to do about it. By making risk awareness accessible, actionable, and free, it supports early detection and preventive intervention β reducing long-term healthcare burden and avoidable complications.
Built at NIT Calicut, 2026:
- Joshua Jacob Thomas (Lead)
- HR Soorya Dev
- Dinesh Paliwal
- Mayank Singh
- Aditya Singh
- Nirmal Kumar Prajapath
- Satrajit Mondal
- Sai Pranav Parasuraman
- Sagnik Dutta
- Siddharth Madhavan
MIT License β see LICENSE