A comprehensive healthcare appointment booking system built with React frontend and Node.js/Express backend with MongoDB database.
Health Plus is a modern web application that allows patients to:
- π Browse healthcare services and doctors
- π Book appointments online (voice/video consultations)
- π¬ Live Chat Bot with intelligent AI responses
- π§ Receive automated email confirmations
- π€ User authentication (Login/Signup)
- π Admin notifications for new appointments
- π± Fully responsive mobile-friendly design
- Technologies Used
- Prerequisites
- Project Structure
- Installation & Setup
- Running the Project
- Data Storage
- How It Works
- API Endpoints
- Email Features
- Live Chat Bot Features
- Security Features
- Troubleshooting
- Contact
- React.js - UI framework
- React Router - Navigation
- React Toastify - Notifications
- CSS3 - Styling
- Font Awesome - Icons
- Node.js - Runtime environment
- Express.js - Web framework
- MongoDB - Database
- Mongoose - ODM for MongoDB
- Nodemailer - Email service
- JWT - Authentication tokens
- bcryptjs - Password hashing
Before running this project, ensure you have:
- Node.js (v14 or higher)
- npm (Node Package Manager)
- MongoDB (local installation or MongoDB Atlas account)
- Gmail account (for email notifications)
Health-Plus-main/
βββ backend/
β βββ routes/
β β βββ chat.js # Live chat API routes
β βββ server.js # Main backend server
β βββ authMiddleware.js # JWT authentication middleware
β βββ emailService.js # Email sending service
β βββ .env # Environment variables (not in git)
β βββ .env.example # Example environment file
β βββ package.json # Backend dependencies
βββ frontend/
β βββ src/
β β βββ Components/ # React components
β β β βββ AppointmentForm.js
β β β βββ LiveChat.js # Live chat component
β β β βββ Login.js
β β β βββ Signup.js
β β β βββ Navbar.js
β β β βββ Footer.js
β β β βββ ...
β β βββ Styles/ # CSS files
β β β βββ LiveChat.css # Chat component styles
β β β βββ ...
β β βββ Pages/ # Page components
β β βββ Assets/ # Images and media
β βββ public/ # Static files
β βββ package.json # Frontend dependencies
βββ .gitignore # Git ignore rules
βββ README.md # This file
For experienced developers who want to get started immediately:
# 1. Clone repository
git clone https://github.com/kishore0000123/Health-Plus-main.git
cd Health-Plus-main
# 2. Install backend dependencies
cd backend
npm install
# 3. Create .env file (copy from .env.example)
copy .env.example .env # Windows
# cp .env.example .env # Mac/Linux
# 4. Edit .env with your Gmail credentials and MongoDB URI
# 5. Start backend (in backend directory)
npm start
# 6. Open new terminal - Install frontend dependencies
cd ../frontend
npm install
# 7. Start frontend
npm start
# β
App opens at http://localhost:3000
# β
Backend runs at http://localhost:5001git clone https://github.com/kishore0000123/Health-Plus-main.git
cd Health-Plus-mainFrontend:
cd frontend
npm installBackend:
cd backend
npm installOption A: Local MongoDB
- Download and install MongoDB from: https://www.mongodb.com/try/download/community
- Start MongoDB service
- Database will be created automatically at:
mongodb://localhost:27017/healthplus
Option B: MongoDB Atlas (Cloud - Recommended)
- Create free account at: https://www.mongodb.com/cloud/atlas
- Create a cluster
- Get connection string
- Update in
.envfile
Create a .env file in the backend folder:
cd backend
copy .env.example .env # On Windows
# or
cp .env.example .env # On Mac/LinuxEdit backend/.env with your credentials:
PORT=5001
MONGODB_URI=mongodb://localhost:27017/healthplus
EMAIL_SERVICE=gmail
EMAIL_USER=your-email@gmail.com
EMAIL_PASSWORD=your-16-char-app-password
ADMIN_EMAIL=your-admin-email@gmail.com
JWT_SECRET=your-secret-key-here.env file to GitHub. It's already in .gitignore.
For email notifications to work:
- Enable 2-Factor Authentication on your Gmail account
- Go to: https://myaccount.google.com/apppasswords
- Generate App Password for "Health Plus"
- Copy the 16-character password
- Paste it in
EMAIL_PASSWORDin.envfile
cd backend
node server.jsBackend will run on: http://localhost:5001
You should see:
π Server running on port 5001
β
MongoDB Connected Successfully
β
Email server is ready to send messages
Open a new terminal and run:
cd frontend
npm startFrontend will run on: http://localhost:3000
The browser will automatically open the application.
Database Name: healthplus
Collections:
Stores all patient appointment data:
{
_id: ObjectId, // Auto-generated unique ID
patientName: String, // Min 8 characters
patientNumber: String, // 10 digits
patientEmail: String, // Optional, for confirmations
patientGender: String, // 'male', 'female', or 'private'
appointmentTime: Date, // Future date/time
preferredMode: String, // 'voice' or 'video'
status: String, // 'pending', 'confirmed', 'cancelled', 'completed'
createdAt: Date // Auto-generated timestamp
}Stores registered user accounts:
{
_id: ObjectId,
name: String, // User full name
email: String, // Unique email address
password: String, // Hashed with bcrypt
phone: String, // Optional phone number
role: String, // 'patient', 'doctor', 'admin'
createdAt: Date
}Data Location:
- Local MongoDB:
C:\Program Files\MongoDB\Server\{version}\data\(Windows) - MongoDB Atlas: Cloud storage (accessible from anywhere)
User visits site β Clicks "Sign up" β Fills registration form β
Backend validates data β Password hashed β User saved to MongoDB β
JWT token generated β User logged in
User clicks "Book Appointment" β
Fills appointment form (name, phone, email, gender, date/time, mode) β
Frontend validates inputs β
Sends POST request to backend API β
Backend validates data β
Appointment saved to MongoDB (status: 'confirmed') β
Email sent to patient (if email provided) β
Email notification sent to admin β
Success response to frontend β
Toast notification shown β
Form reset
Appointment created β
emailService.js triggered β
Connects to Gmail via SMTP β
Generates HTML email with appointment details β
Sends confirmation email to patient (if email provided) β
Sends notification email to admin/doctor β
Emails include: patient name, date/time, mode, contact info β
Confirmations logged in backend
User clicks "Live Chat" button β
Chat window opens (bottom-right corner) β
User types message β
Frontend sends POST to /api/chat β
Backend processes message with AI logic β
Smart response generated based on keywords β
Response sent back to frontend β
Chat displays bot reply with animation
Admin/Doctor requests appointments β
GET /api/appointments called β
Backend queries MongoDB β
Returns sorted appointments (newest first) β
Frontend displays in dashboard
GET http://localhost:5001/api/health
Response: { success: true, message: "Server is running" }
Register User
POST /api/auth/register
Body: { name, email, password, phone }
Response: { success, token, user }
Login User
POST /api/auth/login
Body: { email, password }
Response: { success, token, user }
Get Current User (Protected)
GET /api/auth/me
Headers: { Authorization: Bearer <token> }
Response: { success, user }
Send Chat Message
POST /api/chat
Body: { message: "your message here" }
Response: {
success: true,
reply: "bot response",
timestamp: "2026-02-21T10:30:00Z"
}
Supported Queries:
- Appointment booking
- Doctor information
- Services offered
- Contact details
- Operating hours
- Emergencies
- Pricing information
Get All Appointments
GET /api/appointments
Response: { success, data: [...appointments] }
Get Single Appointment
GET /api/appointments/:id
Response: { success, data: {...appointment} }
Create Appointment
POST /api/appointments
Body: {
patientName,
patientNumber,
patientEmail (optional),
patientGender,
appointmentTime,
preferredMode
}
Response: {
success,
data,
emailSent: boolean,
adminNotified: boolean
}
Update Appointment Status
PATCH /api/appointments/:id
Body: { status: "confirmed" | "cancelled" | "completed" }
Response: { success, data }
Delete Appointment
DELETE /api/appointments/:id
Response: { success, message }
When a patient provides an email during appointment booking:
β Automatic confirmation email sent β Professional HTML template β Includes:
- Patient name
- Appointment date & time (formatted)
- Preferred consultation mode (Voice/Video)
- Contact information
- Status confirmation
For every new appointment created:
β Instant notification to admin β Detailed patient information β Includes:
- Full patient details (name, email, phone, gender)
- Appointment date & time
- Preferred consultation mode
- Action required alert
- Timestamp of registration
Email sent via:
- Gmail SMTP server
- Nodemailer library
- Secure app password authentication
- Password Hashing: bcryptjs (10 salt rounds)
- JWT Tokens: 7-day expiration
- Environment Variables: Sensitive data not in code
- Input Validation: Both frontend and backend
- CORS Enabled: Controlled cross-origin requests
- .gitignore: Prevents
.envfrom being pushed to GitHub
# Check if port 5001 is already in use
netstat -ano | findstr :5001
# Kill the process (Windows)
taskkill /PID <process_id> /F
# Or change port in backend/.env
PORT=5002
# Restart backend
cd backend
node server.js- Ensure MongoDB service is running
- Check
MONGODB_URIin.envfile - Verify MongoDB is installed correctly
- For Atlas: Check IP whitelist and credentials
- Verify Gmail app password (16 characters, no spaces)
- Check 2FA is enabled on Gmail account
- Ensure
EMAIL_USERandEMAIL_PASSWORDare correct in.env - Ensure
ADMIN_EMAILis set in.env - Check Gmail security settings
- Ensure backend is running on port 5001
- Check browser console (F12) for CORS errors
- Verify API URLs use correct port (5001) in React components
- Clear browser cache and restart
- Verify backend is running
- Check
/api/chatendpoint is accessible - Open browser console for error messages
- Ensure port 5001 is used in LiveChat.js
- Try refreshing the page
- Start both backend and frontend servers
- Navigate to homepage
- Click "Book Appointment" button
- Fill in the form:
- Patient Name (min 8 characters)
- Phone Number (10 digits)
- Email (optional, for confirmations)
- Select gender
- Choose date/time (future date)
- Select voice or video mode
- Submit and check:
- Success toast notification appears
- Email received (if email provided)
- Admin receives notification email
- Check MongoDB for saved appointment
- Click "Live Chat" button in navbar
- Chat window opens bottom-right
- Try these test messages:
- "How do I book an appointment?"
- "What doctors are available?"
- "Contact information"
- "What are your services?"
- Verify bot responds instantly
- Check browser console for any errors
- Click "Login" or "Signup"
- Register new account:
- Provide name, email, password, phone
- Verify success message
- Check you're redirected and logged in
- Logout and login again
- Verify JWT token in localStorage
# Test Health Check
curl http://localhost:5001/api/health
# Test Chat Endpoint
curl -X POST http://localhost:5001/api/chat \
-H "Content-Type: application/json" \
-d '{"message":"doctor"}'
# Test Appointments
curl http://localhost:5001/api/appointmentsThe live chat bot provides smart, context-aware responses for common queries:
- Appointments: "How do I book an appointment?"
- Doctors: "What specialists are available?"
- Services: "What services do you offer?"
- Contact: "How can I reach you?"
- Emergencies: "I have a medical emergency"
- Hours: "When are you available?"
- Pricing: "How much does a consultation cost?"
- π¨ Beautiful animated interface
- π± Fully responsive on mobile devices
- β‘ Real-time message delivery
- π€ Typing indicators
- β±οΈ Message timestamps
- π Quick question buttons
- π― Auto-scroll to latest message
- β Easy close/open functionality
- Click "Live Chat" button in navigation bar
- Chat window appears in bottom-right corner
- Type message or click quick questions
- Instant AI-powered responses
- Helpful guidance for all queries
- Backend automatically creates database and collections
- First appointment booking creates the
appointmentscollection - First user registration creates the
userscollection - All timestamps are stored in UTC
- Passwords are never stored in plain text
- Live chat responses are processed server-side
- Email templates use HTML for professional formatting
- Kishore Kiran - Full Stack Developer
- π§ Email: support@healthplus.com | appointment@healthplus.com
- π Phone: +022 5454 5252 | +022 2326 6232
- π LinkedIn: Kiran Kishore
- πΌ GitHub: kishore0000123
- π Live Demo: Health Plus Main
Β© 2026 Health+. All rights reserved.
- React community for excellent documentation and support
- MongoDB for robust database solutions
- Nodemailer for reliable email service integration
- Font Awesome for beautiful icons
- Express.js for powerful backend framework
β
User Authentication (JWT-based)
β
Appointment Booking System
β
Live Chat Bot with AI responses
β
Email Notifications (Patient + Admin)
β
Responsive Mobile Design
β
Real-time Data Management
β
Secure Password Hashing
β
MongoDB Database Integration
β
Professional UI/UX Design
β
CORS-enabled API
Built with β€οΈ by Kishore Kiran