Skip to content

HifzaanDev/indibookingV2.2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

33 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🏨 IndiBooking - Full-Stack Hotel Booking Platform

Live Demo LinkedIn GitHub

πŸš€ Experience IndiBooking live at indibooking.click

A high-performance, full-stack MERN hotel booking platform featuring dynamic search, multi-step reservations, and enterprise-grade AWS deployment with auto-scaling capabilities.

✨ Key Achievements

  • ⚑ Optimized Performance: Achieved exceptional Lighthouse scores (100 Accessibility, 100 Best Practices, 73 Performance) with API response times under 400ms
  • πŸ—οΈ Scalable AWS Architecture: Deployed on Elastic Beanstalk with auto-scaling, S3 + CloudFront for frontend, and Route 53 domain management
  • πŸ” Secure Authentication: Implemented efficient JWT-based authentication system with secure cookie handling
  • πŸ“Š Optimized Database: Designed MongoDB schema to handle complex hotel-room-reservation relationships with fast query performance

🎯 Live Application

Visit the live platform: indibooking.click

Experience a fully functional hotel booking platform with real-time availability, dynamic pricing, and seamless reservation management.

πŸ—οΈ Architecture Overview

Technology Stack

Frontend:

  • React 18 with modern hooks and functional components
  • React Router DOM for client-side routing
  • React Date Range for booking date selection
  • Axios for HTTP requests with interceptors
  • FontAwesome icons for enhanced UI
  • CSS modules for component styling

Backend:

  • Node.js with Express.js framework
  • MongoDB with Mongoose ODM
  • JWT-based authentication with httpOnly cookies
  • bcryptjs for password hashing
  • CORS configuration for cross-origin requests
  • Express middleware for error handling

Infrastructure & DevOps:

  • AWS Elastic Beanstalk for backend auto-scaling
  • Amazon S3 for static website hosting
  • CloudFront CDN for caching and HTTPS
  • Route 53 for DNS management
  • SSL/TLS certificates for secure communication

Deployment Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Route 53      │───▢│   CloudFront    │───▢│   S3 Bucket     β”‚
β”‚  (DNS + Domain) β”‚    β”‚  (CDN + HTTPS)  β”‚    β”‚   (Frontend)    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                               
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Route 53      │───▢│ Elastic Beanstalk│───▢│   EC2 Auto      β”‚
β”‚    (API DNS)    β”‚    β”‚  (Load Balancer) β”‚    β”‚   Scaling       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                               β”‚                 β”‚
                                               β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
                                               β”‚  β”‚ Backend   β”‚  β”‚
                                               β”‚  β”‚ Instance  β”‚  β”‚
                                               β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
                                               β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
                                               β”‚  β”‚ MongoDB   β”‚  β”‚
                                               β”‚  β”‚ Atlas     β”‚  β”‚
                                               β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
                                               β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Key Features

Hotel Management System

  • Dynamic Search: Real-time filtering by location, dates, and guest capacity
  • Multi-Step Reservation: Intuitive booking flow with date selection and room selection
  • Property Listings: Featured hotels with detailed information and image galleries
  • Room Availability: Real-time room status tracking and availability management

User Experience

  • Responsive Design: Mobile-first approach with seamless cross-device experience
  • Interactive Components: Date pickers, search filters, and booking modals
  • City-Specific Pages: Dedicated pages for major Indian cities (Mumbai, Delhi, Bengaluru)
  • Featured Properties: Highlighted accommodations with special offers

Security & Performance

  • JWT Authentication: Secure token-based authentication with httpOnly cookies
  • Password Encryption: bcryptjs hashing for secure user credentials
  • CORS Protection: Configured cross-origin resource sharing for API security
  • Error Handling: Comprehensive error middleware with proper status codes

πŸ“ Project Structure

IndiBooking/
β”œβ”€β”€ πŸ“ hotel-booking/              # Main project directory
β”‚   β”œβ”€β”€ πŸ“„ package.json            # Frontend dependencies
β”‚   β”œβ”€β”€ πŸ“„ .gitignore              # Git ignore rules
β”‚   β”‚
β”‚   β”œβ”€β”€ πŸ“ public/                 # Static assets
β”‚   β”‚   β”œβ”€β”€ πŸ“„ index.html          # HTML entry point
β”‚   β”‚   └── πŸ–ΌοΈ favicon.ico         # App favicon
β”‚   β”‚
β”‚   β”œβ”€β”€ πŸ“ src/                    # Frontend source code
β”‚   β”‚   β”œβ”€β”€ πŸ“„ App.jsx             # Main React component
β”‚   β”‚   β”œβ”€β”€ πŸ“„ index.js            # React app entry point
β”‚   β”‚   β”œβ”€β”€ πŸ“„ axios.js            # Axios configuration
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ πŸ“ components/         # Reusable UI components
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“ navbar/         # Navigation component
β”‚   β”‚   β”‚   β”‚   └── πŸ“„ Navbar.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“ header/         # Page header component
β”‚   β”‚   β”‚   β”‚   └── πŸ“„ Header.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“ featured/       # Featured hotels section
β”‚   β”‚   β”‚   β”‚   └── πŸ“„ Features.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“ featuredProperties/ # Property listings
β”‚   β”‚   β”‚   β”‚   └── πŸ“„ FeaturedProperties.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“ propertyList/   # Property type filters
β”‚   β”‚   β”‚   β”‚   └── πŸ“„ PropertyList.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“ searchItem/     # Search result items
β”‚   β”‚   β”‚   β”‚   └── πŸ“„ SearchItem.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“ reserve/        # Reservation modal
β”‚   β”‚   β”‚   β”‚   └── πŸ“„ Reserve.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“ mailList/       # Newsletter component
β”‚   β”‚   β”‚   β”‚   └── πŸ“„ MailList.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“ footer/         # Footer component
β”‚   β”‚   β”‚   β”‚   └── πŸ“„ Footer.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“ mumbai/         # City-specific components
β”‚   β”‚   β”‚   β”‚   └── πŸ“„ Mumbai.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“ delhi/
β”‚   β”‚   β”‚   β”‚   └── πŸ“„ Delhi.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“ bengaluru/
β”‚   β”‚   β”‚   β”‚   └── πŸ“„ Bengaluru.jsx
β”‚   β”‚   β”‚   └── πŸ“ comingSoon/     # Coming soon features
β”‚   β”‚   β”‚       └── πŸ“„ ComingSoon.jsx
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ πŸ“ pages/              # Main application pages
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“ home/           # Homepage
β”‚   β”‚   β”‚   β”‚   └── πŸ“„ Homes.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“ list/           # Hotel listings page
β”‚   β”‚   β”‚   β”‚   └── πŸ“„ List.jsx
β”‚   β”‚   β”‚   └── πŸ“ hotel/          # Individual hotel page
β”‚   β”‚   β”‚       └── πŸ“„ Hotel.jsx
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ πŸ“ context/            # React Context for state management
β”‚   β”‚   β”œβ”€β”€ πŸ“ hooks/              # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ πŸ“ login/              # Authentication components
β”‚   β”‚   └── πŸ“ assets/             # Static assets and images
β”‚   β”‚
β”‚   β”œβ”€β”€ πŸ“ api/                    # Backend API server
β”‚   β”‚   β”œβ”€β”€ πŸ“„ app.js              # Express server entry point
β”‚   β”‚   β”œβ”€β”€ πŸ“„ package.json        # Backend dependencies
β”‚   β”‚   β”œβ”€β”€ πŸ“„ .env                # Environment variables
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ πŸ“ models/             # MongoDB schemas
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ User.js         # User model
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ Hotel.js        # Hotel model
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ Room.js         # Room model
β”‚   β”‚   β”‚   └── πŸ“„ Reservation.js  # Reservation model
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ πŸ“ routes/             # API route definitions
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ auth.js         # Authentication routes
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ users.js        # User management routes
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ hotels.js       # Hotel CRUD routes
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ rooms.js        # Room management routes
β”‚   β”‚   β”‚   └── πŸ“„ reservations.js # Booking routes
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ πŸ“ controllers/        # Route controllers
β”‚   β”‚   β”œβ”€β”€ πŸ“ utils/              # Utility functions
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ πŸ“ .ebextensions/      # Elastic Beanstalk configuration
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ 00_install_certbot.config
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ 01_nginx_proxy.config
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ 02_environment.config
β”‚   β”‚   β”‚   └── πŸ“„ 10_open_https_port.config
β”‚   β”‚   β”‚
β”‚   β”‚   └── πŸ“ .platform/          # Platform-specific configs
β”‚   β”‚
β”‚   └── πŸ“ build/                  # Production build files

πŸ› οΈ Local Development

Prerequisites

  • Node.js 18+
  • MongoDB (local or Atlas)
  • npm or yarn package manager

Quick Start

# Clone the repository
git clone https://github.com/hifzaanDev/indibooking
cd hotel-booking

# Install frontend dependencies
npm install

# Install backend dependencies
cd api
npm install

# Configure environment variables
cp .env.example .env
# Update with your MongoDB connection string and JWT secret

# Start backend server
npm run dev

# Start frontend (in new terminal)
cd ..
npm start

Environment Configuration

# API/.env
MONGO=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret_key
PORT=8080

πŸ“Š Performance Metrics

  • Lighthouse Scores:
    • Accessibility: 100/100
    • Best Practices: 100/100
    • Performance: 73/100
  • API Response Time: < 400ms average
  • Database Query Performance: Optimized MongoDB indexes for fast lookups
  • Uptime: 99.9% availability on AWS infrastructure
  • Auto-Scaling: Elastic Beanstalk handles traffic spikes automatically

πŸ”— API Endpoints

Authentication

  • POST /api/auth/register - User registration
  • POST /api/auth/login - User login
  • POST /api/auth/logout - User logout

Hotels

  • GET /api/hotels - Get all hotels with filtering
  • GET /api/hotels/:id - Get specific hotel details
  • GET /api/hotels/countByCity - Get hotel counts by city
  • GET /api/hotels/countByType - Get hotel counts by type

Rooms

  • GET /api/rooms/:id - Get room details
  • PUT /api/rooms/availability/:id - Update room availability

Reservations

  • POST /api/reservations - Create new reservation
  • GET /api/reservations/user/:userId - Get user reservations

🌟 Technical Highlights

AWS Deployment Strategy

  • Frontend: Deployed on S3 with CloudFront CDN for global content delivery
  • Backend: Auto-scaling Elastic Beanstalk environment with load balancing
  • Database: MongoDB Atlas for managed database with replica sets
  • Security: SSL/TLS certificates and secure cookie handling

MongoDB Schema Optimization

  • Indexed Queries: Strategic indexing for city, type, and availability searches
  • Relationship Modeling: Efficient hotel-room-reservation relationships
  • Aggregation Pipelines: Complex queries for availability and pricing

React Architecture

  • Component-Based Design: Modular, reusable components
  • State Management: React Context for global state
  • Performance: Code splitting and lazy loading
  • User Experience: Intuitive booking flow with validation

πŸ“± Contact

Hifzaan Mohammad
πŸ“§ Email: [email protected]
πŸ’Ό LinkedIn: linkedin.com/in/hifzaan-mohammad
πŸ‘¨β€πŸ’» GitHub: @hifzaanDev


🌟 Experience the full booking platform at indibooking.click

About

🏨 IndiBooking - Full-Stack Hotel Booking Platform

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages