What is JS Mini Hotel?
JS Mini Hotel is a complete hotel management system built in vanilla JavaScript. It provides a robust API for handling all aspects of hotel operations, from room availability searches to guest check-in/check-out, billing, and comprehensive reporting. Whether you’re building a hotel booking platform, property management system, or learning about real-world JavaScript applications, JS Mini Hotel offers a production-ready foundation with clean, maintainable code.Quick Navigation
Quickstart
Get up and running with JS Mini Hotel in minutes
API Reference
Explore all available functions and methods
Core Concepts
Understand the data structures and architecture
Guides
See practical examples and use cases
Core Features
Room Availability Search
Room Availability Search
Search for available rooms by date range and room type. The system automatically checks for conflicts with existing reservations and returns only truly available rooms.
Reservation Management
Reservation Management
Create, modify, and cancel reservations with built-in validation. Supports guest data management, date validation, and automatic pricing calculations.
Check-in/Check-out Operations
Check-in/Check-out Operations
Streamlined check-in and check-out processes with status tracking, room availability updates, and automatic invoice generation.
Billing & Extras
Billing & Extras
Add extra services (breakfast, parking, late check-out) to reservations with automatic price recalculation. Generate detailed invoices with itemized breakdowns.
Reporting & Analytics
Reporting & Analytics
Generate occupancy reports for any date, revenue reports for date ranges, and guest history tracking for customer relationship management.
Cancellation Policy
Cancellation Policy
Flexible cancellation system with automatic penalty calculation based on cancellation timing:
- More than 7 days before check-in: No charge
- 3-7 days before: 50% of total
- Less than 3 days: 100% of total
Key Capabilities
Data Validation
Email, phone, DNI regex validation
Auto Calculations
Nights, prices, and penalties
Date Handling
Temporal API for date operations
State Management
Active reservations + history tracking
Guest Tracking
Complete guest history by email
Occupancy Analytics
Real-time and historical reports
Installation
JS Mini Hotel is a vanilla JavaScript library with no external dependencies (except for development utilities).
Option 1: Clone the Repository
Option 2: Copy the Source Files
Copy the following files from thesource directory into your project:
Option 3: Module Import
Since this is a modern ES6+ project using module syntax, you can import it directly:Room Types & Pricing
The system supports three room types with standard pricing:| Room Type | Price per Night | Typical Features |
|---|---|---|
| Single | €50 | WiFi, TV |
| Double | €80 | WiFi, TV, Minibar |
| Suite | €150 | WiFi, TV, Minibar, Jacuzzi |
Available Extras
Enhance reservations with additional services:- Breakfast: €10/day
- Parking: €15/day
- Late Check-out: €30 (one-time charge)
- Early Check-in: €20 (one-time charge)
Next Steps
Complete the Quickstart
Follow the Quickstart Guide to create your first hotel and reservation
Explore the API
Review the API Reference to understand all available functions