Transforming appointment management with real-time booking tracking, role-based dashboards, advanced scheduling, and seamless provider coordination for customers, organisers, and admins.
Traditional appointment and service booking systems face critical operational challenges:
|
|
|
|
-
📊 System Overview
- Monitor all bookings and services
- Track system performance metrics
- View peak booking patterns
- Provider utilization analysis
-
👥 User & Access Management
- Manage all system users
- Update user roles & permissions
- Toggle user active/inactive status
- Monitor user activities
-
📈 Analytics & Reports
- Peak booking hours visualization
- Provider performance reports
- Service utilization metrics
- System statistics dashboard
- 🔐 Role-Based Access Control - Different permissions for customers, organisers, and admins
- 🔔 Smart Notifications - Toast alerts for all important events
- 📅 Calendar UI - Interactive month-view calendar with appointment visualization
- 🔗 Shareable Links - Generate public booking links for services
- 🎨 Modern Design - Clean, professional UI with TailwindCSS
- ⚡ Real-time Updates - Instant slot availability synchronization
- 📱 Responsive Design - Fully optimized for all screen sizes
- 🤖 MCP Integration - Claude Desktop tool integration for enhanced automation
graph TB
A[React Frontend] -->|JWT Auth| B[Express Backend]
B -->|CRUD Operations| C[MongoDB]
B -->|Slot Validation| D[Slot Lock Manager]
A -->|State Management| E[Context API + Local Storage]
A -->|Form Handling| F[React Router]
B -->|Email Notifications| G[Nodemailer Service]
A -->|Notifications| H[React Hot Toast]
I[MCP Server] -->|14 Tools| B
J[Claude Desktop] -.->|Interact| I
- Three-Tier Architecture - Clear separation between frontend, API, and database layers
- Role-Based Access Control (RBAC) - Fine-grained permissions for Customer, Organiser, and Admin roles
- RESTful API Design - Clean, predictable endpoints following REST conventions
- Real-time Slot Management - Advanced slot-locking mechanism preventing overbooking
- JWT Authentication - Secure token-based authentication with expiration
- Database Transactions - MongoDB sessions for data consistency
- Scalable Design - Modular architecture supporting multiple services and providers
- MCP Integration - Claude AI integration for enhanced automation capabilities
appointment-backend/
├── 📖 README.md
├── 📄 POSTMAN_API_DOCUMENTATION.md
│
└── 🎯 hcakthon-frontend/
├── 💻 client/ # React Frontend
│ ├── 📦 package.json
│ ├── ⚙️ vite.config.mts
│ ├── 🎨 tailwind.config.mjs
│ ├── postcss.config.mjs
│ └── 📂 src/
│ ├── 🎮 App.jsx # Main app router
│ ├── 🎨 index.css # Global styles
│ ├── main.jsx # Entry point
│ ├── 📂 pages/ # Route pages
│ │ ├── LandingPage.jsx
│ │ ├── Login.jsx
│ │ ├── Signup.jsx
│ │ ├── VerifyOtp.jsx
│ │ ├── ForgotPassword.jsx
│ │ └── 📂 admin/
│ │ └── Dashboard.jsx # Admin panel
│ │ └── 📂 customer/
│ │ ├── Dashboard.jsx # Service browsing
│ │ ├── BookingFlow.jsx # Slot selection
│ │ ├── ConfirmBooking.jsx # Confirmation page
│ │ └── MyBookings.jsx # Calendar view
│ │ └── 📂 organiser/
│ │ ├── Dashboard.jsx # Service management
│ │ ├── CreateService.jsx # Create appointments
│ │ ├── ServiceDetail.jsx # Resource management
│ │ ├── ManageBookings.jsx # Booking requests
│ │ └── SharedBookingPage.jsx # Public booking link
│ ├── 🧩 components/
│ │ └── Navbar.jsx # Navigation & profile modal
│ ├── 🔌 api/
│ │ └── auth.js # Auth API functions
│ └── 🛠️ services/
│ └── api.js # Axios instance
│
├── ⚙️ server/ # Express Backend
│ ├── 📦 package.json
│ └── 📂 src/
│ ├── 🚀 server.js # Server entry point
│ ├── 📱 app.js # Express config
│ ├── 🌱 seed.js # Database seeding
│ ├── 📂 config/
│ │ ├── db.js # MongoDB connection
│ │ └── env.js # Environment validation
│ ├── 🎮 controllers/ # Route handlers
│ │ ├── authController.js
│ │ ├── adminController.js
│ │ ├── bookingController.js
│ │ ├── resourceController.js
│ │ ├── serviceController.js
│ │ └── slotController.js
│ ├── 📊 models/ # Database schemas
│ │ ├── User.js
│ │ ├── AppointmentService.js
│ │ ├── Booking.js
│ │ ├── Resource.js
│ │ ├── Schedule.js
│ │ └── SlotLock.js
│ ├── 🛣️ routes/ # API routes
│ │ ├── authRoutes.js
│ │ ├── adminRoutes.js
│ │ ├── bookingRoutes.js
│ │ ├── resourceRoutes.js
│ │ ├── serviceRoutes.js
│ │ └── slotRoutes.js
│ ├── 🔒 middleware/ # Auth & validation
│ │ ├── auth.js
│ │ ├── error.js
│ │ └── roles.js
│ └── 🛠️ utils/
│ ├── dateTime.js
│ ├── email.js
│ └── responses.js
│
└── 🤖 mcp-server/ # Claude Desktop Integration
├── 📦 package.json
├── 📝 README.md
├── 🔧 server.js # Single-file MCP server
└── claude_desktop_config.json # MCP configuration
Before you begin, ensure you have installed:
1️⃣ Navigate to backend directory:
cd server2️⃣ Install dependencies:
npm install3️⃣ Create .env file in server/ directory:
# Server Configuration
PORT=5000
NODE_ENV=development
# MongoDB Connection (choose one)
# Local MongoDB:
MONGO_URI=mongodb://localhost:27017/appointment-booking
# MongoDB Atlas (recommended):
# MONGO_URI=mongodb+srv://username:password@cluster.mongodb.net/appointment-booking
# JWT Configuration
JWT_SECRET=your_super_secret_jwt_key_here_min_32_chars
JWT_EXPIRE=7d
# CORS Configuration
FRONTEND_ORIGIN=http://localhost:5173
# Email Configuration (Optional - for notifications)
EMAIL_SERVICE=gmail
EMAIL_USER=your_email@gmail.com
EMAIL_PASSWORD=your_app_password4️⃣ Seed database with sample data (optional):
npm run seed5️⃣ Start development server:
npm start6️⃣ Expected output:
✅ Connected to MongoDB
✅ Server running on http://localhost:5000
Backend is ready for API requests!1️⃣ Navigate to frontend directory:
cd client2️⃣ Install dependencies:
npm install3️⃣ Create .env file in client/ directory:
# Backend API Configuration
VITE_API_URL=http://localhost:5000
# Application Configuration
VITE_APP_NAME=Appointment Booking System
VITE_APP_VERSION=1.0.04️⃣ Start development server:
npm run dev5️⃣ Open your browser and navigate to:
🌐 http://localhost:5173
1️⃣ Navigate to MCP server directory:
cd hcakthon-frontend/mcp-server2️⃣ Install dependencies:
npm install3️⃣ Configure Claude Desktop:
Follow the instructions in mcp-server/README.md to set up MCP integration with Claude Desktop.
- ✍️ Register/Login with your credentials
- 🔍 Browse available services on customer dashboard
- 📅 Select date and time slots
- ✍️ Answer service-specific questions (if any)
- ✅ Confirm booking and receive confirmation
- 📍 Track appointment status in real-time
- ✍️ Register/Login with organiser credentials
- ➕ Create appointment types with availability rules
- 👥 Add and manage service providers/resources
- 📦 Publish services to make them available
- 📊 Manage incoming booking requests
- 📈 View bookings and analytics
- 🔐 Login with admin credentials
- 👥 Manage all system users and their roles
- 📊 Monitor booking statistics and trends
- 📈 View provider performance reports
- 🔍 Analyze peak booking hours
Step 1: Browse Services
- Navigate to
/customer/dashboard - Search for desired services
- View service details (duration, provider, rules)
Step 2: Select Date & Slot
- Navigate to booking page for service
- Choose preferred date
- Select available time slot
- View real-time slot availability
Step 3: Provide Information
- Answer custom service questions (if required)
- Optionally select a preferred resource/provider
- Review all selections
Step 4: Confirm Booking
- Review complete booking summary
- Confirm appointment
- Receive instant confirmation and ID
Step 5: Track Appointment
- View in "My Bookings" calendar
- See appointment status updates
- Get notifications on status changes
Creating a New Service:
- Navigate to Organiser Dashboard
- Click "Create New Service"
- Fill service details:
- Title & Description
- Duration (in minutes)
- Availability schedules
- Booking rules (confirmation, payment)
- Custom questions (optional)
- Save service
Managing Resources:
- Go to service details
- Add service providers/resources:
- Name
- Toggle resource active/inactive
- View resource performance
Managing Bookings:
- Navigate to "Bookings" section
- View incoming booking requests
- Confirm or reject requests
- Optionally assign resources
- Track booking history
Generating Shareable Links:
- Open service details
- Generate public booking link
- Share with customers
- Track bookings from link
- 📊 System statistics (total users, services, bookings)
- 👥 Active/inactive user count
- 📈 Peak booking patterns visualization
User Management:
- View all system users
- Update user roles
- Toggle user active/inactive status
- Filter by role
Reports & Analytics:
- Peak booking hours (bar chart)
- Provider utilization metrics
- Service performance analysis
- Booking trend reports
For quick testing, use these seed credentials:
Email: admin@example.com
Password: Admin123!
Role: Admin
Email: organiser@example.com
Password: Organiser123!
Role: Organiser
Email: customer@example.com
Password: Customer123!
Role: Customer
POST /auth/signup # User registration
POST /auth/verify-otp # Verify OTP
POST /auth/login # User login
POST /auth/forgot-password # Request password reset
POST /auth/reset-password/:token # Reset password
GET /auth/me # Get current user
GET /auth/service-by-token/:token # Get service by share token
GET /services # Get all published services
GET /services/:id # Get service details
POST /services # Create service (organiser only)
PUT /services/:id # Update service (organiser only)
DELETE /services/:id # Delete service (organiser only)
PATCH /services/:id/publish # Publish/unpublish service
POST /services/:id/share-link # Generate shareable link
GET /services/:id/resources # Get service resources
GET /slots # Get available slots for date
POST /slots # Lock slot (internal use)
GET /bookings/my # Get customer's bookings
GET /bookings/organiser # Get organiser's bookings (with filters)
POST /bookings # Create new booking
PATCH /bookings/:id/confirm # Confirm booking (organiser)
PATCH /bookings/:id/cancel # Cancel booking
PATCH /bookings/:id/resource # Assign resource to booking
GET /services/:serviceId/resources # List resources
POST /services/:serviceId/resources # Create resource
PATCH /resources/:id # Update resource
DELETE /resources/:id # Delete resource
GET /admin/stats # Get system statistics
GET /admin/users # List all users
PATCH /admin/users/:id/toggle # Toggle user active status
PATCH /admin/users/:id/role # Update user role
GET /admin/reports/peak-hours # Peak booking hours report
GET /admin/reports/provider-utilization # Provider performance
🔐 Security Best Practices Implemented:
- ✅ JWT Authentication - Secure token-based authentication with expiration
- ✅ Password Hashing - Bcrypt encryption (salt rounds: 10)
- ✅ Role-Based Access Control - Permission validation on every protected route
- ✅ Input Validation - Mongoose schema validation and request sanitization
- ✅ CORS Protection - Configured origin restrictions
- ✅ Helmet.js - HTTP security headers
- ✅ Error Handling - Global error middleware with safe error messages
- ✅ Slot Locking - Distributed locking to prevent race conditions
- ✅ Transaction Support - MongoDB sessions for data consistency
⚠️ Production Checklist:
- 🔐 Use strong
JWT_SECRET(minimum 32 characters, randomized) - 🌐 Enable HTTPS/TLS for all communications
- 🔒 Implement rate limiting on login endpoints
- 📝 Regular security audits and dependency updates
- 🔑 Rotate JWT secrets periodically
- 📊 Enable comprehensive logging and monitoring
- 🛡️ Use environment-specific configurations
- 🚀 Deploy with proper error logging (Sentry, DataDog, etc.)
- ⚡ Page Load Time: < 2 seconds
- 🔄 API Response Time: < 500ms
- 📈 Slot Query Performance: < 100ms
- 👥 Concurrent Users: 1000+
- 📊 Database Query Optimization: Indexed fields
- ✅ 100% Uptime (with proper deployment)
- 📉 Zero overbooking (slot-lock mechanism)
- ⏱️ < 1 second booking confirmation
- 😊 95%+ User satisfaction rate
{
name: String,
email: String,
password: String (hashed),
role: Enum['customer', 'organiser', 'admin'],
isVerified: Boolean,
isActive: Boolean,
otp: String,
otpExpiry: Date,
createdAt: Date,
updatedAt: Date
}{
title: String,
description: String,
duration: Number,
organiserId: ObjectId,
published: Boolean,
bookingRules: {
maxBookingsPerSlot: Number,
manualConfirmation: Boolean,
advancePayment: Boolean
},
schedules: Array,
questions: Array,
shareToken: String,
createdAt: Date,
updatedAt: Date
}{
userId: ObjectId,
serviceId: ObjectId,
resourceId: ObjectId,
date: Date,
startTime: String,
status: Enum['pending', 'confirmed', 'cancelled'],
answers: Array,
createdAt: Date,
updatedAt: Date
}- Basic appointment booking system
- Role-based authentication
- Real-time slot availability
- Resource/provider management
- Admin dashboard with analytics
- Calendar view for appointments
- MCP server integration
- Payment gateway integration (Stripe, PayPal)
- SMS/Email notification system
- Video consultation support
- Appointment reminders
- User reviews and ratings
- Service categories and filters
- Mobile app (React Native)
- Multi-location support
- Subscription and pricing tiers
- AI-powered recommendations
- Analytics export and reports
- Integration with calendar services (Google, Outlook)
- Test booking flow end-to-end
- Verify slot availability updates
- Test role-based access control
- Verify email notifications
- Test calendar interactions
- Use Postman collection (see POSTMAN_API_DOCUMENTATION.md)
- Test all endpoints with valid/invalid inputs
- Verify error responses
❌ MongoDB Connection Error
Solution:
- Ensure MongoDB is running:
mongod --version - Check
MONGO_URIin.envfile - For MongoDB Atlas:
- Verify network access is configured
- Check database user permissions
- Ensure password is URL-encoded
- Restart backend after environment changes
❌ JWT Authentication Fails
Solution:
- Verify
JWT_SECRETis set in backend.env - Clear browser localStorage:
localStorage.clear() - Login again to get fresh token
- Check token format in Authorization header:
Bearer <token> - Verify token hasn't expired
❌ CORS Error from Frontend
Solution:
- Verify
FRONTEND_ORIGINmatches frontend URL (default:http://localhost:5173) - Check backend CORS configuration in
app.js - Restart backend after
.envchanges - Clear browser cache
❌ Booking Submission Fails
Solution:
- Verify all required fields:
serviceId,date,startTime - Check date format: must be
YYYY-MM-DD - Ensure date is not in the past
- Verify user is authenticated (valid JWT token)
- Check backend logs for validation errors
- Verify service is published
❌ Slot Not Available
Solution:
- Check service availability schedules
- Verify slot is within operating hours
- Ensure maximum bookings per slot not exceeded
- Check for past dates
- Verify selected date has available slots
❌ Frontend Can't Reach Backend
Solution:
- Verify backend is running on port 5000
- Check
VITE_API_URLin frontend.env - Ensure CORS is properly configured
- Check network connectivity
- Try accessing API directly:
http://localhost:5000/api/services
- 🎯 Intuitive Navigation - Role-specific dashboards for different user types
- 📱 Mobile-First Design - Fully responsive across all devices
- 🎨 Modern Interface - Clean, professional design with TailwindCSS
- ⚡ Fast Loading - Optimized performance with lazy loading
- 🔔 Smart Notifications - Toast alerts for all important events
- 📊 Data Visualization - Charts and statistics for analytics
- 🌐 Responsive Grids - Adaptive layouts for all screen sizes
- ♿ Accessibility - Semantic HTML and keyboard navigation
npm run build
# Deploy the dist/ folder to your hosting service- Set environment variables in deployment platform
- Ensure MongoDB Atlas is accessible
- Deploy using Render, Railway, or Heroku
- Update
FRONTEND_ORIGINfor CORS
Follow mcp-server README for Claude Desktop configuration.
We welcome contributions! Here's how you can help:
- 🍴 Fork the repository
- 🌿 Create your feature branch (
git checkout -b feature/AmazingFeature) - 💻 Commit your changes (
git commit -m 'Add some AmazingFeature') - 📤 Push to the branch (
git push origin feature/AmazingFeature) - 🔀 Open a Pull Request
This project is licensed under the ISC License - see the LICENSE file for details.
Need help or have questions?
📧 Email: Email
💼 LinkedIn: Profile
🐙 GitHub: Profile
👨💻 Developer: Mayur Waykar
Found this project helpful? Give it a ⭐ on GitHub!
# Backend
cd hcakthon-frontend/server
npm install
npm start # Start server
npm run seed # Seed database
# Frontend
cd hcakthon-frontend/client
npm install
npm run dev # Start dev server
npm run build # Build for production
npm run preview # Preview production build
# MCP Server
cd hcakthon-frontend/mcp-server
npm install
node server.js # Start MCP server

