Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

43 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🩺 Prescripto

Doctor Booking & Healthcare Management System

A modern, full-stack MERN platform for seamless doctor appointments, prescriptions, and clinic administration.

MongoDB Express.js React Node.js Vite Tailwind CSS Stripe Gemini AI

Features β€’ System Design β€’ Tech Stack β€’ Setup β€’ Deployment


πŸ”— Live Demo

Portal Link Description
πŸ‘€ Patient Portal doctors-booking-appointment.vercel.app Search doctors, book appointments, pay online, chat with AI
πŸ› οΈ Admin & Doctor Console doctors-booking-appointment-j23z.vercel.app Manage doctors, appointments, prescriptions & analytics

✨ Overview

Prescripto connects patients, doctors, and clinic administrators in one unified platform. Patients can discover doctors, book appointments, pay online, chat with an AI health assistant, and access digital prescriptions β€” while doctors and admins manage the entire clinical workflow from dedicated dashboards.

πŸ‘€ Patient Portal 🩻 Doctor Dashboard πŸ› οΈ Admin Console
Book, pay, chat, track Manage schedule & prescriptions Oversee doctors, payments, analytics

πŸš€ Key Features

πŸ‘€ User / Patient Portal

  • πŸ” Secure authentication with a global Route Guard
  • πŸ” Search & filter doctors by speciality β€” General Physician, Gynecologist, Dermatologist, Pediatrician, Neurologist, Gastroenterologist
  • πŸ“… Flexible appointment booking with real-time slot selection
  • πŸ’³ Dual payment modes β€” Pay at Clinic (Cash) or Online via Stripe
  • πŸ€– Interactive AI Chatbot powered by Gemini 2.5 Flash for symptom checks & recommendations
  • 🧾 Downloadable/printable digital prescriptions

πŸ› οΈ Admin Dashboard

  • πŸ“Š Analytics at a glance β€” total doctors, appointments, patients, recent bookings
  • πŸ‘¨β€βš•οΈ Manage doctors β€” add, edit experience/bio, update availability, or remove
  • πŸ“‹ View all appointments and update payment/cancellation status

🩻 Doctor Dashboard

  • πŸ—“οΈ Manage scheduled appointments β€” mark completed or cancel
  • πŸ’Š Issue digital prescriptions directly on an appointment
  • πŸ’° Monitor earnings and personal profile

πŸ—οΈ System Design

High-Level Architecture

flowchart TB
    subgraph Clients["πŸ–₯️ Client Applications"]
        A["Patient Portal<br/>React + Vite<br/>:5173"]
        B["Admin / Doctor Dashboard<br/>React + Vite<br/>:5174"]
    end

    subgraph Backend["βš™οΈ Backend β€” Node.js + Express (:4000)"]
        direction TB
        R["API Routes"] --> M["Auth Middlewares<br/>(JWT Route Guards)"]
        M --> C["Controllers<br/>Users β€’ Admin β€’ Doctors β€’ Chatbot"]
    end

    subgraph External["☁️ Third-Party Services"]
        D[("MongoDB Atlas<br/>via Mongoose ODM")]
        E["Cloudinary<br/>Image Hosting"]
        F["Stripe<br/>Payment Gateway"]
        G["Google Gemini 2.5 Flash<br/>AI Chatbot Engine"]
    end

    A -- "Axios / REST" --> R
    B -- "Axios / REST" --> R
    C --> D
    C --> E
    C --> F
    C --> G

    style A fill:#61DAFB,stroke:#333,color:#000
    style B fill:#61DAFB,stroke:#333,color:#000
    style Backend fill:#f5f5f5,stroke:#333
    style D fill:#4EA94B,stroke:#333,color:#fff
    style E fill:#3448C5,stroke:#333,color:#fff
    style F fill:#626CD9,stroke:#333,color:#fff
    style G fill:#8E75B2,stroke:#333,color:#fff
Loading

Appointment Booking Flow

sequenceDiagram
    actor P as Patient
    participant FE as Frontend (React)
    participant API as Backend API
    participant DB as MongoDB
    participant ST as Stripe

    P->>FE: Search doctor by speciality
    FE->>API: GET /api/doctor/list
    API->>DB: Fetch doctors
    DB-->>API: Doctor list
    API-->>FE: Return doctors
    P->>FE: Select doctor + slot
    FE->>API: POST /api/user/book-appointment
    API->>DB: Save appointment
    alt Pay Online
        FE->>API: POST /api/user/payment-stripe
        API->>ST: Create checkout session
        ST-->>P: Redirect to payment
        P->>ST: Complete payment
        ST-->>API: Payment confirmation
        API->>DB: Update payment status
    else Pay at Clinic
        API->>DB: Mark as "Pay at Clinic"
    end
    API-->>FE: Booking confirmed βœ…
    FE-->>P: Show confirmation
Loading

Core Data Model

erDiagram
    USER ||--o{ APPOINTMENT : books
    DOCTOR ||--o{ APPOINTMENT : accepts
    APPOINTMENT ||--o| PRESCRIPTION : generates
    ADMIN ||--o{ DOCTOR : manages

    USER {
        ObjectId _id
        string name
        string email
        string password
        string image
        object address
    }
    DOCTOR {
        ObjectId _id
        string name
        string speciality
        string degree
        number experience
        number fees
        boolean available
        object slotsBooked
    }
    APPOINTMENT {
        ObjectId _id
        ObjectId userId
        ObjectId docId
        string slotDate
        string slotTime
        boolean cancelled
        boolean payment
        boolean isCompleted
    }
    PRESCRIPTION {
        ObjectId _id
        ObjectId appointmentId
        string medicines
        string notes
        date issuedDate
    }
Loading

Repository / Module Layout

flowchart LR
    subgraph Backend["Backend/"]
        cfg["config/<br/>MongoDB & Cloudinary"]
        ctrl["controllers/<br/>API logic"]
        mid["middlewares/<br/>Auth & uploads"]
        mdl["models/<br/>Mongoose schemas"]
        rts["routes/<br/>Express endpoints"]
        seed["seed.js"]
        srv["server.js"]
    end
    subgraph FE["frontend/ β€” Patient Portal"]
    end
    subgraph AD["admin/ β€” Admin & Doctor Console"]
    end

    srv --> rts --> mid --> ctrl --> mdl --> cfg
    FE -.REST calls.-> srv
    AD -.REST calls.-> srv
Loading

πŸ› οΈ Tech Stack

Layer Technologies
Frontend & Admin React.js (Vite) Β· Tailwind CSS Β· React Router DOM Β· Axios Β· React Toastify
Backend Node.js Β· Express Β· MongoDB (Mongoose ODM)
Media Hosting Cloudinary β€” doctor & user profile pictures
Payments Stripe β€” secure online checkout with dynamic redirection
AI Google Gemini 2.5 Flash β€” NLP-powered virtual health assistant

πŸ“‚ Project Structure

β”œβ”€β”€ Backend/                 # Express API server
β”‚   β”œβ”€β”€ config/               # MongoDB & Cloudinary connectors
β”‚   β”œβ”€β”€ controllers/          # API business logic (users, admin, doctors, chatbot)
β”‚   β”œβ”€β”€ middlewares/          # Auth guards, file upload configs
β”‚   β”œβ”€β”€ models/                # Mongoose schemas
β”‚   β”œβ”€β”€ routes/                # Express API endpoints
β”‚   β”œβ”€β”€ seed.js                # Database initial seeder script
β”‚   └── server.js              # Entry point
β”œβ”€β”€ frontend/                # Patient portal client
└── admin/                   # Admin & Doctor dashboard client

βš™οΈ Environment Variables Setup

1. Backend (Backend/.env)

PORT=4000
MONGO_URI=your_mongodb_connection_string
CLOUDINARY_NAME=your_cloudinary_name
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_API_SECRET=your_cloudinary_api_secret
ADMIN_EMAIL=admin@prescripto.com
ADMIN_PASSWORD=your_admin_password
JWT_SECRET=your_jwt_secret_token
STRIPE_SECRET_KEY=your_stripe_secret_key
GEMINI_API_KEY=your_gemini_api_key

2. Patient Portal (frontend/.env)

VITE_BACKEND_URL='http://localhost:4000'   # Change to production URL when live

3. Admin Portal (admin/.env)

VITE_BACKEND_URL='http://localhost:4000'   # Change to production URL when live

πŸš€ Getting Started

1️⃣ Database Initialization (Seeding)

Pre-populate the database with 16 doctor profiles and Cloudinary-hosted images:

cd Backend
npm install
node seed.js

2️⃣ Run the Backend

npm run server

Runs at http://localhost:4000 using nodemon (auto-reloads on file changes).

3️⃣ Run the Frontend (Patient Portal)

cd ../frontend
npm install
npm run dev

Runs at http://localhost:5173.

4️⃣ Run the Admin / Doctor Console

cd ../admin
npm install
npm run dev

Runs at http://localhost:5174 (or next available port).


🌐 Production Deployment

Backend

  1. Deploy to Render, Railway, or AWS.
  2. Add all environment variables from Backend/.env to the platform's environment settings.
  3. Whitelist relevant IP addresses if your MongoDB cluster restricts access.

Frontend & Admin

  1. Deploy both as separate static sites on Vercel or Netlify.
  2. Set the root directory to frontend and admin respectively.
  3. Build command: npm run build Β· Output directory: dist.
  4. Set VITE_BACKEND_URL to your live backend URL (e.g. https://your-api.onrender.com).

Made with ❀️ using the MERN stack

About

πŸ₯ Doctor Appointment & Healthcare Management System (MERN Stack) The Doctor Appointment & Healthcare Management System is a web application developed using the MERN Stack and simplify healthcare appointment management. The system provides a secure, role-based platform for Patients, Doctors, and Administrators and efficient healthcare services.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages