Skip to content

krushnamohod/Appointment_App_Gear_5

Repository files navigation

πŸ—“οΈ Appointment Booking System

A full-stack appointment booking application with an admin dashboard, customer portal, and AI-powered chatbot assistant. Built for hackathon with modern technologies and a beautiful UI.

🎬 Demo Video

Watch Demo Video

Appointment App

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                         FRONTEND                            β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚     Admin Dashboard      β”‚       Customer Portal            β”‚
β”‚     (React + Vite)       β”‚       (React + Vite)             β”‚
β”‚     Port: 5174           β”‚       Port: 5173                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
                              β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   BACKEND (Express.js)                      β”‚
β”‚                       Port: 3000                            β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  REST API β”‚ Socket.IO β”‚ AI Chatbot (Gemini) β”‚ Email Service β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β–Ό               β–Ό               β–Ό
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚PostgreSQLβ”‚   β”‚  Redis   β”‚    β”‚GoogleGeminiβ”‚
        β”‚ Database β”‚   β”‚  Cache   β”‚    β”‚   API    β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

✨ Features

Customer Portal

  • πŸ“… Browse and book appointment slots
  • 🏒 View available services and resources (venues, courts, equipment)
  • πŸ‘€ User authentication & profile management
  • πŸ’³ Payment integration (PhonePe)
  • πŸ€– AI Chatbot - Get help booking appointments, service recommendations
  • πŸ“± Mobile-responsive design
  • πŸ”” Real-time updates via Socket.IO

Admin Dashboard

  • πŸ“Š Dashboard - Analytics & reporting with charts
  • πŸ“‹ Services - Create/manage services with custom questions, pricing, capacity
  • πŸ‘¨β€βš•οΈ Providers - Manage service providers and their schedules
  • 🏟️ Resources - Manage venues, courts, equipment with hierarchy support
  • πŸ“† Appointments - View, confirm, or cancel bookings
  • 🎫 Discounts - Create promo codes with percentage-based discounts
  • πŸ‘₯ Users - User management with role-based access (Admin, Organiser, Provider)
  • βš™οΈ Settings - Application configuration

Backend API

  • πŸ” JWT Authentication with role-based access control
  • πŸ“§ Email notifications (Nodemailer)
  • πŸ’° Payment processing with PhonePe
  • πŸ€– AI Chatbot integration with Google Gemini Pro
  • πŸ”„ Real-time WebSocket events
  • πŸ“ File uploads for images

πŸ› οΈ Tech Stack

Layer Technology
Frontend React 18, Vite, TailwindCSS, Zustand, Recharts
Backend Node.js, Express 5, Socket.IO
Database PostgreSQL + Prisma ORM
Cache Redis
AI Google Gemini API (gemini-2.0-flash)
Payments PhonePe
Email Nodemailer

πŸ“¦ Project Structure

Appointment_App_Gear_5/
β”œβ”€β”€ admin/                 # Admin dashboard (React + Vite)
β”‚   └── src/
β”‚       β”œβ”€β”€ components/    # UI components
β”‚       β”œβ”€β”€ views/         # Page views
β”‚       └── store/         # Zustand state management
β”‚
β”œβ”€β”€ customer/              # Customer portal (React + Vite)  
β”‚   └── src/
β”‚       β”œβ”€β”€ components/    # UI components (auth, booking, chat, home)
β”‚       β”œβ”€β”€ services/      # API service layer
β”‚       └── context/       # React context
β”‚
β”œβ”€β”€ backend/               # Express.js API server
β”‚   β”œβ”€β”€ prisma/
β”‚   β”‚   └── schema.prisma  # Database schema
β”‚   └── src/
β”‚       β”œβ”€β”€ controllers/   # Route handlers
β”‚       β”œβ”€β”€ routes/        # API routes
β”‚       β”œβ”€β”€ services/      # Business logic
β”‚       β”œβ”€β”€ middlewares/   # Auth, error handling
β”‚       └── utils/         # Helpers
β”‚
└── README.md

πŸ—„οΈ Database Schema

Model Description
User Customers, admins, organizers, providers
Service Bookable services with pricing, questions, capacity
Provider Service providers with working hours
Resource Venues, courts, equipment (supports hierarchy)
Slot Available time slots for booking
Booking Customer appointments
Transaction Payment records
Discount Promotional codes

πŸš€ Getting Started

Prerequisites

  • Node.js 18+
  • PostgreSQL
  • Redis (optional, for caching)
  • Google Gemini API Key

1. Clone & Install

# Install backend dependencies
cd backend
npm install

# Install admin dependencies
cd ../admin
npm install

# Install customer dependencies
cd ../customer
npm install

2. Environment Setup

Create .env file in backend/:

DATABASE_URL="postgresql://user:password@localhost:5432/appointment_db"
JWT_SECRET="your-super-secret-jwt-key"
PORT=3000

# Email (optional)
SMTP_HOST="smtp.gmail.com"
SMTP_PORT=587
SMTP_USER="your-email@gmail.com"
SMTP_PASS="your-app-password"

# PhonePe Payment (optional)
PHONEPE_MERCHANT_ID="your-merchant-id"
PHONEPE_SALT_KEY="your-salt-key"
PHONEPE_SALT_INDEX=1

# Google Gemini API
GEMINI_API_KEY="your-google-gemini-api-key"

Create .env file in admin/ and customer/:

VITE_API_URL="http://localhost:3000/api"

3. Database Setup

cd backend

# Generate Prisma client
npx prisma generate

# Run migrations
npx prisma migrate dev

# Seed sample data (optional)
node prisma/seed.js

4. Start Development Servers

# Terminal 1 - Backend
cd backend
npm run dev          # Runs on http://localhost:3000

# Terminal 2 - Admin
cd admin
npm run dev          # Runs on http://localhost:5174

# Terminal 3 - Customer
cd customer
npm run dev          # Runs on http://localhost:5173

πŸ“‘ API Endpoints

Route Description
POST /api/auth/register User registration
POST /api/auth/login User login
GET /api/services List all services
GET /api/resources List all resources
GET /api/providers List all providers
GET /api/slots Get available slots
POST /api/bookings Create a booking
GET /api/bookings List user bookings
POST /api/payments/initiate Start payment
GET /api/discounts List discounts
POST /api/chatbot/message AI chatbot
GET /api/reports Admin analytics
GET /api/users User management

πŸ” User Roles

Role Permissions
CUSTOMER Book appointments, view own bookings
PROVIDER View assigned appointments
ORGANISER Manage services, providers, resources
ADMIN Full system access

πŸ€– AI Chatbot

The integrated chatbot uses Google Gemini 2.0 Flash to:

  • Answer questions about services
  • Recommend services based on symptoms/needs
  • Guide users through the booking process
  • Provide general appointment assistance

Setup Gemini:

  1. Get an API Key from Google AI Studio.
  2. Add it to backend/.env as GEMINI_API_KEY.

πŸ“œ Scripts

Backend

npm run dev      # Development with nodemon
npm start        # Production

Admin / Customer

npm run dev      # Development server
npm run build    # Production build
npm run preview  # Preview production build
npm test         # Run tests (admin only)

🎨 Design System

The app uses a warm, professional design with:

  • Primary Color: Terracotta (#C4653C)
  • Background: Paper cream (#FAF6F0)
  • Font: Inter / system fonts
  • Icons: Lucide React

πŸ“„ License

MIT License - Built for hackathon purposes.


Built with ❀️ by Team Gear 5

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages