Skip to content

This is a full-stack Hotel Management System built with Node.js, Express, MongoDB, and EJS. It allows users to register, log in, browse available rooms, and make reservations. Admins can manage users, bookings, and view reports through a dedicated dashboard.

License

Notifications You must be signed in to change notification settings

Anmol283/BE_ElaraRegency

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

14 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🏨 Elara Regency - Luxury Hotel Web Application

GIF

✨ Overview

Elara Regency is a full-stack web application for a luxury hotel, built with Node.js, Express, MongoDB Atlas, and EJS templating. It provides a complete hotel management system with user authentication, room reservations, profile management, and an admin dashboard.


Anmol Designed UI using EJS, integrated MongoDB for data storage.
Arshdeep Singh Developed frontend and backend functionality, and integrated MongoDB for data handling.
Anshu Dhawan Implemented authentication middleware and route protection.
Damandeep Singh Handled documentation, report writing, and testing summaries for the project.

🌟 Features

  • πŸ‘€ User Authentication

    • Register, login, and logout functionality
    • Secure password hashing with Bcrypt
    • Session management
  • πŸ›Œ Room Reservations

    • Browse available rooms
    • Make and manage reservations
    • View booking history
  • πŸ‘‘ Admin Dashboard

    • Manage users and reservations
    • View analytics and reports
    • Handle contact messages
  • πŸ‘¨β€πŸ’Ό User Profiles

    • View and edit profile details
    • Track reservation h

πŸ› οΈ Tech Stack

Category Technologies
Backend Node.js Express.js
Database MongoDB Atlas
Templating EJS
Middleware Helmet CORS Morgan Compression Cookie-Parser
Authentication Bcrypt Express-Session
Frontend HTML5 CSS3 JavaScript

πŸ“ Directory Structure

Elara-Regency/
β”œβ”€β”€ πŸ“‚ api/                    # API routes for data handling
β”œβ”€β”€ πŸ“‚ middlewares/            # Application middleware
β”‚   β”œβ”€β”€ index.js               # Exports all middleware
β”‚   β”œβ”€β”€ authMiddleware.js      # Authentication middleware
β”‚   β”œβ”€β”€ performanceMiddleware.js # Performance optimization
β”‚   └── securityMiddleware.js  # Security enhancements
β”œβ”€β”€ πŸ“‚ models/                 # Database models
β”‚   β”œβ”€β”€ User.js                # User schema and model
β”‚   β”œβ”€β”€ Reservation.js         # Reservation schema and model
β”‚   β”œβ”€β”€ ContactMessage.js      # Contact message schema and model
β”‚   └── users.json             # Sample user data
β”œβ”€β”€ πŸ“‚ node_modules/           # Node.js dependencies
β”œβ”€β”€ πŸ“‚ public/                 # Static assets
β”‚   β”œβ”€β”€ css/                   # Stylesheets
β”‚   β”œβ”€β”€ js/                    # Client-side JavaScript
β”‚   └── images/                # Image assets
β”œβ”€β”€ πŸ“‚ views/                  # EJS templates
β”‚   β”œβ”€β”€ 404.ejs               # 404 page
β”‚   β”œβ”€β”€ about.ejs             # About page
β”‚   β”œβ”€β”€ admin-dashboard.ejs   # Admin dashboard
β”‚   β”œβ”€β”€ blog.ejs              # Blog page
β”‚   β”œβ”€β”€ contact.ejs           # Contact page
β”‚   β”œβ”€β”€ error.ejs             # Error page
β”‚   β”œβ”€β”€ home.ejs              # Home page
β”‚   β”œβ”€β”€ location-detail.ejs   # Location detail page
β”‚   β”œβ”€β”€ locations.ejs         # Locations page
β”‚   β”œβ”€β”€ login.ejs             # Login page
β”‚   β”œβ”€β”€ profile.ejs           # User profile page
β”‚   β”œβ”€β”€ register.ejs          # Register page
β”‚   β”œβ”€β”€ reservation.ejs       # Reservation page
β”‚   └── rooms.ejs             # Rooms page
β”œβ”€β”€ πŸ“‚ .git/                   # Git repository files
β”œβ”€β”€ πŸ“„ package.json            # Project metadata and dependencies
β”œβ”€β”€ πŸ“„ package-lock.json       # Dependency lock file
β”œβ”€β”€ πŸ“„ README.md               # Project documentation
└── πŸ“„ server.js               # Main server file

πŸš€ Getting Started

Prerequisites

  • Node.js (v14.x or higher)
  • MongoDB Atlas account
  • Git

Installation

  1. Clone the Repository:

    git clone https://github.com/Anmol283/BE_ElaraRegency
    cd elara-regency
  2. Install Dependencies:

    npm install
  3. Set Up Environment Variables: Create a .env file in the root directory:

    MONGO_URI=mongodb+srv://your-username:[email protected]/?retryWrites=true&w=majority
    PORT=3000
    SESSION_SECRET=your_secret_key
    
  4. Run the Application:

    npm start

    The server will start at http://localhost:3000


🧭 Usage Guide

  • 🏠 Home Page: Visit http://localhost:3000/ to explore the hotel
  • πŸ“ Register/Login: Create an account or sign in
  • πŸ‘€ Profile: View your details and reservation history
  • πŸ›Œ Reservations: Browse and book rooms
  • πŸ‘‘ Admin Dashboard: Manage users and reservations (admin access only)

πŸ’Ύ Database Setup

  1. Create MongoDB Atlas Account:

  2. Configure Database Access:

    • Create a database user
    • Set up network access (IP whitelist)
  3. Get Connection String:

    • Navigate to "Connect" > "Connect your application"
    • Copy the connection string and update your .env file

πŸ”’ Security Features

  • Password Protection: All passwords are hashed using bcrypt
  • HTTP Security: Helmet middleware for securing HTTP headers
  • CORS Protection: Configured to prevent cross-origin issues
  • Input Validation: Sanitization of user inputs
  • Authentication: Protected routes with auth middleware

🀝 Contributing

  1. Fork the repository
  2. Create a new branch (git checkout -b feature-branch)
  3. Make your changes and commit (git commit -m "Add feature")
  4. Push to the branch (git push origin feature-branch)
  5. Create a Pull Request

πŸ“œ License

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


⭐ Star this repository if you find it useful! ⭐

About

This is a full-stack Hotel Management System built with Node.js, Express, MongoDB, and EJS. It allows users to register, log in, browse available rooms, and make reservations. Admins can manage users, bookings, and view reports through a dedicated dashboard.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •