Skip to content

jhaayushkumar/Appointment-Booking-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

79 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ₯ Smart Appointment Booking System

React Node.js Express.js Prisma MySQL

College Group Project - A comprehensive web-based healthcare platform for managing medical appointments between patients, doctors, and administrators.

πŸ“‹ Table of Contents

🎯 Project Overview

The Smart Appointment Booking System is a modern, full-stack web application designed to revolutionize healthcare appointment management. This system provides a seamless experience for patients to book appointments, doctors to manage their schedules, and administrators to oversee the entire platform.

🎯 Problem Statement

Traditional appointment booking systems are often inefficient, leading to:

  • Long waiting times for patients
  • Poor communication between patients and doctors
  • Difficulty in managing schedules
  • Lack of digital prescription management

πŸ’‘ Our Solution

A comprehensive digital platform that:

  • Streamlines the appointment booking process
  • Provides role-based access for different user types
  • Enables digital prescription management
  • Offers real-time appointment tracking
  • Ensures secure user authentication

πŸ‘₯ College Project Information

πŸŽ“ Academic Details

  • Course: B.tech CSE & AI-ML
  • Project Type: Group Project (Full Stack Development)
  • Duration: 3 Months
  • Academic Year: 2025

πŸ‘¨β€πŸ’» Team Members

Name Role Responsibilities
Pratik Kumar Pan Frontend Developer React.js, UI/UX Design
Adarsh Priydarshi & Ayush Kumar Jha Backend Developer Node.js, API Development
Devendra Mishra Database Designer Prisma, MySQL Schema
Ayush Kumar Jha & Adarsh Priydarshi Project Manager Documentation, Testing

🎯 Learning Objectives

  • Master full-stack web development
  • Understand database design and relationships
  • Implement secure authentication systems
  • Learn API development and integration
  • Practice collaborative development using Git

✨ Key Features

πŸ” Authentication & Security

  • JWT-based secure authentication
  • Role-based access control (RBAC)
  • Password encryption using bcrypt
  • Protected routes and middleware

πŸ‘¨β€βš•οΈ Doctor Management

  • Personal dashboard with appointment overview
  • Availability slot management
  • Patient history access
  • Digital prescription creation
  • Appointment confirmation/rejection

πŸ‘€ Patient Management

  • Browse available doctors by specialization
  • Real-time slot availability checking
  • Easy appointment booking interface
  • Appointment history tracking
  • Prescription download functionality

πŸ§‘β€πŸ’Ό Admin Panel

  • User management (approve/suspend accounts)
  • System analytics and reporting
  • Doctor and patient oversight
  • Platform configuration settings

πŸ“… Appointment System

  • Three-stage appointment lifecycle:
    • 🟑 Pending - Newly booked appointments
    • 🟒 Confirmed - Doctor-approved appointments
    • βœ… Completed - Finished consultations with prescriptions
  • Automatic email notifications
  • Cancellation management

πŸ’Š Prescription Management

  • Digital prescription creation by doctors
  • Secure prescription storage
  • PDF download functionality for patients
  • Prescription history tracking

πŸ—οΈ Project Structure

