End‑to‑end hotel booking website built with Node.js, Express, EJS, and SQLite – ideal for a college project demo.
- Modern landing page with hero section, search form, and featured hotels.
- Hotel search by city (with optional dates and guests for UI).
- Hotel details page showing images, description, and available rooms.
- Booking flow:
- Choose room type.
- Enter guest details, dates, and guests count.
- Booking is saved to a SQLite database.
- Redirects to a booking confirmation page.
- Admin bookings page listing all bookings from the database.
- Backend: Node.js, Express
- Views: EJS templates
- Database: SQLite (file
database.sqlitein project root) - Styling: Custom CSS with a modern, responsive layout
-
Install dependencies
cd hotel-booking npm install -
Start the app
npm start
-
Open in browser:
http://localhost:3000
The SQLite database and sample hotel/room data are created automatically on first run.
server.js– Express app and routessrc/db.js– SQLite setup, schema, and queriesviews/– EJS templatesindex.ejs– home / landing pagesearch.ejs– hotel search resultshotel.ejs– hotel details + booking formbooking.ejs– booking confirmationadmin-bookings.ejs– admin view of all bookingspartials/header.ejs,partials/footer.ejs– shared layout
public/css/styles.css– custom responsive stylingdatabase.sqlite– created at runtime, contains tables and sample data
- Demonstrates full stack development (frontend UI, backend routes, persistent DB).
- Uses RESTful endpoints for search, hotel details, and booking.
- Shows data modeling:
hotels,rooms,bookingswith relations. - Clean separation of views, static assets, and database logic.