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. |
-
π€ 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
| Category | Technologies |
|---|---|
| Backend | |
| Database | |
| Templating | |
| Middleware | |
| Authentication | |
| Frontend |
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
- Node.js (v14.x or higher)
- MongoDB Atlas account
- Git
-
Clone the Repository:
git clone https://github.com/Anmol283/BE_ElaraRegency cd elara-regency -
Install Dependencies:
npm install
-
Set Up Environment Variables: Create a
.envfile in the root directory:MONGO_URI=mongodb+srv://your-username:[email protected]/?retryWrites=true&w=majority PORT=3000 SESSION_SECRET=your_secret_key -
Run the Application:
npm start
The server will start at http://localhost:3000
- π 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)
-
Create MongoDB Atlas Account:
- Sign up at MongoDB Atlas
- Create a new cluster
-
Configure Database Access:
- Create a database user
- Set up network access (IP whitelist)
-
Get Connection String:
- Navigate to "Connect" > "Connect your application"
- Copy the connection string and update your
.envfile
- 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
- Fork the repository
- Create a new branch (
git checkout -b feature-branch) - Make your changes and commit (
git commit -m "Add feature") - Push to the branch (
git push origin feature-branch) - Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
β Star this repository if you find it useful! β
