A complete, production-ready Hotel Management System with luxury UI and full-stack functionality
Features β’ Installation β’ Documentation β’ Demo β’ Support
- Overview
- Features
- Tech Stack
- Project Structure
- Installation & Setup
- Configuration
- API Documentation
- Database Schema
- UI/UX Pages
- Security
- Development
- Testing
- Deployment
- Troubleshooting
- Contributing
- License
LuxeStay is a comprehensive, enterprise-grade Hotel Management System designed for luxury hotels and hospitality businesses. Built with modern web technologies, it provides a complete solution for managing rooms, bookings, customers, billing, and analytics with a beautiful, intuitive interface.
- β¨ Luxury Design - Premium 5-star hotel aesthetic with glassmorphism effects
- π Production Ready - Complete backend with authentication, validation, and security
- π± Fully Responsive - Works seamlessly on desktop, tablet, and mobile devices
- π Enterprise Security - JWT authentication, role-based access, encrypted passwords
- π Advanced Analytics - Real-time reporting and data visualization
- π― Easy to Deploy - Simple setup process with comprehensive documentation
-
Luxury Design Language
- Modern glassmorphism effects
- Gradient backgrounds and smooth transitions
- Professional color scheme (Gold, Navy, White)
- Custom animations and micro-interactions
-
Responsive Design
- Mobile-first approach
- Tablet and desktop optimized
- Flexible grid layouts
- Touch-friendly controls
-
Accessibility
- WCAG 2.1 compliant
- Keyboard navigation
- Screen reader support
- High contrast modes
-
Multi-Method Login
- Email/Password authentication
- Google OAuth 2.0 integration
- Remember me functionality
- Secure password reset
-
Role-Based Access Control
- Admin: Full system access
- Receptionist: Front desk operations
- Staff: Limited operational access
- Manager: Reports and analytics
-
Security Features
- JWT token-based sessions
- Password encryption (bcrypt)
- Secure HTTP-only cookies
- CSRF protection
- Rate limiting on auth endpoints
- Add, edit, and delete rooms
- Multiple room types (Deluxe, Suite, Standard, etc.)
- Room status tracking (Available, Occupied, Maintenance)
- Pricing management
- Amenities configuration
- Photo gallery per room
- Room availability calendar
- Comprehensive customer database
- Customer profiles with history
- Contact information management
- Booking history tracking
- Customer preferences
- Loyalty program integration
- Document storage (ID, passport)
- Intelligent booking engine
- Real-time availability checking
- Booking conflict prevention
- Multiple booking types (Online, Walk-in, Phone)
- Reservation modifications
- Cancellation handling
- Group booking support
- Special requests management
- Automated invoice generation
- Tax calculations (GST/VAT)
- Multiple payment methods
- Payment tracking
- Refund processing
- Discount and coupon management
- PDF invoice export
- Email invoice delivery
- Revenue reports (Daily, Weekly, Monthly, Yearly)
- Occupancy rate analytics
- Customer demographics
- Booking source analysis
- Room performance metrics
- Staff performance reports
- Export to CSV/PDF/Excel
- Custom date range filtering
- Real-time statistics
- Interactive charts (Chart.js)
- Quick action buttons
- Recent activity feed
- Upcoming bookings overview
- Revenue trends
- Occupancy visualization
- Alert notifications
| Technology | Version | Purpose |
|---|---|---|
| HTML5 | Latest | Semantic markup |
| CSS3 | Latest | Styling and animations |
| JavaScript | ES6+ | Client-side logic |
| Bootstrap | 5.3+ | Responsive framework |
| Font Awesome | 6.0+ | Icon library |
| Chart.js | 4.0+ | Data visualization |
| Technology | Version | Purpose |
|---|---|---|
| Node.js | 16+ | JavaScript runtime |
| Express.js | 4.18+ | Web framework |
| MySQL | 8.0+ | Database |
| JWT | Latest | Authentication |
| bcrypt | Latest | Password hashing |
| Passport.js | Latest | OAuth integration |
- Version Control: Git
- Package Manager: npm/yarn
- API Testing: Postman/Thunder Client
- Database Tool: MySQL Workbench
- Code Editor: VS Code (recommended)
HOTEL-MANAGEMENT/
β
βββ π backend/
β βββ π config/
β β βββ database.js # MySQL connection pool configuration
β β
β βββ π controllers/
β β βββ authController.js # Authentication logic (signup, login, verify)
β β βββ roomController.js # Room CRUD operations
β β βββ customerController.js # Customer management
β β βββ bookingController.js # Booking operations
β β βββ paymentController.js # Payment processing
β β βββ reportController.js # Analytics and reports
β β
β βββ π middleware/
β β βββ authMiddleware.js # JWT verification
β β βββ roleMiddleware.js # Role-based authorization
β β βββ validationMiddleware.js # Input validation
β β βββ errorMiddleware.js # Error handling
β β
β βββ π routes/
β β βββ authRoutes.js # /api/auth endpoints
β β βββ roomRoutes.js # /api/rooms endpoints
β β βββ customerRoutes.js # /api/customers endpoints
β β βββ bookingRoutes.js # /api/bookings endpoints
β β βββ paymentRoutes.js # /api/payments endpoints
β β βββ reportRoutes.js # /api/reports endpoints
β β
β βββ π utils/
β β βββ emailService.js # Email notifications
β β βββ pdfGenerator.js # Invoice PDF generation
β β βββ validators.js # Custom validators
β β βββ helpers.js # Utility functions
β β
β βββ π models/ # Database models (optional ORM)
β β
β βββ .env # Environment variables (not in repo)
β βββ .env.example # Environment template
β βββ package.json # Node dependencies
β βββ package-lock.json # Dependency lock file
β βββ server.js # Express server entry point
β
βββ π frontend/
β βββ π css/
β β βββ style.css # Landing page styles
β β βββ auth.css # Authentication pages styles
β β βββ dashboard.css # Dashboard layout styles
β β βββ components.css # Reusable component styles
β β
β βββ π js/
β β βββ main.js # Landing page functionality
β β βββ animations.js # Advanced animations
β β βββ signup.js # Signup page logic
β β βββ login.js # Login page logic
β β βββ dashboard.js # Dashboard functionality
β β βββ api.js # API service layer
β β βββ utils.js # Utility functions
β β
β βββ π images/
β β βββ byui.jpeg # Hotel images
β β βββ r3.jpg # Room photos
β β βββ ro1.webp # WebP optimized images
β β βββ ro2.webp
β β βββ ro3.webp
β β βββ ro4.webp
β β βββ ro5.webp
β β βββ ro6.webp
β β βββ ro7.webp
β β
β βββ π pages/
β β βββ login.html # User login page
β β βββ signup.html # User registration page
β β βββ dashboard.html # Main dashboard
β β βββ rooms.html # Room management
β β βββ customers.html # Customer management
β β βββ bookings.html # Booking management
β β βββ billing.html # Billing & invoices
β β βββ reports.html # Reports & analytics
β β βββ profile.html # User profile settings
β β
β βββ index.html # Landing page
β
βββ π database/
β βββ database.sql # Complete database schema
β βββ seeders.sql # Sample data for testing
β βββ migrations/ # Database version control
β
βββ π docs/
β βββ API.md # API documentation
β βββ SETUP.md # Detailed setup guide
β βββ CONTRIBUTING.md # Contribution guidelines
β βββ CHANGELOG.md # Version history
β
βββ .gitignore # Git ignore rules
βββ README.md # This file
βββ LICENSE # MIT License
βββ QUICKSTART.md # Quick start guide
Before you begin, ensure you have the following installed:
- Node.js (v16.0.0 or higher) - Download
- MySQL (v8.0 or higher) - Download
- Git (optional) - Download
- Code Editor - VS Code recommended
# 1. Clone or download the repository
git clone https://github.com/yourusername/luxestay.git
cd luxestay
# 2. Import database
mysql -u root -p < database.sql
# 3. Setup backend
cd backend
npm install
cp .env.example .env
# Edit .env with your settings
npm start
# 4. Setup frontend (new terminal)
cd frontend
npx http-server -p 3000
# 5. Open browser
# Visit: http://localhost:3000-
Start MySQL Server
# Windows net start MySQL80 # macOS (Homebrew) brew services start mysql # Linux sudo systemctl start mysql # or sudo service mysql start
-
Create Database
# Method 1: Command Line mysql -u root -p < database.sql # Method 2: MySQL Workbench # - Open MySQL Workbench # - Connect to your MySQL server # - File β Run SQL Script # - Select database.sql # - Click Execute
-
Verify Database Creation
mysql -u root -p USE luxestay_hotel; SHOW TABLES; -- You should see: -- users, roles, rooms, room_types, customers, -- bookings, payments, invoices, etc.
-
Create Default Admin User (Optional)
-- The database.sql already includes default users -- Admin credentials: -- Email: admin@luxestay.com -- Password: Admin@123
-
Navigate to Backend Directory
cd backend -
Install Dependencies
npm install # This installs: # - express # - mysql2 # - jsonwebtoken # - bcryptjs # - cors # - dotenv # - helmet # - express-rate-limit # - passport # - passport-google-oauth20
-
Configure Environment Variables
# Copy example environment file cp .env.example .env # Edit with your preferred editor nano .env # or code .env
-
Update .env File
# Server Configuration PORT=5000 NODE_ENV=development FRONTEND_URL=http://localhost:3000 # Database Configuration DB_HOST=localhost DB_PORT=3306 DB_USER=root DB_PASSWORD=your_mysql_root_password DB_NAME=luxestay_hotel # JWT Configuration JWT_SECRET=your_super_secret_key_min_32_characters_long_for_security JWT_EXPIRE=7d JWT_COOKIE_EXPIRE=7 # Google OAuth (Optional - for social login) GOOGLE_CLIENT_ID=your_google_client_id_here GOOGLE_CLIENT_SECRET=your_google_client_secret_here GOOGLE_CALLBACK_URL=http://localhost:5000/api/auth/google/callback # Email Configuration (Optional - for notifications) SMTP_HOST=smtp.gmail.com SMTP_PORT=587 SMTP_USER=your_email@gmail.com SMTP_PASS=your_app_specific_password # File Upload Configuration MAX_FILE_SIZE=5242880 UPLOAD_PATH=./uploads
-
Start Backend Server
# Production mode npm start # Development mode (with auto-reload) npm run dev
Expected Output:
βββββββββββββββββββββββββββββββββββββββββββββββββ β β β π¨ LuxeStay Hotel Management System β β β β Server Status: RUNNING β β Port: 5000 β β Environment: development β β Database: Connected β β β API URL: http://localhost:5000 β β β β Health Check: http://localhost:5000/health β β API Docs: http://localhost:5000/api-docs β β β βββββββββββββββββββββββββββββββββββββββββββββββββ [2024-02-02 10:30:45] INFO: Database connected successfully [2024-02-02 10:30:45] INFO: Server initialized
-
Open New Terminal Tab/Window
-
Navigate to Frontend Directory
cd frontend -
Serve Frontend Files
Option A: Using Node.js http-server (Recommended)
# Install globally (one time) npm install -g http-server # Serve the frontend http-server -p 3000 -c-1 # Options: # -p 3000: Port number # -c-1: Disable caching
Option B: Using Python
# Python 3 python -m http.server 3000 # Python 2 python -m SimpleHTTPServer 3000
Option C: Using PHP
php -S localhost:3000
Option D: Using VS Code Live Server
- Install "Live Server" extension in VS Code
- Right-click
index.html - Select "Open with Live Server"
- Server will start on port 5500 by default
-
Access the Application
Open your browser and navigate to:
http://localhost:3000
-
Test Backend API
# Health check curl http://localhost:5000/health # Should return: # {"status":"success","message":"Server is running"}
-
Test Frontend
- Landing page should load with animations
- Navigation should work smoothly
- Images should display correctly
-
Test Authentication
# Login endpoint test curl -X POST http://localhost:5000/api/auth/login \ -H "Content-Type: application/json" \ -d '{"email":"admin@luxestay.com","password":"Admin@123"}' # Should return JWT token
| Variable | Description | Default | Required |
|---|---|---|---|
PORT |
Backend server port | 5000 | Yes |
NODE_ENV |
Environment (development/production) | development | Yes |
FRONTEND_URL |
Frontend URL for CORS | http://localhost:3000 | Yes |
DB_HOST |
MySQL host address | localhost | Yes |
DB_PORT |
MySQL port | 3306 | No |
DB_USER |
Database username | root | Yes |
DB_PASSWORD |
Database password | - | Yes |
DB_NAME |
Database name | luxestay_hotel | Yes |
JWT_SECRET |
Secret key for JWT tokens | - | Yes |
JWT_EXPIRE |
Token expiration time | 7d | No |
GOOGLE_CLIENT_ID |
Google OAuth client ID | - | No |
GOOGLE_CLIENT_SECRET |
Google OAuth secret | - | No |
The config/database.js file manages the MySQL connection pool:
const pool = mysql.createPool({
host: process.env.DB_HOST,
user: process.env.DB_USER,
password: process.env.DB_PASSWORD,
database: process.env.DB_NAME,
waitForConnections: true,
connectionLimit: 10,
queueLimit: 0
});CORS is configured in server.js to allow frontend-backend communication:
app.use(cors({
origin: process.env.FRONTEND_URL,
credentials: true
}));http://localhost:5000/api
Most endpoints require a JWT token in the Authorization header:
Authorization: Bearer <your-jwt-token>
Register a new user account.
Request Body:
{
"name": "John Doe",
"email": "john@example.com",
"password": "SecurePass123!",
"phone": "+1234567890",
"role": "admin"
}Response (201 Created):
{
"success": true,
"message": "User registered successfully",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"user": {
"id": 1,
"name": "John Doe",
"email": "john@example.com",
"role": "admin"
}
}Authenticate user and receive JWT token.
Request Body:
{
"email": "admin@luxestay.com",
"password": "Admin@123"
}Response (200 OK):
{
"success": true,
"message": "Login successful",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"user": {
"id": 1,
"name": "Admin User",
"email": "admin@luxestay.com",
"role": "admin"
}
}Verify JWT token validity.
Headers:
Authorization: Bearer <token>
Response (200 OK):
{
"success": true,
"valid": true,
"user": {
"id": 1,
"email": "admin@luxestay.com",
"role": "admin"
}
}Get current user details.
Headers:
Authorization: Bearer <token>
Response (200 OK):
{
"success": true,
"user": {
"id": 1,
"name": "Admin User",
"email": "admin@luxestay.com",
"phone": "+1234567890",
"role": "admin",
"created_at": "2024-01-15T10:30:00Z"
}
}Get all rooms with filters.
Query Parameters:
type: Room type filter (deluxe, suite, standard)status: Status filter (available, occupied, maintenance)minPrice: Minimum price filtermaxPrice: Maximum price filter
Response (200 OK):
{
"success": true,
"count": 25,
"rooms": [
{
"id": 1,
"room_number": "101",
"type": "Deluxe",
"status": "available",
"price": 150.00,
"capacity": 2,
"description": "Luxury room with ocean view",
"amenities": ["WiFi", "TV", "Mini Bar", "Balcony"]
}
]
}Create a new room (Admin only).
Request Body:
{
"room_number": "305",
"type_id": 1,
"floor": 3,
"price": 200.00,
"capacity": 3,
"description": "Premium suite with city view",
"status": "available"
}Update room details.
Delete a room (Admin only).
Get all customers.
Add new customer.
Request Body:
{
"first_name": "Jane",
"last_name": "Smith",
"email": "jane@example.com",
"phone": "+1234567890",
"id_type": "passport",
"id_number": "AB123456",
"address": "123 Main St, City, Country"
}Get customer by ID.
Update customer details.
Get all bookings.
Create new booking.
Request Body:
{
"customer_id": 5,
"room_id": 12,
"check_in": "2024-03-01",
"check_out": "2024-03-05",
"adults": 2,
"children": 1,
"special_requests": "Late check-in required"
}Get booking details.
Update booking.
Cancel booking.
Get all payments.
Process payment.
Request Body:
{
"booking_id": 123,
"amount": 750.00,
"payment_method": "credit_card",
"transaction_id": "TXN123456789"
}Get revenue report.
Query Parameters:
startDate: Start date (YYYY-MM-DD)endDate: End date (YYYY-MM-DD)groupBy: Grouping (day, week, month, year)
Get occupancy report.
Get customer analytics.
All error responses follow this format:
{
"success": false,
"error": "Error message here",
"statusCode": 400
}Common Status Codes:
200- Success201- Created400- Bad Request401- Unauthorized403- Forbidden404- Not Found500- Server Error
Stores user accounts and authentication information.
CREATE TABLE users (
id INT PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(100) NOT NULL,
email VARCHAR(100) UNIQUE NOT NULL,
password VARCHAR(255) NOT NULL,
phone VARCHAR(20),
role_id INT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
FOREIGN KEY (role_id) REFERENCES roles(id)
);User role definitions.
CREATE TABLE roles (
id INT PRIMARY KEY AUTO_INCREMENT,
role_name VARCHAR(50) UNIQUE NOT NULL,
description TEXT
);Room category definitions.
CREATE TABLE room_types (
id INT PRIMARY KEY AUTO_INCREMENT,
type_name VARCHAR(50) NOT NULL,
description TEXT,
base_price DECIMAL(10,2),
max_occupancy INT
);Room inventory.
CREATE TABLE rooms (
id INT PRIMARY KEY AUTO_INCREMENT,
room_number VARCHAR(10) UNIQUE NOT NULL,
type_id INT,
floor INT,
price DECIMAL(10,2) NOT NULL,
status ENUM('available','occupied','maintenance') DEFAULT 'available',
description TEXT,
FOREIGN KEY (type_id) REFERENCES room_types(id)
);Customer information.
CREATE TABLE customers (
id INT PRIMARY KEY AUTO_INCREMENT,
first_name VARCHAR(50) NOT NULL,
last_name VARCHAR(50) NOT NULL,
email VARCHAR(100),
phone VARCHAR(20) NOT NULL,
id_type VARCHAR(20),
id_number VARCHAR(50),
address TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);Reservation records.
CREATE TABLE bookings (
id INT PRIMARY KEY AUTO_INCREMENT,
customer_id INT NOT NULL,
room_id INT NOT NULL,
check_in DATE NOT NULL,
check_out DATE NOT NULL,
adults INT DEFAULT 1,
children INT DEFAULT 0,
total_amount DECIMAL(10,2),
status ENUM('confirmed','checked_in','checked_out','cancelled') DEFAULT 'confirmed',
special_requests TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (customer_id) REFERENCES customers(id),
FOREIGN KEY (room_id) REFERENCES rooms(id)
);Payment transactions.
CREATE TABLE payments (
id INT PRIMARY KEY AUTO_INCREMENT,
booking_id INT NOT NULL,
amount DECIMAL(10,2) NOT NULL,
payment_method VARCHAR(50),
transaction_id VARCHAR(100),
payment_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
status ENUM('pending','completed','failed','refunded') DEFAULT 'pending',
FOREIGN KEY (booking_id) REFERENCES bookings(id)
);users (1) βββ (Many) bookings
roles (1) βββ (Many) users
room_types (1) βββ (Many) rooms
rooms (1) βββ (Many) bookings
customers (1) βββ (Many) bookings
bookings (1) βββ (Many) payments
bookings (1) βββ (1) invoices
Get available rooms for date range:
SELECT r.* FROM rooms r
WHERE r.status = 'available'
AND r.id NOT IN (
SELECT room_id FROM bookings
WHERE status != 'cancelled'
AND check_in < '2024-03-10'
AND check_out > '2024-03-05'
);Get revenue for current month:
SELECT SUM(amount) as total_revenue
FROM payments
WHERE MONTH(payment_date) = MONTH(CURRENT_DATE())
AND YEAR(payment_date) = YEAR(CURRENT_DATE())
AND status = 'completed';Purpose: Marketing and first impression
Sections:
- Hero section with parallax effect
- Feature showcase with icons
- Room gallery with hover effects
- Statistics counter animation
- Testimonials slider
- Call-to-action buttons
- Premium footer
Key Features:
- Smooth scroll navigation
- Lazy loading images
- AOS (Animate On Scroll) effects
- Responsive hamburger menu
- Multi-step form
- Role selection
- Password strength meter
- Email validation
- Terms & conditions checkbox
- Google OAuth button
- Email/password fields
- Remember me checkbox
- Forgot password link
- Google OAuth integration
- Link to signup page
- Statistics cards (Occupancy, Revenue, Bookings, Customers)
- Quick action buttons
- Revenue chart (Chart.js)
- Recent bookings table
- Upcoming check-ins/check-outs
- Notifications panel
- Room grid/list view toggle
- Filter by type, status, price
- Sort options
- Add/Edit room modal
- Room details view
- Bulk actions
- Customer table with search
- Filter by date, status
- Add customer form
- Customer profile view
- Booking history
- Export to CSV
- Calendar view
- List view with filters
- Create booking wizard
- Booking timeline
- Status management
- Check-in/Check-out actions
- Invoice list
- Create invoice
- Payment recording
- Tax calculation
- PDF generation
- Email invoice
- Date range selector
- Revenue charts
- Occupancy graphs
- Customer analytics
- Export options
- Print reports
- User information
- Password change
- Notification settings
- Theme preferences
- Activity log
-
Authentication Security
- JWT with secure signing algorithm (HS256)
- HTTP-only cookies for token storage
- Token expiration and refresh
- Password complexity requirements
-
Password Security
- bcrypt hashing (10 salt rounds)
- Minimum 8 characters
- Must include uppercase, lowercase, number, special char
- Password history to prevent reuse
-
Input Validation
- Server-side validation for all inputs
- SQL injection prevention (parameterized queries)
- XSS protection (input sanitization)
- CSRF token validation
-
HTTP Security Headers (via Helmet.js)
helmet.contentSecurityPolicy() helmet.dnsPrefetchControl() helmet.frameguard() helmet.hidePoweredBy() helmet.hsts() helmet.ieNoOpen() helmet.noSniff() helmet.xssFilter()
-
Rate Limiting
- Login: 5 attempts per 15 minutes
- API calls: 100 per 15 minutes per IP
- Signup: 3 accounts per hour per IP
-
Database Security
- Prepared statements (prevent SQL injection)
- Principle of least privilege
- Connection pooling with limits
- Encrypted database connections (SSL)
-
Session Management
- Secure session cookies
- Session timeout (7 days default)
- Logout on all devices option
- Active session monitoring
- Never commit
.envfile - Regularly update dependencies
- Use HTTPS in production
- Implement proper logging
- Regular security audits
- Backup database regularly
-
Install Development Dependencies
cd backend npm install --save-dev nodemon -
Run in Development Mode
npm run dev
-
Enable Debug Logging
DEBUG=* npm run dev
JavaScript:
- Use ES6+ features
- 2 spaces for indentation
- Semicolons required
- camelCase for variables
- PascalCase for classes
CSS:
- BEM methodology
- Mobile-first approach
- Use CSS variables
- Comment complex selectors
File Naming:
- kebab-case for files
- camelCase for JavaScript
- PascalCase for components
- Create controller in
controllers/ - Define routes in
routes/ - Add middleware if needed
- Update API documentation
- Create HTML page in
pages/ - Add styles in
css/ - Write JavaScript in
js/ - Update navigation
-- Example migration file: 001_add_loyalty_points.sql
ALTER TABLE customers
ADD COLUMN loyalty_points INT DEFAULT 0;
-- Run migration
mysql -u root -p luxestay_hotel < migrations/001_add_loyalty_points.sqlTest Authentication:
# Signup
curl -X POST http://localhost:5000/api/auth/signup \
-H "Content-Type: application/json" \
-d '{"name":"Test User","email":"test@test.com","password":"Test@123","role":"admin"}'
# Login
curl -X POST http://localhost:5000/api/auth/login \
-H "Content-Type: application/json" \
-d '{"email":"test@test.com","password":"Test@123"}'Test Protected Routes:
# Get rooms (requires token)
curl http://localhost:5000/api/rooms \
-H "Authorization: Bearer YOUR_TOKEN_HERE"- User registration works
- Login authentication successful
- JWT token validation
- Room CRUD operations
- Booking creation and management
- Payment processing
- Report generation
- Responsive design on mobile
- Cross-browser compatibility
- Performance optimization
# Install Heroku CLI
# Login to Heroku
heroku login
# Create app
heroku create luxestay-api
# Set environment variables
heroku config:set NODE_ENV=production
heroku config:set DB_HOST=your-db-host
heroku config:set DB_USER=your-db-user
heroku config:set DB_PASSWORD=your-db-password
heroku config:set JWT_SECRET=your-jwt-secret
# Deploy
git push heroku main
# View logs
heroku logs --tail# SSH into droplet
ssh root@your-server-ip
# Install Node.js
curl -sL https://deb.nodesource.com/setup_16.x | bash -
apt-get install -y nodejs
# Install PM2
npm install -g pm2
# Clone repository
git clone your-repo-url
cd luxestay/backend
# Install dependencies
npm install --production
# Start with PM2
pm2 start server.js --name luxestay-api
pm2 startup
pm2 save
# Configure Nginx
nano /etc/nginx/sites-available/luxestayNginx Configuration:
server {
listen 80;
server_name api.yourdomain.com;
location / {
proxy_pass http://localhost:5000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}# Install Netlify CLI
npm install -g netlify-cli
# Deploy
cd frontend
netlify deploy --prod# Install Vercel CLI
npm install -g vercel
# Deploy
cd frontend
vercel --prod# Update API URL in JavaScript files
# Push to GitHub
git add .
git commit -m "Deploy to GitHub Pages"
git push origin main
# Enable GitHub Pages in repository settings-
AWS RDS
- Create MySQL instance
- Configure security groups
- Enable automated backups
- Set retention period
-
Google Cloud SQL
- Create MySQL instance
- Configure authorized networks
- Enable automatic backups
- Set maintenance window
-
DigitalOcean Managed Database
- Create database cluster
- Configure firewall rules
- Enable automatic backups
- Monitor performance
# Install Certbot
apt-get install certbot python3-certbot-nginx
# Obtain certificate
certbot --nginx -d yourdomain.com -d www.yourdomain.com
# Auto-renewal
certbot renew --dry-runError:
Error: connect ECONNREFUSED 127.0.0.1:3306
Solutions:
- Check if MySQL is running:
sudo service mysql status - Verify credentials in
.envfile - Ensure database exists:
SHOW DATABASES; - Check MySQL port:
SHOW VARIABLES LIKE 'port';
Error:
Error: listen EADDRINUSE: address already in use :::5000
Solutions:
macOS/Linux:
# Find process using port
lsof -i :5000
# Kill process
kill -9 <PID>Windows:
# Find process
netstat -ano | findstr :5000
# Kill process
taskkill /PID <PID> /FError:
{"success":false,"error":"Invalid token"}
Solutions:
- Check JWT_SECRET in
.env - Verify token format:
Bearer <token> - Check token expiration
- Clear browser cookies
Error:
Access to fetch at 'http://localhost:5000' blocked by CORS policy
Solutions:
- Verify FRONTEND_URL in
.env - Check CORS configuration in
server.js - Ensure credentials: true is set
- Clear browser cache
Error:
Error: Cannot find module 'express'
Solutions:
# Reinstall dependencies
rm -rf node_modules package-lock.json
npm install
# Or install specific package
npm install expressError:
ER_ACCESS_DENIED_ERROR: Access denied for user 'root'@'localhost'
Solutions:
-- Reset MySQL password
ALTER USER 'root'@'localhost' IDENTIFIED BY 'newpassword';
FLUSH PRIVILEGES;Checklist:
- Backend server is running
- API_URL is correct in JavaScript files
- Network tab shows request
- Check browser console for errors
- Verify authentication token
Solutions:
- Check image paths are correct
- Verify images exist in
/imagesfolder - Check file permissions
- Inspect browser Network tab
Enable detailed logging:
// In server.js
if (process.env.NODE_ENV === 'development') {
app.use((req, res, next) => {
console.log(`${req.method} ${req.path}`);
console.log('Headers:', req.headers);
console.log('Body:', req.body);
next();
});
}We welcome contributions to LuxeStay! Here's how you can help:
-
Fork the Repository
# Click "Fork" on GitHub -
Clone Your Fork
git clone https://github.com/your-username/luxestay.git cd luxestay -
Create Feature Branch
git checkout -b feature/amazing-feature
-
Make Changes
- Write clean, documented code
- Follow existing code style
- Add tests if applicable
-
Commit Changes
git add . git commit -m "Add amazing feature"
-
Push to Branch
git push origin feature/amazing-feature
-
Open Pull Request
- Go to GitHub
- Click "New Pull Request"
- Describe your changes
- Follow code style guide
- Write meaningful commit messages
- Update documentation
- Test your changes
- Be respectful and constructive
- Additional payment gateway integrations
- Email notification templates
- Mobile app (React Native)
- Advanced analytics dashboard
- Multi-language support
- Accessibility improvements
MIT License
Copyright (c) 2024 LuxeStay
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- Bootstrap - Responsive framework
- Font Awesome - Icon library
- Unsplash - Stock images
- Google Fonts - Typography
- Chart.js - Data visualization
- Node.js Community - Backend ecosystem
- MySQL Community - Database support
- Documentation: Read the full docs
- Issues: Report bugs
- Discussions: Community forum
- Email: support@luxestay.com (example)
- GitHub: Star the repository
- Twitter: @luxestay
- Blog: Read our blog
- Complete all dashboard pages
- Add room availability calendar
- Implement email notifications
- Add PDF report generation
- Mobile responsive improvements
- Multi-property support
- Advanced reporting with charts
- SMS integration
- Stripe payment integration
- Housekeeping module
- React Native mobile app
- Restaurant/POS integration
- Staff scheduling module
- Inventory management
- Customer loyalty program
- Total Files: 50+
- Lines of Code: 10,000+
- Languages: JavaScript, HTML, CSS, SQL
- Dependencies: 15+ npm packages
- Database Tables: 12
- API Endpoints: 40+
- Real-time notifications
- Advanced analytics
- Mobile app
- Multi-language support
- Dark mode
- API documentation (Swagger)
- Docker containerization
- Automated testing
Built with β€οΈ for modern hospitality management
Version 1.0.0 | Released January 2024
Β© 2024 LuxeStay. All rights reserved.