SwasthyaSathi is a full-stack web application that helps users choose the right hospital and department, check real-time crowd levels, and plan their healthcare visits using AI assistance and community-driven crowd signals.
- Hospital Search: Browse nearby hospitals with department availability and OPD timings
- Crowd Level Tracking: Real-time crowd updates from community check-ins
- AI Healthcare Helper: Get department suggestions based on symptoms (powered by Gemini API)
- Visit Scheduling: Plan hospital visits and receive reminders
- Visit Management: Track upcoming and past visits with hospital contact information
- Responsive Design: Mobile-first, fully responsive interface
- Visual Hierarchy: Step-by-step guidance with icons for hospital visit planning
- Next.js 14
- TypeScript
- Tailwind CSS
- Framer Motion (for subtle animations)
- Django 4.2
- Django REST Framework
- SQLite Database
- Google Gemini API
swastha-sathi/
├── frontend/
│ ├── app/
│ │ ├── page.tsx # Landing page with hero section, how-it-works, features
│ │ ├── login/page.tsx # User login page
│ │ ├── signup/page.tsx # User registration page
│ │ ├── dashboard/page.tsx # Main dashboard with hospital list and crowd levels
│ │ ├── schedule-visit/page.tsx # Visit scheduling interface
│ │ ├── my-visits/page.tsx # User's scheduled visits management
│ │ ├── layout.tsx # Root layout with favicon configuration
│ │ └── globals.css # Global styles with Tailwind CSS
│ ├── public/
│ │ ├── swasthyadevi.png # App logo
│ │ ├── budabudi.jpg # Hero section image
│ │ └── logofinalswsv.png # Favicon
│ ├── package.json
│ ├── tsconfig.json
│ ├── tailwind.config.ts
│ └── next.config.js
│
└── backend/
├── api/
│ ├── models.py # Hospital, Department, CrowdCheckIn, ScheduledVisit models
│ ├── serializers.py # DRF serializers for API responses
│ ├── views.py # API views and endpoints
│ ├── urls.py # API routes configuration
│ ├── services.py # Business logic and utilities
│ └── admin.py # Django admin configuration
├── swasthyasathi/
│ ├── settings.py # Django settings and configuration
│ ├── urls.py # Main URL routing
│ ├── asgi.py # ASGI configuration
│ └── wsgi.py # WSGI configuration
├── manage.py
├── requirements.txt
├── db.sqlite3
└── .env
- Node.js 18+ and npm
- Python 3.9+
- pip
- Navigate to the backend directory:
cd backend- Create a virtual environment:
python -m venv venv- Activate the virtual environment:
- Windows:
venv\Scripts\activate- macOS/Linux:
source venv/bin/activate- Install dependencies:
pip install -r requirements.txt- Configure environment variables:
Edit
backend/.envand add your Gemini API key:
GEMINI_API_KEY=your-gemini-api-key-here- Run migrations:
python manage.py makemigrations
python manage.py migrate- Create a superuser:
python manage.py createsuperuser- Create sample data (optional):
python manage.py shellThen in the Python shell:
from django.contrib.auth.models import User
from api.models import Hospital, Department
# Create demo user
user = User.objects.create_user(
username='admin',
email='admin@swasthyasathi.com',
password='admin123',
first_name='Admin',
last_name='User'
)
# Create sample hospitals
h1 = Hospital.objects.create(
name='City General Hospital',
address='123 Main Street, City Center',
phone='+91-123-456-7890',
emergency_contact='+91-123-456-7899',
opd_timings='8:00 AM - 6:00 PM'
)
h2 = Hospital.objects.create(
name='Apollo Medical Center',
address='456 Park Avenue, Downtown',
phone='+91-987-654-3210',
emergency_contact='+91-987-654-3219',
opd_timings='9:00 AM - 8:00 PM'
)
# Create departments
departments = ['Cardiology', 'Orthopedics', 'General Medicine', 'Pediatrics', 'ENT']
for dept_name in departments:
Department.objects.create(hospital=h1, name=dept_name)
Department.objects.create(hospital=h2, name=dept_name)
print("Sample data created!")
exit()- Start the Django development server:
python manage.py runserverThe backend API will be available at http://localhost:8000
- Navigate to the frontend directory:
cd frontend- Install dependencies:
npm install- Verify the API URL in
.env.local:
NEXT_PUBLIC_API_URL=http://localhost:8000/api- Start the development server:
npm run devThe frontend will be available at http://localhost:3000
- Open
http://localhost:3000in your browser - Login with demo credentials:
- Email:
admin@swasthyasathi.com - Password:
admin123
- Email:
- Browse hospitals, check crowd levels, and book appointments
- Use the AI Healthcare Helper for department suggestions
- Schedule visits and view them in "My Visits"
POST /api/auth/login/- User loginPOST /api/auth/register/- User registration
GET /api/hospitals/- List all hospitalsGET /api/hospitals/{id}/- Get hospital details
POST /api/crowd-checkin/- Check in at hospital (updates crowd level)
POST /api/schedule-visit/- Schedule a new visitGET /api/visits/- Get user's scheduled visitsDELETE /api/visits/{id}/- Cancel a visit
POST /api/ai-helper/- Get AI suggestions for symptoms
- name, address, phone, emergency_contact
- opd_timings, latitude, longitude
- Dynamic crowd_level and crowd_count properties
- hospital (FK), name, description
- user (FK), hospital (FK), department, timestamp
- user (FK), hospital (FK), department
- visit_date, time_range, status
SwasthyaSathi follows a healthcare-grade, government-adjacent design approach:
- Clean, minimal interface
- Trustworthy and calm aesthetics
- Flat UI with subtle shadows
- Limited, purposeful animations
- High readability and accessibility
- Information-first design
- This is a real appointment booking system for now only user side site is built the hospital/admi site needs building.
- This is NOT a medical diagnosis tool
- Always consult healthcare professionals for medical advice
- The AI helper provides suggestions only, not diagnoses
- Crowd levels are community-driven estimates
cd frontend
npm run devcd backendx
python manage.py runserverFrontend:
cd frontend
npm run build
npm startBackend:
cd backend
# Update .env: DEBUG=False
python manage.py collectstatic
# Deploy with gunicorn or similar WSGI serverThis project is for demonstration purposes.
For issues or questions, please refer to the documentation or create an issue in the repository.