A production-grade, full-stack MERN hotel reservation platform with role-based access control, real-time availability tracking, and integrated payment processing.
Live Demo Β· API Documentation Β· Report Bug Β· Request Feature
|
|
graph LR
A[π€ Guest] -->|Browse & Book| B[π¨ Rooms]
C[π’ Hotel Owner] -->|Manage| B
C -->|View| D[π Dashboard]
E[π Admin] -->|Full Control| B
E -->|Manage| F[π₯ Users]
E -->|Analytics| D
style A fill:#4CAF50,color:#fff
style C fill:#FF9800,color:#fff
style E fill:#F44336,color:#fff
| Role | Capabilities |
|---|---|
| Guest | Browse rooms, search & filter, check availability, book rooms, make payments, view booking history, download invoices |
| Hotel Owner | All guest features + add/edit/delete rooms, upload room images, view booking analytics, manage own listings |
| Administrator | Full platform control + user management, global analytics, booking management (approve/cancel/delete), system metrics |
graph TB
subgraph Client["π Frontend (Vercel)"]
React["βοΈ React 19 + Vite"]
TW["π¨ Tailwind CSS + MUI"]
Router["π React Router v7"]
end
subgraph Server["βοΈ Backend (Render)"]
Express["π Express.js v5"]
Auth["π JWT Auth"]
Multer["π Multer (Uploads)"]
end
subgraph Database["πΎ Database (MongoDB Atlas)"]
Users["π₯ Users"]
Rooms["π¨ Rooms"]
Bookings["π Bookings"]
end
subgraph Payment["π³ Payment Gateway"]
Razorpay["Razorpay API"]
end
React --> Express
Express --> Auth
Express --> Database
Express --> Razorpay
style Client fill:#1a1a2e,color:#fff
style Server fill:#16213e,color:#fff
style Database fill:#0f3460,color:#fff
style Payment fill:#533483,color:#fff
graph LR
User((π§βπ» User)) <-->|HTTPS| Vercel["β² Vercel<br/>React Frontend"]
Vercel <-->|REST API| Render["π§ Render<br/>Express Backend"]
Render <-->|Mongoose| Atlas["π MongoDB Atlas<br/>Cloud Database"]
Render <-->|Payment API| Razorpay["π³ Razorpay<br/>Payment Gateway"]
style Vercel fill:#000,color:#fff
style Render fill:#46E3B7,color:#000
style Atlas fill:#00ED64,color:#000
style Razorpay fill:#3395FF,color:#fff
| Layer | Technology | Version | Purpose |
|---|---|---|---|
| Frontend | React | 19.1 | UI Components & SPA |
| Vite | 6.3 | Build Tool & Dev Server | |
| Tailwind CSS | 4.1 | Utility-First Styling | |
| Material UI | 7.1 | Admin Dashboard Components | |
| React Router | 7.6 | Client-Side Routing | |
| Axios | 1.10 | HTTP Client | |
| Backend | Node.js | 18+ | Runtime Environment |
| Express.js | 5.1 | REST API Framework | |
| Mongoose | 8.16 | MongoDB ODM | |
| Multer | 2.0 | File Upload Handling | |
| Database | MongoDB Atlas | β | Cloud NoSQL Database |
| Payments | Razorpay | 2.9 | Payment Processing |
| DevOps | Vercel | β | Frontend Hosting & CDN |
| Render | β | Backend Hosting | |
| GitHub Actions | β | CI/CD Pipeline |
- Node.js v18 or higher
- MongoDB (local instance or Atlas cluster)
- Git
- Razorpay test/live API keys
# Clone the repository
git clone https://github.com/eldhoaby/HBApp.git
cd HBAppBackend Setup:
cd backend
npm install
# Create environment file
cp ../.env.example .env
# Edit .env with your credentials (see Environment Variables section)
npm start # Production
npm run test # Development with nodemonFrontend Setup:
cd frontend
npm install
# Create environment file
echo "VITE_API_BASE_URL=http://localhost:3000" > .env
echo "VITE_RAZORPAY_KEY_ID=your_razorpay_key" >> .env
npm run dev # Development
npm run build # Production buildπ Backend Variables (click to expand)
| Variable | Description | Example |
|---|---|---|
PORT |
Server port | 3000 |
MONGODB_URI |
MongoDB connection string | mongodb+srv://user:pass@cluster.mongodb.net |
ADMIN_EMAIL |
Admin login email | admin@example.com |
ADMIN_PASSWORD |
Admin login password | securepassword |
RAZORPAY_KEY_ID |
Razorpay API Key | rzp_test_xxxxx |
RAZORPAY_KEY_SECRET |
Razorpay Secret | your_secret |
FRONTEND_URL |
Allowed CORS origin | http://localhost:5173 |
π Frontend Variables (click to expand)
| Variable | Description | Example |
|---|---|---|
VITE_API_BASE_URL |
Backend API URL | http://localhost:3000 |
VITE_RAZORPAY_KEY_ID |
Razorpay public key | rzp_test_xxxxx |
HBApp/
βββ π frontend/ # React + Vite Application
β βββ π public/ # Static assets & favicon
β βββ π src/
β β βββ π assets/ # Images, icons, SVGs
β β βββ π components/ # Reusable UI components
β β β βββ π hotelOwner/ # Admin dashboard components
β β β βββ Hero.jsx # Landing page hero
β β β βββ Navbar.jsx # Navigation bar
β β β βββ Login.jsx # Auth modal
β β β βββ Register.jsx # Registration modal
β β βββ π pages/ # Route-level pages
β β β βββ Home.jsx # Landing page
β β β βββ AllRooms.jsx # Room listing + filters
β β β βββ RoomDetails.jsx # Room detail + booking
β β β βββ Payment.jsx # Payment processing
β β β βββ MyBookings.jsx # User booking history
β β βββ App.jsx # Root layout & routing
β β βββ main.jsx # React DOM entry
β βββ vercel.json # Vercel SPA rewrites
β βββ package.json
βββ π backend/ # Express.js API Server
β βββ π configs/ # Database configuration
β βββ π models/ # Mongoose schemas
β β βββ user.js # User model
β β βββ room.js # Room model
β β βββ booking.js # Booking model
β βββ π routes/ # API route handlers
β β βββ auth.js # Authentication routes
β β βββ rooms.js # Room CRUD routes
β β βββ bookings.js # Booking routes
β β βββ admin.js # Admin routes
β β βββ payment.js # Stripe payment routes
β β βββ razorpay.js # Razorpay payment routes
β βββ server.js # Express entry point
β βββ package.json
βββ π docs/ # Technical documentation
βββ π screenshots/ # Application screenshots
βββ π .github/ # CI/CD & GitHub templates
β βββ π workflows/
β β βββ ci.yml # GitHub Actions pipeline
β βββ ISSUE_TEMPLATE.md
β βββ PULL_REQUEST_TEMPLATE.md
βββ .env.example # Environment template
βββ .gitignore # Git exclusion rules
βββ CHANGELOG.md # Version history
βββ CODE_OF_CONDUCT.md # Community guidelines
βββ CONTRIBUTING.md # Contribution guide
βββ LICENSE # MIT License
βββ README.md # β You are here
βββ SECURITY.md # Security policy
βββ render.yaml # Render deployment blueprint
| Method | Endpoint | Description | Auth |
|---|---|---|---|
POST |
/users/register |
Register a new user | Public |
POST |
/users/login |
Authenticate user | Public |
GET |
/rooms |
Fetch all rooms | Public |
GET |
/rooms/:id |
Fetch room by ID | Public |
POST |
/rooms |
Create a room | Owner |
PUT |
/rooms/:id |
Update a room | Owner |
DELETE |
/rooms/:id |
Delete a room | Owner |
POST |
/rooms/check-availability |
Check room availability | Public |
POST |
/bookings |
Create a booking | User |
GET |
/bookings/user/:id |
Get user bookings | User |
PUT |
/bookings/:id |
Update booking status | Admin |
DELETE |
/bookings/:id |
Delete a booking | Admin |
POST |
/admin/login |
Admin authentication | Admin |
GET |
/admin/metrics |
Platform analytics | Admin |
POST |
/razorpay/create-order |
Create payment order | User |
π Full API documentation: docs/api.md
The application is deployed on a modern cloud infrastructure:
| Component | Platform | URL |
|---|---|---|
| Frontend | Vercel | hb-app-eldho.vercel.app |
| Backend | Render | homystay-backend.onrender.com |
| Database | MongoDB Atlas | Private cluster |
π Full deployment guide: docs/deployment_setup.md
- π OAuth2 (Google / GitHub) authentication
- π¬ Real-time chat (Socket.io) between guests & owners
- πΊοΈ Mapbox integration for geographical hotel search
- π Multi-language (i18n) support
- β‘ Redis caching for faster queries
- π§ Email notifications (booking confirmations, reminders)
- β Guest review & rating system
- π± Progressive Web App (PWA) support
Contributions make the open-source community thrive! See our Contributing Guidelines for details.
# Fork β Clone β Branch β Code β Push β PR
git checkout -b feature/amazing-feature
git commit -m "feat: add amazing feature"
git push origin feature/amazing-featureDistributed under the MIT License. See LICENSE for details.
- React β UI Library
- Express.js β Backend Framework
- MongoDB Atlas β Cloud Database
- Razorpay β Payment Gateway
- Vercel β Frontend Hosting
- Render β Backend Hosting
- Tailwind CSS β Styling Framework
β Star this repository if you found it helpful!
Made with β€οΈ by Eldho