πŸ“ Appointment-Booking-System/
β”œβ”€β”€ πŸ“ backend/                    # Node.js Backend Server
β”‚   β”œβ”€β”€ πŸ“ src/
β”‚   β”‚   β”œβ”€β”€ πŸ“ config/            # Database & app configuration
β”‚   β”‚   β”œβ”€β”€ πŸ“ controllers/       # Route handlers & business logic
β”‚   β”‚   β”œβ”€β”€ πŸ“ middlewares/       # Authentication & validation
β”‚   β”‚   β”œβ”€β”€ πŸ“ routes/           # API route definitions
β”‚   β”‚   β”œβ”€β”€ πŸ“ services/         # Business logic services
β”‚   β”‚   β”œβ”€β”€ πŸ“ utils/            # Utility functions
β”‚   β”‚   β”œβ”€β”€ πŸ“„ app.js            # Express app configuration
β”‚   β”‚   └── πŸ“„ server.js         # Server entry point
β”‚   β”œβ”€β”€ πŸ“ prisma/
β”‚   β”‚   β”œβ”€β”€ πŸ“ migrations/       # Database migrations
β”‚   β”‚   └── πŸ“„ schema.prisma     # Database schema definition
β”‚   β”œβ”€β”€ πŸ“„ package.json         # Backend dependencies
β”‚   β”œβ”€β”€ πŸ“„ .env                 # Environment variables
β”‚   └── πŸ“„ .env.example         # Environment template
β”‚
β”œβ”€β”€ πŸ“ frontend/                  # React.js Frontend Application
β”‚   β”œβ”€β”€ πŸ“ src/
β”‚   β”‚   β”œβ”€β”€ πŸ“ components/       # Reusable React components
β”‚   β”‚   β”œβ”€β”€ πŸ“ pages/           # Page components
β”‚   β”‚   β”œβ”€β”€ πŸ“ hooks/           # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ πŸ“ context/         # React context providers
β”‚   β”‚   β”œβ”€β”€ πŸ“ utils/           # Frontend utilities
β”‚   β”‚   β”œβ”€β”€ πŸ“ assets/          # Images, icons, styles
β”‚   β”‚   └── πŸ“„ main.jsx         # React app entry point
β”‚   β”œβ”€β”€ πŸ“„ package.json         # Frontend dependencies
β”‚   β”œβ”€β”€ πŸ“„ vite.config.js       # Vite configuration
β”‚   └── πŸ“„ index.html           # HTML template
β”‚
β”œβ”€β”€ πŸ“„ README.md                 # Project documentation (this file)
β”œβ”€β”€ πŸ“„ idea.md                   # Project planning & ideas
└── πŸ“ .git/                    # Git version control

πŸ’» Tech Stack

🎨 Frontend

Technology Purpose Version
React UI Framework ^19.1.1
Vite Build Tool ^7.1.2
Axios HTTP Client ^1.12.2
React Router Routing ^7.9.1

βš™οΈ Backend

Technology Purpose Version
Node.js Runtime Environment Latest
Express Web Framework Latest
Prisma ORM ^6.16.3
JWT Authentication ^9.0.2
bcrypt Password Hashing ^6.0.0

πŸ—„οΈ Database

Technology Purpose
PostgreSQL Primary Database (Supabase)
Prisma Database ORM

πŸ› οΈ Development Tools

Tool Purpose
Git Version Control
ESLint Code Linting
Nodemon Development Server

βš™οΈ Installation & Setup

πŸ“‹ Prerequisites

Before you begin, ensure you have the following installed on your system:

  • Node.js Node.js (v18 or higher)
  • npm npm (v8 or higher)
  • MySQL MySQL (v8 or higher)
  • Git Git (latest version)

πŸ”§ Step-by-Step Installation

1️⃣ Clone the Repository

# Clone the project repository
git clone https://github.com/your-username/Appointment-Booking-System.git

# Navigate to the project directory
cd Appointment-Booking-System

2️⃣ Backend Setup

# Navigate to backend directory
cd backend

# Install backend dependencies
npm install

# Create environment file from template
cp .env.example .env

3️⃣ Configure Environment Variables

Edit the .env file in the backend directory:

# Database Configuration
DATABASE_URL="mysql://username:password@localhost:3306/appointment_booking"

# JWT Secret (use a strong, random string)
JWT_SECRET="your-super-secret-jwt-key-here"

# Server Configuration
PORT=5000
NODE_ENV=development

# Email Configuration (optional)
EMAIL_HOST="smtp.gmail.com"
EMAIL_PORT=587
EMAIL_USER="[email protected]"
EMAIL_PASS="your-app-password"

4️⃣ Database Setup

# Generate Prisma client
npx prisma generate

# Run database migrations
npx prisma migrate dev

# (Optional) Seed the database with sample data
npx prisma db seed

5️⃣ Frontend Setup

# Navigate to frontend directory (from project root)
cd frontend

# Install frontend dependencies
npm install

πŸš€ How to Run

πŸ–₯️ Development Mode

πŸ”§ Start Backend Server

# In the backend directory
cd backend
npm install
npm run dev

The backend server will start on http://localhost:3000

🎨 Start Frontend Application

# In a new terminal, navigate to frontend directory
cd frontend
npm install
npm run dev

The frontend application will start on http://localhost:5173

🌐 Access the Application

πŸ—οΈ Production Build

Backend Production

cd backend
npm install
npx prisma generate
npx prisma migrate deploy
npm start

Frontend Production

cd frontend
npm install
npm run build
npm run preview

πŸš€ Deployment

πŸ“¦ Frontend Deployment (Vercel)

Prerequisites

  • Vercel account
  • GitHub repository connected

Steps

  1. Push your code to GitHub

    git push origin main
  2. Deploy to Vercel

    • Go to Vercel Dashboard
    • Click "New Project"
    • Import your GitHub repository
    • Configure:
      • Framework Preset: Vite
      • Root Directory: frontend
      • Build Command: npm run build
      • Output Directory: dist
    • Add Environment Variable:
      VITE_BACKEND=https://your-backend-url.onrender.com
      
    • Click "Deploy"

Alternative: Vercel CLI

cd frontend
npm install -g vercel
vercel login
vercel --prod

πŸ”§ Backend Deployment (Render)

Prerequisites

  • Render account
  • MySQL database (PlanetScale, Railway, or Render PostgreSQL)

Steps

  1. Create Web Service on Render

    • Go to Render Dashboard
    • Click "New +" β†’ "Web Service"
    • Connect your GitHub repository
    • Configure:
      • Name: appointment-booking-backend
      • Root Directory: backend
      • Environment: Node
      • Build Command: npm install && npx prisma generate
      • Start Command: npm start
  2. Add Environment Variables

    NODE_ENV=production
    DATABASE_URL=mysql://user:password@host:3306/database
    JWT_SECRET=your-super-secret-jwt-key
    JWT_EXPIRES_IN=7d
    PORT=3000
  3. Run Migrations

    • After deployment, use Render Shell:
    npx prisma migrate deploy
    npx prisma db seed

πŸ—„οΈ Database Options

Option 1: PlanetScale (Recommended)

  • Free tier available
  • Serverless MySQL
  • No connection limits
  • Sign up here

Option 2: Railway

Option 3: Render PostgreSQL

  • Free tier available
  • Integrated with Render
  • Update schema.prisma to use PostgreSQL

βœ… Post-Deployment Checklist

  • Frontend deployed and accessible
  • Backend deployed and running
  • Database connected
  • Environment variables set
  • Migrations ran successfully
  • CORS configured for frontend domain
  • Test login functionality
  • Test appointment booking
  • Test all CRUD operations

πŸ‘€ User Roles

πŸ‘¨β€βš•οΈ Doctor Role

Login Credentials: [email protected] / password123

Capabilities:

  • πŸ“… View and manage daily appointments
  • ⏰ Set availability slots
  • βœ… Confirm or reject appointment requests
  • πŸ’Š Create and manage prescriptions
  • πŸ‘₯ View patient history and details
  • πŸ“Š Access appointment analytics

πŸ‘€ Patient Role

Login Credentials: [email protected] / password123

Capabilities:

  • πŸ” Browse doctors by specialization
  • πŸ“… View available appointment slots
  • πŸ“ Book new appointments
  • πŸ“‹ View appointment history
  • πŸ’Š Download prescriptions
  • ✏️ Update profile information

πŸ§‘β€πŸ’Ό Admin Role

Login Credentials: [email protected] / password123

Capabilities:

  • πŸ‘₯ Manage all users (patients & doctors)
  • βœ… Approve or suspend user accounts
  • πŸ“Š View system analytics and reports
  • βš™οΈ Configure system settings
  • πŸ—„οΈ Manage database records
  • πŸ“§ Send system notifications

πŸ”— API Endpoints

πŸ” Authentication Routes

POST   /api/auth/register     # User registration
POST   /api/auth/login        # User login
POST   /api/auth/logout       # User logout
GET    /api/auth/profile      # Get user profile
PUT    /api/auth/profile      # Update user profile

πŸ‘¨β€βš•οΈ Doctor Routes

GET    /api/doctor/appointments     # Get doctor's appointments
POST   /api/doctor/slots           # Create availability slots
PUT    /api/doctor/slots/:id       # Update availability slot
DELETE /api/doctor/slots/:id       # Delete availability slot
POST   /api/doctor/prescription    # Create prescription
GET    /api/doctor/patients        # Get doctor's patients

πŸ‘€ Patient Routes

GET    /api/patient/doctors        # Get all doctors
GET    /api/patient/appointments   # Get patient's appointments
POST   /api/patient/book          # Book new appointment
PUT    /api/patient/appointments/:id # Update appointment
DELETE /api/patient/appointments/:id # Cancel appointment
GET    /api/patient/prescriptions  # Get patient's prescriptions

πŸ§‘β€πŸ’Ό Admin Routes

GET    /api/admin/users           # Get all users
PUT    /api/admin/users/:id       # Update user status
DELETE /api/admin/users/:id       # Delete user
GET    /api/admin/appointments    # Get all appointments
GET    /api/admin/analytics       # Get system analytics

πŸ“Š General Routes

GET    /api/specializations      # Get all medical specializations
GET    /api/appointments/:id     # Get specific appointment
PUT    /api/appointments/:id     # Update appointment status

πŸ“Έ Patient Screenshots

πŸ‘€ Patient Dashboard

Screenshot 2025-12-03 at 12 14 27β€―AM

πŸ” Login Page

Screenshot 2025-12-03 at 12 16 51β€―AM

πŸ” SignUp Page

Screenshot 2025-12-03 at 12 34 44β€―AM

πŸ‘€ Patient Appointments Page

Screenshot 2025-12-03 at 12 23 06β€―AM

πŸ‘€ Find a Doctor Page

Screenshot 2025-12-03 at 12 24 51β€―AM

πŸ‘€ Profile Page

Screenshot 2025-12-03 at 12 25 30β€―AM

πŸ“Έ Doctor Screenshots

πŸ‘¨β€βš•οΈ Doctor Dashboard Page

image

πŸ‘¨β€βš•οΈ Doctor Appointments Page

Screenshot 2025-12-03 at 12 47 34β€―AM

πŸ‘¨β€βš•οΈ Doctor Slot Page

Screenshot 2025-12-03 at 1 26 08β€―AM

πŸ‘¨β€βš•οΈ Doctor Patient Details Page

Screenshot 2025-12-03 at 12 49 09β€―AM

πŸ‘¨β€βš•οΈ Doctor Profile Page

Screenshot 2025-12-03 at 12 50 00β€―AM

ScreenRecording

WhatsApp.Video.2025-12-03.at.00.52.36.1.mp4

🀝 Contributing

We welcome contributions from all team members! Please follow these guidelines:

πŸ“ Development Workflow

  1. Create a new branch for your feature:

    git checkout -b feature/your-feature-name
  2. Make your changes and commit them:

    git add .
    git commit -m "Add: your descriptive commit message"
  3. Push to your branch:

    git push origin feature/your-feature-name
  4. Create a Pull Request on GitHub

πŸ“‹ Code Standards

  • Use meaningful variable and function names
  • Add comments for complex logic
  • Follow consistent indentation (2 spaces)
  • Test your code before committing
  • Update documentation when needed

πŸ› Bug Reports

If you find a bug, please create an issue with:

  • Clear description of the problem
  • Steps to reproduce
  • Expected vs actual behavior
  • Screenshots (if applicable)

πŸ“„ License

This project is created for educational purposes as part of our college coursework. All rights reserved to the team members.


πŸŽ“ Academic Submission Notes

πŸ“š Project Documentation

This project demonstrates our understanding of:

  • Full-stack web development principles
  • Database design and relationships
  • RESTful API development
  • User authentication and authorization
  • Frontend-backend integration
  • Version control with Git

πŸ† Key Achievements

  • βœ… Implemented secure user authentication
  • βœ… Created responsive user interfaces
  • βœ… Designed normalized database schema
  • βœ… Built RESTful API endpoints
  • βœ… Integrated frontend with backend
  • βœ… Implemented role-based access control

πŸ“ˆ Future Enhancements

  • πŸ“± Mobile application development
  • πŸ’³ Payment gateway integration
  • πŸ“§ Advanced email notification system
  • πŸ“Š Advanced analytics and reporting
  • πŸ”” Real-time notifications
  • 🌐 Multi-language support

🎯 Made with ❀️ by TheDevelopers.

⭐ If you found this project helpful, please give it a star!

GitHub stars GitHub forks

About

Hotel Booking Application

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5

Languages