Live Demo: scanmitra.onrender.com
ScanMitra is a state-of-the-art, full-stack diagnostic booking and real-time queue management platform. It bridge the gap between patients and diagnostic centers, providing transparency, reducing wait times, and automating complex hospital-grade workflows.
- Discover Centers: Search and browse verified diagnostic centers with detailed service listings.
- 80/20 Smart Booking: Reserved online slots ensure you always have a place, while walk-in support keeps the center efficient.
- Live Queue Tracking: Watch your position in the queue move in real-time with dynamic ETA updates.
- Smart Notifications: Persistent alerts for delay reports and automated "Missed Slot" re-booking prompts.
- Medical Records: Securely manage your past bookings and diagnostic reports.
- Real-time Dashboard: A powerful "Air Traffic Control" style dashboard to manage live patients.
- Queue State Machine: Sophisticated transitions (Call Next, In-Progress, Skip, Complete) with automated token handling.
- Walk-in Support: Seamlessly add on-site patients into the 20% reserved walk-in slots with overflow logic.
- Delay Broadcasting: Instantly notify all waiting patients of any operational delays via WebSockets.
- Automated Scheduling: Missed slots are automatically detected and marked after 30 minutes.
- Framework: Next.js 14 (App Router & Server Actions)
- Runtime: Node.js with a custom
server.tsfor native WebSocket support. - Real-time: Socket.io for bi-directional event streaming.
- Database: Prisma + PostgreSQL (Neon).
- Background Jobs: BullMQ + Upstash Redis for distributed task scheduling.
- Authentication: NextAuth.js with multi-role RBAC.
- Storage: Cloudinary for medical document handling.
- Styling: Tailwind CSS with Premium Glassmorphism UI.
- Node.js 18+
- A Redis instance (Upstash recommended)
- A PostgreSQL database (Neon recommended)
Create a .env file in the root directory:
DATABASE_URL="postgresql://..."
NEXTAUTH_SECRET="your_secret"
NEXTAUTH_URL="http://localhost:3000"
# Redis (BullMQ + Caching)
UPSTASH_REDIS_URL="rediss://..."
UPSTASH_REDIS_REST_URL="https://..."
UPSTASH_REDIS_REST_TOKEN="..."
# Cloudinary
CLOUDINARY_CLOUD_NAME="..."
CLOUDINARY_API_KEY="..."
CLOUDINARY_API_SECRET="..."# Install dependencies
npm install
# Generate Prisma Client
npx prisma generate
# Push Schema to DB
npx prisma db push
# Start Development Server
npm run devScanMitra requires a persistent Node.js process for Socket.io to function correctly. Standard serverless platforms (like Vercel) are not recommended.
Deployed on Render: https://scanmitra.onrender.com/
- Connect your GitHub repo to Render/Railway.
- Ensure the build command is:
npm install && npx prisma generate && npm run build. - Ensure the start command is:
node dist/server.jsortsx server.ts. - Add your environment variables in the dashboard.
Detailed technical documentation, including API routes and architecture, can be found in DOCUMENTATION.md.
This project is licensed under the MIT License.