|
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.
A glimpse into the Hotel Elite web application interface.
| Home Page | Reservation Page |
|---|---|
![]() |
Gallery Page ![]() |
Watch the complete application walkthrough, including room browsing, facility reservations, booking management, and the administration panel.
π₯ Watch the Hotel Management System Demo
- 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.
- 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.
- 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.
- Backend: Python, FastAPI
- Database: SQLite3
- Template Engine: Jinja2
- Session Management: Starlette SessionMiddleware
- Frontend: HTML5, Vanilla CSS3, JavaScript, FontAwesome Icons
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
| 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. |
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
Ensure you have Python 3.8+ and DB Browser for SQLite installed, then follow these steps:
git clone https://github.com/Rdeepthiacharya/Hotel_Management_System.git
cd Hotel_Management_Systempython -m venv .venv.venv\Scripts\Activate.ps1pip install -r requirements.txt- Open DB Browser for SQLite and import the
app.db.sqlfile. - Save the generated database as
app.dbin the project root.
This creates the required tables and inserts the initial data for rooms, facilities, and administrators.
python -m uvicorn app:app --reloadOnce 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 |
- 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) withsynchronous=NORMALto improve database concurrency and performance.
This project is licensed under the MIT License - see the LICENSE file for details.
π¨ Hotel Elite Β· Built with FastAPI and SQLite



