Personalized Health Risk Analysis Powered by AI
Simulate your future health trajectories based on lifestyle choices and receive data-backed insights about diabetes risk, cardiovascular health, and preventive strategies.
Twindex is an intelligent health analytics platform that uses AI to predict how lifestyle changes impact your health over time. Enter your current health metrics and target lifestyle goals, and get a personalized simulation showing how your risk profile evolves.
Perfect for:
- Understanding the impact of lifestyle changes
- Making informed health decisions
- Preventive health planning
- Health coaching and patient education
- 𧬠Personalized Health Simulation - AI-powered trajectory analysis based on your inputs
- π Global Health Context - See where you stand compared to global disease prevalence
- π¬ Ask Questions - Follow-up chat to ask contextual questions about your report
- π₯ Export to PDF - Download your health report for sharing with healthcare providers
- π Dark Mode - Easy on the eyes, works day and night
- π± Fully Responsive - Works perfectly on desktop, tablet, and mobile
- β‘ Lightning Fast - No build tools, no dependencies, pure vanilla web tech
- π Privacy First - All processing happens client-side, nothing stored
Fill out your current health metrics, lifestyle habits, and lab values in an intuitive bento style form.
Receive a comprehensive health simulation showing risk trajectories for your current vs improved lifestyle scenarios.
Chat with the AI to ask context-aware questions about your specific report and get personalized answers.
Chat with the AI to ask context-aware questions about your medical reports, prescriptions, and generate insights from them.
See how your risk patterns compare with globally prevalent health conditions.
| Layer | Technology |
|---|---|
| Frontend | HTML5 + CSS3 + Vanilla JavaScript |
| Backend | FastAPI + Google Gemini 3 Pro |
| Parsing | marked.js (Markdown to HTML) |
| Export | html2pdf.js (PDF generation) |
| Styling | CSS Variables + CSS Grid + Flexbox |
| No Frameworks | No React, Vue, or build tools needed |
- Python 3.8+
- Google Gemini API Key
- Modern web browser
# Clone repository
git clone <repo-url>
cd Twindex
# Install dependencies
pip install -r requirements.txt
# Set environment variables
export GEMINI_API_KEY=your_api_key_here
export DISABLE_GEMINI=0 # Set to 1 for demo mode
# Run backend
uvicorn app.main:app --reload --port 8000# Navigate to frontend folder
cd frontend
# Start local server (optional, for development)
python -m http.server 8000
# Or simply open in browser
open index.htmlThen visit: http://localhost:8000
- Patient demographics (age, gender, height, weight)
- Lab values (fasting glucose, HbA1c)
- Current lifestyle (sleep, activity, diet, stress)
- Target goals (improved lifestyle metrics)
- Flexible simulation timeframe
- Type 2 Diabetes risk trajectory
- Cardiovascular disease assessment
- Sleep quality impact analysis
- Stress and metabolic correlations
- Preventive lifestyle recommendations
- Ask questions about your specific results
- AI remembers your health profile
- Get personalized follow-up insights
- Understand cause-effect relationships
- See disease prevalence rates
- Understand key risk factors for conditions
- Get population-level insights
- Know which factors matter most for you
- Toggle dark mode with one click (persists in localStorage)
- Export complete report as PDF
- Share results with healthcare providers
- Print-friendly formatting
Twindex/
βββ frontend/
β βββ index.html # Complete UI (1500+ lines)
β βββ script.js # All JavaScript logic (~750 lines)
β βββ disease_context.json # Disease prevalence data
β βββ assets/
β βββ input.png
β βββ output.png
β βββ followup_chat.png
β βββ disease_context.png
β
βββ app/
β βββ main.py # FastAPI server
β βββ gemini_client.py # Gemini AI integration
β βββ schemas.py # Data models
β
βββ requirements.txt # Python dependencies
Request:
{
"prompt": "PATIENT_PROFILE:\nName: John Doe\n..."
}Response:
{
"result": "Risk Comparison Table:\n...\nSimple Summary:\n..."
}- Patient Education - Help patients understand how lifestyle impacts health
- Preventive Medicine - Identify high-risk individuals early
- Health Coaching - Motivate behavior change with personalized projections
- Research - Analyze population-level health trajectories
- Wellness Programs - Corporate health initiative tool
- β No data stored on server (everything client-side)
- β CORS enabled for safe cross-origin requests
- β HTML escaping prevents XSS attacks
- β Form validation on both client and server
- β Sensitive data never logged
- β HTTPS ready for production deployment
- Frontend Load Time: < 500ms
- Simulation Processing: 2-5 seconds (Gemini API)
- Zero Dependencies: No npm, no webpack, no build step
- Bundle Size: ~50KB (minified)
- Responsive: 60 FPS animations
# Build (nothing to build - it's vanilla!)
# Just upload these files to any static host:
- index.html
- script.js
- disease_context.json
- assets/ folderHosting Options:
- Vercel
- Netlify
- GitHub Pages
- AWS S3 + CloudFront
- Traditional web server
# Using Gunicorn
gunicorn -w 4 -b 0.0.0.0:8000 app.main:app
# Using Docker
docker build -t twindex .
docker run -p 8000:8000 twindexBuilt By Tantriks - Subhojyoti Maity & Chandan Saha
Special thanks to:
- Google Gemini API for AI capabilities
- Global GenAI Hackathon hosted by Machine Learning Kolkata




