BookingX is a full-stack hotel booking platform built to provide a complete hotel discovery and reservation experience. Users can search for hotels by location, explore available rooms, securely authenticate, make bookings, manage reservations, and control their account from a centralized profile.
The project is built with a React + Vite frontend and a Django REST Framework backend, backed by PostgreSQL.
- User registration and login
- JWT-based authentication
- Automatic access-token refresh
- Protected frontend routes
- Secure password change
- Forgot password functionality
- Email-based password reset
- Current-password verification before account deletion
- Permanent account deletion
- Login and logout activity tracking
- Password-change audit logging
- Featured hotels
- Hotel search by name/location
- Location autocomplete using Geoapify
- GPS/location-based hotel search
- Hotel and room details
- Hotel images and room images
- Room filtering by hotel
- Date-range based booking
- Guest selection
- Room availability validation
- Guest-capacity validation
- Check-in/check-out date validation
- Prevention of overlapping bookings
- Transaction-safe booking creation
- Unique booking references
- Booking status management
- Booking cancellation
- Automatic completion of past confirmed bookings
- My Bookings section
- View profile information
- Update first name and last name
- Update profile image
- Change password
- View booking history
- Permanently delete account
Django Admin provides management functionality for:
- Users
- Hotels
- Rooms
- Bookings
- Featured hotels
- User activity logs
- Password-change logs
BookingX follows a client-server architecture:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ React Frontend โ
โ Vite + JS โ
โโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโ
โ
โ REST API
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Django REST API โ
โ Django + DRF + JWT โ
โโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ PostgreSQL โ
โ Database โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
External Integration:
โ
โโโ Geoapify
โโโ Location Autocomplete
The frontend is responsible for the user interface and client-side application state, while the Django backend handles authentication, business logic, validation, bookings, and database operations.
- React.js
- Vite
- JavaScript
- React Router
- Bootstrap 5
- CSS
- React DatePicker
- Python
- Django
- Django REST Framework
- Simple JWT
- REST APIs
- PostgreSQL
- pgAdmin
- Geoapify
- OpenStreetMap-based location data
- Email service for password reset
- Git
- GitHub
- VS Code
- Django Admin
BookingX/
โ
โโโ booking-backend/
โ โ
โ โโโ manage.py
โ โโโ requirements.txt
โ โ
โ โโโ accounts/
โ โ โโโ models.py
โ โ โโโ serializers.py
โ โ โโโ views.py
โ โ โโโ urls.py
โ โ
โ โโโ hotels/
โ โ โโโ models.py
โ โ โโโ serializers.py
โ โ โโโ views.py
โ โ โโโ urls.py
โ โ โโโ admin.py
โ โ
โ โโโ ...
โ
โโโ booking-ui/
โ โ
โ โโโ src/
โ โ โโโ components/
โ โ โโโ pages/
โ โ โโโ services/
โ โ โโโ context/
โ โ โโโ ...
โ โ
โ โโโ package.json
โ โโโ vite.config.js
โ
โโโ README.md
Make sure the following are installed:
- Python 3.12+
- Node.js
- npm
- PostgreSQL
- Git
git clone https://github.com/adithyanhp/BookingX.git
cd BookingXcd booking-backendpython -m venv venvActivate it:
venv\Scripts\activatepython3 -m venv venvsource venv/bin/activatepip install -r requirements.txtCreate a .env file inside the backend directory.
Example:
SECRET_KEY=your-django-secret-key
DEBUG=True
DB_NAME=bookingx
DB_USER=postgres
DB_PASSWORD=your-postgresql-password
DB_HOST=localhost
DB_PORT=5432
FRONTEND_URL=http://localhost:5173
EMAIL_HOST_USER=your-email@example.com
EMAIL_HOST_PASSWORD=your-email-passwordImportant: Never commit your
.envfile or secret credentials to GitHub.
Create a PostgreSQL database for BookingX.
For example:
CREATE DATABASE bookingx;Then make sure the database credentials in your .env file match your PostgreSQL configuration.
python manage.py makemigrationspython manage.py migratepython manage.py createsuperuserFollow the prompts to create your admin account.
python manage.py runserverThe backend will normally be available at:
http://127.0.0.1:8000/
Open another terminal.
From the project root:
cd booking-uinpm installCreate:
.env
inside booking-ui.
Example:
VITE_API_BASE_URL=http://127.0.0.1:8000/api
VITE_GEOAPIFY_API_KEY=your-geoapify-api-keyImportant: Do not commit API keys or other secrets to GitHub.
npm run devThe frontend will normally be available at:
http://localhost:5173/
BookingX uses JWT authentication.
User
โ
โโโ Register
โ
โผ
Login
โ
โโโ Access Token
โโโ Refresh Token
โ
โผ
Protected API Requests
โ
โผ
Access Token Expired?
โ
โโโ No โ Continue
โ
โโโ Yes
โ
โผ
Refresh Token
โ
โผ
New Access Token
The frontend centralizes authenticated API requests and automatically attempts to refresh expired access tokens.
BookingX uses Geoapify to provide location autocomplete.
The location system works independently from the hotel database:
User enters location
โ
โผ
Geoapify Autocomplete
โ
โผ
User selects location
โ
โโโ Latitude
โโโ Longitude
โ
โผ
BookingX Django API
โ
โผ
Hotel search by distance
This allows users to search using real-world locations instead of being limited to predefined database entries.
The main booking workflow is:
Search Location
โ
โผ
Search Hotels
โ
โผ
Select Hotel
โ
โผ
Select Room
โ
โผ
Choose Dates & Guests
โ
โผ
Validate Availability
โ
โผ
Create Booking
โ
โผ
Booking Confirmation
โ
โผ
My Bookings
The backend performs server-side validation before creating a booking.
BookingX does not rely only on frontend validation.
The backend validates:
- Check-in date
- Check-out date
- Guest capacity
- Room status
- Room availability
- Existing overlapping bookings
Booking creation uses database transactions and row-level locking to reduce the possibility of conflicting bookings when multiple requests target the same room.
Bookings can move through different states:
Pending
โ
โผ
Confirmed
โ
โโโโโโโโโโโโโโโโบ Cancelled
โ
โผ
Completed
Past confirmed bookings can automatically transition to the completed state.
BookingX includes a complete password recovery workflow.
Login
โ
โผ
Forgot Password
โ
โผ
Enter Email
โ
โผ
Password Reset Email
โ
โผ
Reset Link
โ
โผ
Reset Password Page
โ
โผ
New Password
โ
โผ
Password Updated
Reset links contain a secure user identifier and token generated by Django's password-reset mechanisms.
Users can manage their account through the Profile section.
Available functionality includes:
- Profile information
- Profile image
- Edit profile
- Change password
- My bookings
- Permanent account deletion
Account deletion requires current-password verification before the account is permanently removed.
BookingX includes auditing functionality for security-sensitive operations.
The system records:
- Login
- Logout
- Timestamp
- IP address
- User agent
Password changes are recorded with information about whether the change was initiated by:
- The user
- An administrator
This provides administrators with better visibility into account security events.
The project follows several security practices:
- JWT-based authentication
- Protected API endpoints
- Protected frontend routes
- Password hashing through Django
- Current-password verification for account deletion
- Server-side booking validation
- Transaction-safe booking creation
- Environment variables for secrets
- Token refresh handling
- Separation between frontend and backend responsibilities
After starting both servers:
http://localhost:5173
http://127.0.0.1:8000
http://127.0.0.1:8000/admin/
Recommended testing flow:
- Register a new user.
- Log in.
- Search for a location.
- Select a hotel.
- Select a room.
- Choose dates and guests.
- Create a booking.
- Check the booking under My Bookings.
- Test booking cancellation.
- Test profile editing.
- Test password change.
- Test forgot-password and reset-password.
- Test account deletion.
- Verify records through Django Admin.
BookingX was developed to provide practical experience with building a complete full-stack application rather than only implementing isolated frontend pages or backend APIs.
The project focuses on:
- Full-stack architecture
- REST API development
- Database-driven applications
- Authentication and authorization
- Booking business logic
- Transaction management
- API integration
- Location-based search
- Account security
- Administrative management
- Responsive user interfaces
Potential future improvements include:
- Online payment integration
- Hotel reviews and ratings
- Hotel amenities and advanced filtering
- Wishlist/favorites
- Booking invoices
- Email booking confirmations
- Improved hotel recommendation system
- Advanced admin dashboard
- Analytics and booking reports
- Deployment with production infrastructure
- Automated backend and frontend tests
- Docker-based development and deployment
- CI/CD pipeline
Screenshots can be added here to showcase the application.
Example:
## Screenshots
### Home Page

### Hotel Search

### Booking

### My Bookings

### Profile
Building BookingX provided hands-on experience with the complete lifecycle of a modern full-stack web application.
Key areas of learning include:
- Designing RESTful APIs with Django REST Framework
- Building reusable React components
- Managing authentication using JWT
- Handling access-token expiration and refresh
- Designing relational database models
- Implementing real-world booking validation
- Preventing overlapping reservations
- Using database transactions for critical operations
- Integrating third-party APIs
- Implementing secure password recovery
- Building administrative tools with Django Admin
- Managing user activity and security logs
- Structuring a frontend/backend application for maintainability
Adithyan H P
Full-Stack Python Developer | React | Django | PostgreSQL
GitHub: @adithyanhp
If you find this project useful or interesting, consider giving the repository a โญ on GitHub.
This project is currently intended for educational and portfolio purposes.