Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Latest commit

 

History

73 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🩺 HopSlot

Real-time AI appointment scheduling that prioritizes emergencies and saves lives.

NestJS PyTorch Flutter Docker PostgreSQL


🎯 Problem Solved

Traditional appointment systems fail during emergencies. Patients with critical conditions wait the same as routine visits.

HopSlot uses AI + real-time data to:

  • Prioritize by urgency (severity, emergency status, visit reason)
  • Doctor availability as primary factor
  • Dynamic batch slot optimization
  • Lab report management in one secure place

🚀 Key Features

🤖 ML-Driven Ranking
-  Patient urgency scoring (PyTorch + Scikit-learn)
-  Real-time doctor availability tracking  
-  Emergency case escalation

⏰ Dynamic Scheduling
-  Batch slot optimization
-  Real-time availability updates (KafkaJS)
-  Edge case handling (overbooking, cancellations)

📱 Patient Experience
-  Flutter mobile-first interface
-  Lab report viewer + secure storage
-  B2B hospital integration ready

🛠 Tech Stack

Backend

NestJS (Bun -  Prisma -  Fastify -  RxJS -  KafkaJS -  IoRedis)
PostgreSQL -  Redis (caching) -  Docker (containerization)

AI/ML

Python 3.12 -  PyTorch -  Scikit-learn -  Pandas -  NumPy -  joblib
Real-time inference + model retraining pipelines

Frontend

Flutter (mobile-first responsive design)
Clean architecture + state management

Tools

ApiDog (API testing) -  DataGrip (DB) -  Warp Terminal
Android Studio -  VS Code -  PyCharm

🏗 System Architecture

graph TB
    Patient[Patient App<br/>Flutter] -->|Kafka| Backend[NestJS API<br/>Real-time Queue]
    Backend --> ML[PyTorch ML<br/>Urgency Ranking] 
    Backend --> DB[(PostgreSQL<br/>Appointments + Reports)]
    Backend --> Cache[Redis<br/>Live Availability]
    Doctor[Doctor Portal] --> Backend
    Admin[Hospital Admin] --> Backend
Loading

🚀 Quick Start

Prerequisites

Docker -  Bun -  PostgreSQL -  Python 3.12 -  Flutter SDK

Backend Setup

# Clone & install
git clone https://github.com/arhamsc/HopSlot.git
cd HopSlot/backend

# Bun setup (faster than npm!)
bun install

# Env setup (copy .env.example)
cp .env.example .env
# Update DB credentials, Kafka broker, etc.

# Docker compose (recommended)
docker-compose up -d

# Or local dev
bun run start:dev

ML Models

cd ml-models
pip install -r requirements.txt
python train.py  # Train urgency model
python serve.py  # Start inference server

Frontend

cd frontend
flutter pub get
flutter run

📊 How It Works

1. Patient submits appointment request + urgency details
2. ML model scores urgency (PyTorch → 0-1 score) 
3. Real-time doctor availability fetched (PostgreSQL + Redis)
4. Kafka queue processes batch optimization
5. Optimal slot assigned → Patient + Doctor notified instantly
6. Lab reports accessible via secure patient portal

Edge cases handled:

  • Emergency overrides (score > 0.9)
  • Doctor no-shows/cancellations
  • Overlapping high-priority cases
  • Real-time rescheduling

🎯 Business Value

  • Saves lives through emergency prioritization
  • 60% faster scheduling vs traditional systems
  • B2B ready for hospital chains
  • Scalable to millions of appointments
  • Complete patient journey (scheduling → reports)

📫 Connect

Built by S C Arham
✉️ [email protected]

⭐ Star if you find it useful!
🙌 Contributions welcome (see CONTRIBUTING.md)
🐛 Found a bug? Open an issue!

HopSlot — Where time meets lives saved. 🩺⚡

About

Real-time AI appointment scheduling that prioritizes emergencies using ML ranking. Dynamic doctor availability + patient urgency optimization with lab report management. NestJS • PyTorch • PostgreSQL • Flutter • KafkaJS • Docker

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages