Skip to content

About

Hotel management system with room reservations, facility bookings, user authentication, and an admin dashboard. Built with FastAPI, SQLite, HTML, CSS, and JavaScript.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

Β 

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🏨 Hotel Management System

Hotel Elite

Where Elegance Meets Comfort

FastAPI Β Β Β  Python Β Β Β  SQLite Β Β Β  License

πŸ“ Project Introduction

This project is a full-featured Hotel Management System designed to streamline room reservations and facility bookings. It provides a user-friendly portal for guests to browse accommodations, check current availability, and reserve stays, alongside a robust administrator panel for front-desk operators to monitor availability, manage bookings, and cancel reservations.

πŸ“Έ Screenshots

A glimpse into the Hotel Elite web application interface.

Home Page Reservation Page
Home Page Reservation Page

Gallery Page

Gallery Page

πŸ“½οΈ Demo

Watch the complete application walkthrough, including room browsing, facility reservations, booking management, and the administration panel.

πŸŽ₯ Watch the Hotel Management System Demo

πŸ’‘ Highlights

  • FastAPI-powered backend: Uses FastAPI routing and Jinja2 template rendering to deliver dynamic server-rendered pages.
  • Transaction-safe booking: Employs ACID-compliant transactions with automatic rollback and concurrent write synchronization using threading.Lock().
  • Admin dashboard: Displays reservation records and room and facility availability statistics, while allowing administrators to cancel bookings and automatically restore availability.

✨ Features

πŸ‘€ Guest Experience

  • User Authentication: Register, log in, and access user-specific features through session-based authentication.
  • Photo Gallery: Explore a visual gallery showcasing the hotel's accommodations and dining experiences.
  • Room Availability: View the current number of available rooms across Superior, Deluxe, Club, and Suite categories while booking.
  • Facility Reservations: Reserve available amenities including Dining, Private Theatre, Event Spaces, Spa, Swimming Pool, and Cab services.
  • My Bookings Dashboard: View reservation details, stay dates, booked facilities, and cancel reservations directly.

πŸ› οΈ Administration Panel

  • Reservation Management: View guest details, stay dates, room reservations, and booked facilities.
  • Availability Overview: Monitor the current number of total, booked, and available rooms and facility slots.
  • Reservation Override: Cancel any reservation and automatically restore the associated room and facility availability.

πŸ› οΈ Tech Stack

  • Backend: Python, FastAPI
  • Database: SQLite3
  • Template Engine: Jinja2
  • Session Management: Starlette SessionMiddleware
  • Frontend: HTML5, Vanilla CSS3, JavaScript, FontAwesome Icons

πŸ“ Architecture

The application follows an MVC-inspired architecture, separating database operations, request handling, and user interface rendering.

flowchart TD
A[User / Admin] --> B[Web Browser]
B --> C[FastAPI Application]

C --> D[Authentication]
C --> E[Booking Module]
C --> F[Admin Dashboard]

D --> G[Database Controller]
E --> G
F --> G

G --> H[(SQLite Database)]

C --> I[Jinja2 Templates]
I --> J[HTML Response]
J --> B
Loading

MVC Components

Layer Description
Model dbcontroller.py manages database queries, availability updates, seed data, concurrency locks, and transaction handling.
View Jinja2 templates in templates/ render dynamic HTML pages using data from the controller, with CSS and JavaScript for styling and client-side interactions.
Controller app.py handles routing, session validation, input and date validation, availability checks, reservation logic, administrator operations, and communication between the views and database layer.

πŸ“‚ Project Structure

Hotel_Management_System/
β”œβ”€β”€ app.py                  # FastAPI routes and application logic
β”œβ”€β”€ dbcontroller.py         # Database operations and initialization
β”œβ”€β”€ requirements.txt        # Python dependencies
β”œβ”€β”€ app.db.sql              # SQL script for database setup and seed data
β”‚
β”œβ”€β”€ static/
β”‚   β”œβ”€β”€ css/                # Stylesheets
β”‚   β”œβ”€β”€ js/                 # JavaScript files
β”‚   └── image/              # Images and media
β”‚
└── templates/
    β”œβ”€β”€ admin/              # Admin pages
    └── *.html              # Guest-facing pages

πŸš€ Installation

Ensure you have Python 3.8+ and DB Browser for SQLite installed, then follow these steps:

1. Clone the Repository

git clone https://github.com/Rdeepthiacharya/Hotel_Management_System.git
cd Hotel_Management_System

2. Create a Virtual Environment

python -m venv .venv

3. Activate the Virtual Environment (Windows PowerShell)

.venv\Scripts\Activate.ps1

4. Install Dependencies

pip install -r requirements.txt

5. Set Up the SQLite Database

  1. Open DB Browser for SQLite and import the app.db.sql file.
  2. Save the generated database as app.db in the project root.

This creates the required tables and inserts the initial data for rooms, facilities, and administrators.


πŸ’» Usage

1. Start the Development Server

python -m uvicorn app:app --reload

2. Access the Application

Once the server is running, open the following URLs in your browser:

Service URL
Main Website http://127.0.0.1:8000/
Admin Portal http://127.0.0.1:8000/admin/login
Swagger UI http://127.0.0.1:8000/docs
ReDoc http://127.0.0.1:8000/redoc

πŸ”’ Transaction Safety

  • Concurrency Lock: Serializes database write operations using Python's threading.Lock() to reduce simultaneous write conflicts.
  • Atomic Transactions: Groups room availability updates, facility slot updates, and reservation creation into a single transaction, with automatic rollback if any operation fails.
  • SQLite WAL Mode: Uses Write-Ahead Logging (WAL) with synchronous=NORMAL to improve database concurrency and performance.

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

🏨 Hotel Elite · Built with FastAPI and SQLite

About

Hotel management system with room reservations, facility bookings, user authentication, and an admin dashboard. Built with FastAPI, SQLite, HTML, CSS, and JavaScript.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages