Note: The repository is now organized as a monorepo with separate frontend (Next.js) and backend (Python/Flask ML) services.
.
โโโ frontend/ # Next.js app (App Router)
โ โโโ app/ # Routes and UI
โ โโโ components/ # Shared UI components
โ โโโ public/ # Static assets
โ โโโ Dockerfile # Production container (standalone)
โโโ backend/ # Python ML API (Flask)
โ โโโ app.py # API entrypoint
โ โโโ models/ # ML models (incl. models/ml/*)
โ โโโ utils/ # Helpers (symptom extraction, doctor finder)
โ โโโ Dockerfile # Backend container
โโโ backend-node/ # Legacy Node backend (preserved)
โโโ docker-compose.yml
-
Frontend (Next.js):
- cd frontend
- Install deps: pnpm i (or npm i)
- Dev: pnpm dev (or npm run dev)
-
Backend (Flask):
- cd backend
- python -m venv .venv && source .venv/bin/activate
- pip install -r requirements.txt
- python app.py (exposes http://localhost:5000)
Run both services via Docker:
docker compose up --build
This will start:
- backend: http://localhost:5000/
- frontend: http://localhost:3000/ (uses NEXT_PUBLIC_API_URL=http://backend:5000 inside the network)
A comprehensive, secure, and user-friendly health management platform built with Next.js, TypeScript, and Supabase. SwasthAI enables users to manage their personal health information, family health records, medical appointments, and important documents in one centralized, secure location.
- Secure Authentication: Email/password authentication with Supabase Auth
- Email Verification: Required email confirmation for account security
- Row-Level Security: Database-level security ensuring users only access their own data
- Protected Routes: Middleware-based route protection
- Session Management: Automatic session handling with refresh tokens
- Complete Profile Setup: Personal information, contact details, medical info
- Profile Photo Upload: Secure avatar storage with Supabase Storage
- Medical Information: Blood group, allergies, emergency contacts
- Address Management: Complete address information storage
- Family Member Management: Add and manage family members' health information
- Document Storage: Secure upload and storage of important family documents
- Document Categories: Identity, medical, insurance, legal, financial, education, photos
- File Management: View, download, and delete documents with proper permissions
- Emergency Contacts: Manage emergency contact information for the family
- Medical Records: Store prescriptions, lab reports, diagnoses, vaccinations, surgeries
- File Attachments: Upload and attach medical documents to health records
- Family Health Tracking: Track health records for all family members
- Advanced Filtering: Filter records by type, family member, and date
- Doctor Information: Store doctor and hospital information with each record
- Users can input health conditions, symptoms, or queries in any Indian native language (text or audio) and receive responses in the same language
- Powered by AI-driven insights, providing accurate remedies, treatments, and guidance
- Built with aiXplain custom agents, ensuring high accuracy and adaptability for rural healthcare needs
- Helps users find relevant doctors based on symptoms and health conditions
- Provides a curated list of doctors with details like hospital affiliations, fees, experience, and specialization
- Connects rural users with urban specialists
- Uses Google Maps to find nearby hospitals, clinics, and health centers
- Powerful tool to locate the nearest healthcare facilities based on user location and medical needs
- Helps users save time during emergencies
- Keeps users informed about health-related news, conditions, and updates specific to their area
- Offers expert-curated blogs, articles, and news to promote health literacy and preventive care
- Interactive visualizations showing urban-rural health disparities in India
- Charts and graphs for different health metrics including:
- Urban vs rural healthcare access comparison
- Common health conditions prevalence
- Life expectancy trends over time
- Child mortality rates and improvements
- Provides key takeaways and insights to drive informed healthcare decisions
- Responsive design that works across all device sizes
- Real-time Data Monitoring: Simulated smartwatch data updated every 10 seconds
- Key Health Metrics: Track heart rate (60-140 bpm), stress levels (1-10), sleep hours (3-9h), and daily steps (1000-10000)
- Mental Health Score: AI-calculated wellness score (0-10) based on:
- Stress levels > 7 โ -2 points
- Sleep < 6 hours โ -2 points
- Heart rate > 120 bpm โ -3 points
- Bonus points for optimal metrics
- Status Categories:
- ๐ข Healthy (Score โฅ 8)
- ๐ก Moderate (Score 5-7)
- ๐ด Stressed (Score < 5)
- Personalized Recommendations: AI-driven health advice including:
- Stress management techniques
- Sleep optimization tips
- Heart rate regulation guidance
- Activity level recommendations
- Interactive Visualizations: Live trend charts with mental health score and stress level tracking
- Elegant UI: SwasthAI color palette (#003049, #669bbc, #780000, #c1121f, #fdf0d5) with Framer Motion animations
- Glowing Effects: Hover effects on cards, smooth transitions, and animated health indicators
- Predicts the demand for medicines in specific areas, ensuring better supply chain management
- Helps pharmacies stock essential drugs based on demand trends
- Uses historical data to predict potential disease outbreaks in particular regions
- Helps authorities take preventive action before diseases spread
GramSwasth is built using modern, scalable technologies:
- Frontend: React, Next.js, TypeScript, Framer, Vercel
- Backend: Flask, JavaScript, Python
- AI/ML: aiXplain custom agents, Google Maps integration
- Clone the repository
git clone https://github.com/yourusername/gram-aarogya.git
cd gram-aarogya- Set up environment variables in a
.envfile:
TEAM_API_KEY=your_team_api_key
GOOGLE_MAPS_API_KEY=your_google_maps_api_key
DOC_MODEL_ID=your_doc_model_id
SUMM_MODEL_ID=your_summ_model_id
NEWS_MODEL_ID=your_news_model_id
AGENT_MODEL_ID=your_agent_model_id
- Install dependencies
pip install -r requirements.txt- Run the application
python backend.pyPOST /ask
Body:
{
"question": "What are the symptoms of dengue?"
}POST /doctors
Body:
{
"condition": "diabetes",
"location": "Mumbai"
}POST /health-centers
Body:
{
"latitude": 19.0760,
"longitude": 72.8777
}POST /news
Body:
{
"language": "hindi"
}- Internet Connectivity: Rural areas may face challenges with consistent internet access
- Digital Literacy: Some users may require training to navigate the app effectively
- Data Privacy: Ensuring user data security and compliance with healthcare regulations
- Language Accuracy: Achieving 100% accuracy in translations for all dialects is an ongoing challenge
- Real-Time Updates: Keeping healthcare facility information up-to-date in real-time
- aiXplain for AI model support & custom model creation
- Google Maps API for location services
Because everyone deserves good healthโanytime, anywhere.
For any questions or issues, please open an issue on GitHub: @Saadmadni84
Made with โค๏ธ and lots of โ