Skip to content

Butwal-Hacks/Team-Devi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

SwasthyaSathi - Healthcare Journey Manager

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.

Features

  • 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

Tech Stack

Frontend

  • Next.js 14
  • TypeScript
  • Tailwind CSS
  • Framer Motion (for subtle animations)

Backend

  • Django 4.2
  • Django REST Framework
  • SQLite Database
  • Google Gemini API

Project Structure

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

Installation & Setup

Prerequisites

  • Node.js 18+ and npm
  • Python 3.9+
  • pip

Backend Setup

  1. Navigate to the backend directory:
cd backend
  1. Create a virtual environment:
python -m venv venv
  1. Activate the virtual environment:
  • Windows:
venv\Scripts\activate
  • macOS/Linux:
source venv/bin/activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Configure environment variables: Edit backend/.env and add your Gemini API key:
GEMINI_API_KEY=your-gemini-api-key-here
  1. Run migrations:
python manage.py makemigrations
python manage.py migrate
  1. Create a superuser:
python manage.py createsuperuser
  1. Create sample data (optional):
python manage.py shell

Then 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()
  1. Start the Django development server:
python manage.py runserver

The backend API will be available at http://localhost:8000

Frontend Setup

  1. Navigate to the frontend directory:
cd frontend
  1. Install dependencies:
npm install
  1. Verify the API URL in .env.local:
NEXT_PUBLIC_API_URL=http://localhost:8000/api
  1. Start the development server:
npm run dev

The frontend will be available at http://localhost:3000

Usage

  1. Open http://localhost:3000 in your browser
  2. Login with demo credentials:
    • Email: admin@swasthyasathi.com
    • Password: admin123
  3. Browse hospitals, check crowd levels, and book appointments
  4. Use the AI Healthcare Helper for department suggestions
  5. Schedule visits and view them in "My Visits"

API Endpoints

Authentication

  • POST /api/auth/login/ - User login
  • POST /api/auth/register/ - User registration

Hospitals

  • GET /api/hospitals/ - List all hospitals
  • GET /api/hospitals/{id}/ - Get hospital details

Crowd Management

  • POST /api/crowd-checkin/ - Check in at hospital (updates crowd level)

Visit Scheduling

  • POST /api/schedule-visit/ - Schedule a new visit
  • GET /api/visits/ - Get user's scheduled visits
  • DELETE /api/visits/{id}/ - Cancel a visit

AI Helper

  • POST /api/ai-helper/ - Get AI suggestions for symptoms

Database Models

Hospital

  • name, address, phone, emergency_contact
  • opd_timings, latitude, longitude
  • Dynamic crowd_level and crowd_count properties

Department

  • hospital (FK), name, description

CrowdCheckIn

  • user (FK), hospital (FK), department, timestamp

ScheduledVisit

  • user (FK), hospital (FK), department
  • visit_date, time_range, status

Design Philosophy

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

Important Notes

  • 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

Development

Frontend Development

cd frontend
npm run dev

Backend Development

cd backendx
python manage.py runserver

Building for Production

Frontend:

cd frontend
npm run build
npm start

Backend:

cd backend
# Update .env: DEBUG=False
python manage.py collectstatic
# Deploy with gunicorn or similar WSGI server

License

This project is for demonstration purposes.

Support

For issues or questions, please refer to the documentation or create an issue in the repository.

About

Hospital Appointment booking system made simple with the help of AI ( Gemini).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors