Skip to content

mayank-1007/RepHelp

Repository files navigation

RepHelp - Hotel Management System

RepHelp Logo

RepHelp

A modern, full-stack hotel management and room booking system built with Next.js, Neon PostgreSQL, Prisma, and TypeScript.


πŸ“– About The Project

RepHelp is a comprehensive solution designed to streamline hotel reception management and room booking. It offers an intuitive interface for customers to register and book rooms, complete with OTP verification, file uploads, and a secure admin dashboard for managing bookings efficiently. The project leverages modern web technologies to provide a seamless, secure, and responsive experience.


✨ Key Features

πŸ” Security & Authentication

  • OTP Verification: Email-based OTP verification with elegant 6-digit input UI for customer authentication
  • Session-Based Admin Access: Secure admin dashboard with passkey protection and session management
  • File Upload Security: Cloudinary integration for secure document and image storage

πŸ“ Customer Experience

  • Multi-Step Registration: User-friendly registration flow with form validation
  • Smart Booking System: Intelligent appointment scheduling with automatic status management
  • Real-time Notifications: Toast notifications for all user actions (success, error, loading states)
  • Document Upload: Secure upload for ID documents, customer photos, and digital signatures

🎯 Smart Appointment Management

  • Time-Based Status Logic: Appointments automatically marked as "scheduled" or "pending" based on check-in date
  • Rescheduling: Complete rescheduling functionality with pre-filled data and smart status updates
  • Cancellation Workflow: Soft-delete system with cancellation reasons (appointments marked, not deleted)
  • Visual Indicators: Strikethrough styling for cancelled appointments in admin view

πŸ‘¨β€πŸ’Ό Admin Dashboard

  • Comprehensive Overview: Track scheduled, pending, and cancelled bookings with stat cards
  • Interactive Data Table: Manage all bookings with inline actions (reschedule/cancel)
  • Secure Access: Session-based authentication with automatic timeout on browser close
  • Logout Functionality: Clean session management with logout button

πŸ’… Modern UI/UX

  • Loading States: Proper spinners and loading indicators throughout the application
  • Toast Notifications: Real-time feedback using Sonner for all operations
  • Responsive Design: Fully responsive UI built with Tailwind CSS and Shadcn/ui
  • Form Validation: Comprehensive validation using Zod and React Hook Form

πŸš€ Live Demo & Screenshots

Live Demo

The complete booking flow of RepHelp.

Live Demo video

🏠 Home & OTP Verification

Customer registration with OTP verification flow.

RepHelp Home Page

πŸ“ Registration Page

Complete customer registration with file uploads.

RepHelp Registration

πŸ”’ Admin Dashboard

Secure admin portal with comprehensive booking management.

RepHelp Admin Dashboard

πŸ“… Appointment Booking

Simple and intuitive room booking interface.

RepHelp Appointment Booking

RepHelp Appointment Confirmation


πŸ› οΈ Tech Stack

This project is built with a modern and robust technology stack:

Category Technology
Frontend Next.js 14, React 18, TypeScript
Backend & Database Neon PostgreSQL (Serverless), Prisma ORM
File Storage Cloudinary (CDN & Image Optimization)
Styling Tailwind CSS, Shadcn/ui
Form Management React Hook Form, Zod
Notifications Sonner (Toast Notifications)
Email Service Nodemailer (Gmail SMTP for OTP)
Deployment Vercel

βš™οΈ Getting Started

To get a local copy up and running, follow these simple steps.

Prerequisites

Make sure you have the following installed on your machine:

Installation & Setup

  1. Clone the repository:

    git clone https://github.com/mayank-1007/rephelp.git
    cd rephelp
  2. Install dependencies:

    npm install
  3. Set up environment variables: Create a .env.local file in the root of your project and add the following environment variables:

    # Neon PostgreSQL Database
    DATABASE_URL="postgresql://[user]:[password]@[host]/[database]?sslmode=require"
    
    # Cloudinary Configuration (for file uploads)
    NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME=your_cloud_name
    CLOUDINARY_CLOUD_NAME=your_cloud_name
    CLOUDINARY_API_KEY=your_api_key
    CLOUDINARY_API_SECRET=your_api_secret
    
    # Email Configuration (Nodemailer with Gmail)
    EMAIL_USER=your_email@gmail.com
    EMAIL_PASS=your_gmail_app_password
    
    # Admin Access (6-digit passkey)
    NEXT_PUBLIC_ADMIN_PASSKEY=111111

    How to get credentials:

    • Neon Database: Sign up at neon.tech, create a project, and copy the connection string
    • Cloudinary: Sign up at cloudinary.com, get your cloud name, API key, and secret from the dashboard
    • Gmail App Password: Enable 2FA on your Gmail account, then generate an app-specific password from Google Account Settings
  4. Set up the database:

    npx prisma db push
    npx prisma generate
  5. Run the development server:

    npm run dev
  6. Open the application: Open http://localhost:3000 in your browser to see the application.


πŸš€ Deployment

The application can be deployed using Vercel.

Deploy to Vercel (Recommended)

  1. Push your code to GitHub
  2. Import your repository on Vercel
  3. Add all environment variables from .env.local
  4. Deploy!

Deployment Link - https://rephelp1.vercel.app


πŸ“‚ Project Structure

The project follows a standard Next.js app directory structure with Prisma ORM:

/
β”œβ”€β”€ app/                      # Main application routes and UI
β”‚   β”œβ”€β”€ admin/                # Admin dashboard page
β”‚   β”œβ”€β”€ customer/             # Customer-facing pages
β”‚   β”‚   └── [userId]/         # Dynamic routes for users
β”‚   β”‚       β”œβ”€β”€ register/     # Registration page
β”‚   β”‚       └── new-booking/  # Booking pages
β”‚   β”œβ”€β”€ api/                  # API routes
β”‚   β”‚   β”œβ”€β”€ upload/           # Cloudinary file upload
β”‚   β”‚   β”œβ”€β”€ send-otp/         # OTP generation
β”‚   β”‚   └── verify-otp/       # OTP verification
β”‚   β”œβ”€β”€ layout.tsx            # Root layout with Toaster
β”‚   β”œβ”€β”€ loading.tsx           # Global loading component
β”‚   └── page.tsx              # Home page with customer form
β”œβ”€β”€ components/               # Reusable React components
β”‚   β”œβ”€β”€ form/                 # Form components
β”‚   β”‚   β”œβ”€β”€ CustomerForm.tsx  # OTP login form
β”‚   β”‚   β”œβ”€β”€ RegisterForm.tsx  # Full registration
β”‚   β”‚   └── AppointmentForm.tsx # Booking form
β”‚   β”œβ”€β”€ table/                # Data table components
β”‚   β”‚   β”œβ”€β”€ columns.tsx       # Table column definitions
β”‚   β”‚   └── DataTable.tsx     # Reusable table
β”‚   β”œβ”€β”€ ui/                   # Shadcn UI components
β”‚   β”œβ”€β”€ AppointmentModal.tsx  # Cancel/reschedule modal
β”‚   β”œβ”€β”€ PasskeyModal.tsx      # Admin authentication
β”‚   β”œβ”€β”€ LogoutButton.tsx      # Admin logout
β”‚   └── StatCard.tsx          # Dashboard statistics
β”œβ”€β”€ lib/                      # Core logic and utilities
β”‚   β”œβ”€β”€ actions/              # Server actions
β”‚   β”‚   β”œβ”€β”€ customer.actions.ts    # Customer CRUD
β”‚   β”‚   └── appointment.actions.ts # Appointment CRUD
β”‚   β”œβ”€β”€ validation.ts         # Zod schemas
β”‚   └── utils.ts              # Helper functions
β”œβ”€β”€ prisma/                   # Database schema and migrations
β”‚   └── schema.prisma         # Prisma schema definition
β”œβ”€β”€ types/                    # TypeScript type definitions
β”‚   β”œβ”€β”€ index.d.ts            # Global types
β”‚   └── prisma.types.ts     # Database model types
β”œβ”€β”€ constants/                # Application constants
└── public/                   # Static assets

πŸ”‘ Key Features Explained

Smart Appointment Status

Appointments are automatically assigned a status based on check-in date:

  • Scheduled: Check-in date is today or in the past
  • Pending: Check-in date is in the future
  • Cancelled: Manually cancelled by admin (soft delete)

OTP Verification Flow

  1. User enters name, email, and phone
  2. System generates 6-digit OTP and sends via email
  3. User enters OTP in elegant 6-box input
  4. Upon verification, success animation plays
  5. User is redirected to registration page

File Upload System

  • ID Document: Uploaded to Cloudinary and URL stored in database
  • Customer Photo: Optimized and stored via Cloudinary CDN
  • Digital Signature: Captured using signature pad, uploaded as image
  • All uploads show real-time progress toasts

Admin Security

  • Session-based authentication: Passkey required on every new browser session
  • No persistent storage: Authentication clears when browser/tab closes
  • Logout functionality: Admins can manually logout anytime
  • Loading states: Smooth transitions with spinners during authentication

πŸ“Š Database Schema

The application uses three main models:

Customer

  • Basic user information (name, email, phone)
  • OTP verification fields
  • Timestamps

CustomerDetail

  • Extended profile information
  • Document URLs (ID, photo, signature)
  • Consent fields
  • Address and nationality info

Appointment

  • Booking information (dates, rooms, purpose)
  • Status tracking (scheduled/pending/cancelled)
  • Cancellation reason
  • Foreign key to Customer

🎨 UI/UX Highlights

  • Toast Notifications: Real-time feedback for all operations
  • Loading Spinners: Visual indicators for async operations
  • Form Validation: Instant feedback with error messages
  • Responsive Design: Works perfectly on mobile, tablet, and desktop
  • Accessibility: Keyboard navigation and screen reader support
  • Dark Theme: Modern dark color scheme throughout

πŸ“„ License

This project is licensed under the MIT License. See the LICENSE file for more details.


🀝 Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the issues page.


πŸ“§ Contact

Mayank Manchanda


Developed with ❀️ by Mayank Manchanda

⭐ Star this repo if you find it helpful!

Releases

No releases published

Packages

 
 
 

Contributors