Skip to content

Latest commit

Β 

History

24 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

EZStay Banner

🏨 EZStay

A modern Full Stack Accommodation Booking Platform built using React.js, Node.js, Express.js, and MySQL. EZStay allows users to explore accommodations across multiple cities while providing a secure admin dashboard for managing cities and stays.


πŸ“– About The Project

EZStay is a full-stack accommodation booking platform designed to simulate a real-world hotel and stay booking experience.

Users can browse available cities, explore accommodations, and view stay details through an intuitive and responsive interface. Administrators have access to a secure dashboard where they can manage cities and accommodation listings.

The project demonstrates complete frontend-backend integration, RESTful API development, JWT-based authentication, role-based authorization, MySQL database management, and responsive UI development.

It serves as a practical implementation of modern full-stack web development concepts using the MERN-inspired architecture with a MySQL relational database.


✨ Features

πŸ‘€ User Features

  • User Registration
  • Secure Login using JWT Authentication
  • Browse Available Cities
  • Explore Available Stays
  • View Stay Details
  • Responsive User Interface

πŸ‘¨β€πŸ’Ό Admin Features

  • Secure Admin Login
  • Add New Cities
  • Delete Cities
  • Add New Accommodation Listings
  • Delete Accommodation Listings
  • Protected Admin Dashboard
  • Role-Based Authorization

πŸ” Authentication & Security

  • JWT Authentication
  • Password Hashing using BCrypt
  • Protected Routes
  • Role-Based Access Control
  • Secure API Communication

πŸ—„ Database Features

  • MySQL Relational Database
  • City Management
  • Accommodation Management
  • User Management
  • Foreign Key Relationships
  • Persistent Data Storage

🎨 User Interface

  • Responsive Layout
  • Modern Card Design
  • Clean Navigation
  • Mobile Friendly
  • Bootstrap Components
  • Elegant Yellow Theme

πŸ“Έ Application Screenshots

🏠 Home Page


πŸ” Authentication

Login Register

πŸ‘€ User Interface


🏨 Available Stays


πŸ› Stay Details


πŸ‘¨β€πŸ’Ό Admin Dashboard


βž• Add New Stay


🌐 Live Demo

Frontend: (Deployment currently unavailable due to expired cloud database service. The project runs completely in a local development environment.)

React Frontend
⬇
Node.js + Express Backend
⬇
MySQL Database

⭐ Project Highlights

  • 🌍 Full Stack Web Application
  • πŸ” JWT Authentication
  • πŸ‘¨β€πŸ’Ό Role-Based Authorization
  • 🏨 Accommodation Management
  • πŸ™ City Management
  • πŸ—„ MySQL Database Integration
  • ⚑ RESTful APIs
  • πŸ“± Responsive Design
  • 🎨 Modern User Interface
  • πŸš€ Production-Ready Architecture

πŸ›  Tech Stack

🎨 Frontend

Technology Purpose
React.js Frontend Development
React Router DOM Client-side Routing
Bootstrap Responsive UI Components
Axios API Communication

βš™ Backend

Technology Purpose
Node.js Runtime Environment
Express.js REST API Development
JWT Authentication & Authorization
BCrypt Password Hashing

πŸ—„ Database

Technology Purpose
MySQL Relational Database
mysql2 Database Connectivity

πŸš€ Development Tools

Tool Purpose
VS Code Code Editor
Git Version Control
GitHub Repository Hosting
Postman API Testing

πŸ— System Architecture

                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚      React Client     β”‚
                    β”‚   (Frontend UI)       β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                               β”‚
                         HTTP Requests
                               β”‚
                               β–Ό
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚ Express.js REST API  β”‚
                    β”‚      Node.js         β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                               β”‚
                  JWT Authentication Layer
                               β”‚
                               β–Ό
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚      MySQL Database   β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“‚ Project Structure

EZStay
β”‚
β”œβ”€β”€ assets
β”‚   β”œβ”€β”€ banner
β”‚   β”‚   └── banner.png
β”‚   β”‚
β”‚   └── screenshots
β”‚       β”œβ”€β”€ home.png
β”‚       β”œβ”€β”€ loginWindow.png
β”‚       β”œβ”€β”€ signupWindow.png
β”‚       β”œβ”€β”€ userInterface.png
β”‚       β”œβ”€β”€ adminDashboard.png
β”‚       β”œβ”€β”€ addStayAdmin.png
β”‚       β”œβ”€β”€ stays.png
β”‚       └── stayDetails.png
β”‚
β”œβ”€β”€ client
β”‚   β”œβ”€β”€ public
β”‚   β”œβ”€β”€ src
β”‚   β”‚   β”œβ”€β”€ components
β”‚   β”‚   β”œβ”€β”€ pages
β”‚   β”‚   β”œβ”€β”€ services
β”‚   β”‚   β”œβ”€β”€ styles
β”‚   β”‚   └── App.js
β”‚   └── package.json
β”‚
β”œβ”€β”€ server
β”‚   β”œβ”€β”€ controllers
β”‚   β”œβ”€β”€ db
β”‚   β”œβ”€β”€ middleware
β”‚   β”œβ”€β”€ routes
β”‚   β”œβ”€β”€ index.js
β”‚   β”œβ”€β”€ package.json
β”‚   └── .env.example
β”‚
β”œβ”€β”€ database
β”‚   └── ezstay.sql
β”‚
β”œβ”€β”€ README.md
└── .gitignore

πŸ—„ Database Design

The project uses a MySQL relational database consisting of three primary tables.

Table Purpose
users Stores user accounts, roles, and authentication credentials
cities Stores city information displayed on the homepage
stays Stores accommodation details linked to individual cities

Relationships

Cities (1)
     β”‚
     β”‚
     β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Ί Stays (Many)

Users
β”‚
β”œβ”€β”€ User
└── Admin

πŸ”Œ REST API Overview

πŸ” Authentication

Method Endpoint Description
POST /api/auth/register Register a new user
POST /api/auth/login Login user

πŸ™ Cities

Method Endpoint Description
GET /api/cities Fetch all cities
POST /api/cities Add new city (Admin)
DELETE /api/cities/:id Delete city (Admin)

🏨 Stays

Method Endpoint Description
GET /api/stays Fetch all stays
GET /api/stays/city/:cityId Fetch stays by city
GET /api/stays/:id Fetch stay details
POST /api/stays Add new stay (Admin)
DELETE /api/stays/:id Delete stay (Admin)

πŸ” Authentication Flow

User Login
     β”‚
     β–Ό

Server verifies credentials
     β”‚
     β–Ό

Password verified using BCrypt
     β”‚
     β–Ό

JWT Token Generated
     β”‚
     β–Ό

Token sent to Client
     β”‚
     β–Ό

Protected Routes Accessible

⚑ Key Functionalities

βœ” User Authentication

βœ” JWT Authorization

βœ” Role-Based Access

βœ” RESTful APIs

βœ” CRUD Operations

βœ” Responsive Interface

βœ” MySQL Integration

βœ” Protected Admin Dashboard

βœ” Secure Password Storage

βœ” Dynamic City & Stay Management


πŸš€ Getting Started

Prerequisites

Before running the project, ensure you have the following installed:

  • Node.js (v18 or above)
  • npm
  • MySQL Server
  • Git
  • VS Code (Recommended)

βš™ Installation

1️⃣ Clone the Repository

git clone https://github.com/TanmayT134/EZStay.git

2️⃣ Navigate to the Project

cd EZStay

3️⃣ Install Frontend Dependencies

cd client
npm install

4️⃣ Install Backend Dependencies

cd ../server
npm install

πŸ”‘ Environment Variables

Create a .env file inside the server directory.

PORT=5000

DB_HOST=localhost
DB_USER=root
DB_PASSWORD=your_password
DB_NAME=EZStay
DB_PORT=3306

JWT_SECRET=your_secret_key

Alternatively, you can use the provided:

server/.env.example

πŸ—„ Database Setup

  1. Open MySQL Workbench.

  2. Create a new database (if it doesn't already exist).

CREATE DATABASE EZStay;
  1. Import the SQL script located in:
database/ezstay.sql

This script will automatically:

  • Create all required tables
  • Insert a demo admin account
  • Insert sample cities
  • Insert sample accommodation listings

β–Ά Running the Application

Start Backend

cd server
npm start

Backend runs on:

http://localhost:5000

Start Frontend

cd client
npm start

Frontend runs on:

http://localhost:3000

πŸ‘¨β€πŸ’» Demo Credentials

Admin

Email Password
tanmay@test.com Admin@123

Note: These credentials are provided only for demonstration purposes and can be modified after importing the database.


πŸ“ˆ Future Enhancements

Some planned improvements include:

  • Hotel Search Functionality
  • Advanced Filters (Price, Rating, Amenities)
  • Image Upload using Cloudinary
  • Booking & Reservation System
  • Payment Gateway Integration
  • User Profile Management
  • Booking History
  • Wishlist / Favorites
  • Email Notifications
  • Google Maps Integration
  • Reviews & Ratings
  • Responsive Admin Dashboard
  • Cloud Deployment with CI/CD
  • Docker Support

🀝 Contributing

Contributions are welcome!

If you'd like to improve EZStay:

  1. Fork the repository.

  2. Create a new feature branch.

git checkout -b feature/your-feature
  1. Commit your changes.
git commit -m "Add new feature"
  1. Push your branch.
git push origin feature/your-feature
  1. Open a Pull Request.

πŸ‘¨β€πŸ’» Author

Tanmay Tawade

If you enjoyed this project, consider giving it a ⭐ on GitHub.


⭐ If you found this project useful, please consider giving it a Star!

It helps support the project and encourages further development.


Made with ❀️ by Tanmay Tawade

About

Full-stack accommodation booking platform built with React, Node.js, Express.js, MySQL, and JWT authentication. Features secure user authentication, role-based admin dashboard, city & stay management, RESTful APIs, and responsive UI.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages