# 🏨 HOTEL MANAGEMENT SYSTEM
## Laravel 12 + TailwindCSS + AlpineJS
### Modern Professional Dashboard Architecture

---

## 🎯 PROJECT OVERVIEW

Bangun sistem manajemen perhotelan profesional berbasis web menggunakan:

- **Laravel 12**
- **TailwindCSS**
- **AlpineJS**
- **MySQL**
- **RESTful architecture**
- **Role Based Access Control (RBAC)**
- **Clean Code + Service Layer Pattern**
- **Responsive modern dashboard UI**
- **Folder image langsung di `public/img`** (tanpa storage link)

Sistem harus **scalable**, **clean**, dan **siap production**.

---

## 🏗️ SYSTEM ARCHITECTURE

### Backend
- Laravel 12
- Repository / Service Pattern
- Form Request Validation
- Policy & Gate Authorization
- Eloquent Relationships
- API-ready structure

### Frontend
- TailwindCSS (modern professional look)
- AlpineJS (interactive components)
- Responsive dashboard layout
- Dark mode ready
- Reusable components

---

## 👥 USER ROLES

1. **Super Admin**
2. **Admin Hotel**
3. **Receptionist**
4. **Housekeeping**
5. **Finance**
6. **Guest** (optional customer portal)

> Gunakan `spatie/laravel-permission` untuk role & permission.

---

## 🧩 CORE MODULES

### 1️⃣ Dashboard

**Fitur:**
- Statistik kamar tersedia
- Statistik kamar terisi
- Occupancy rate
- Check-in hari ini
- Check-out hari ini
- Revenue hari ini
- Grafik pendapatan (monthly)
- Grafik okupansi

---

### 2️⃣ Room Management

**Fitur:**
- CRUD Tipe Kamar
- CRUD Kamar
- Status kamar:
  - Available
  - Occupied
  - Reserved
  - Cleaning
  - Maintenance

**Field Tipe Kamar:**
| Field | Type |
|-------|------|
| name | string |
| description | text |
| price_per_night | decimal |
| capacity | integer |
| bed_type | string |
| size | string |
| facilities | json |
| photo | `public/img/room-types` |

**Field Kamar:**
| Field | Type |
|-------|------|
| room_number | string |
| room_type_id | foreign key |
| floor | integer |
| status | enum |

---

### 3️⃣ Guest Management

**Field:**
| Field | Type |
|-------|------|
| full_name | string |
| email | string |
| phone | string |
| identity_type | string |
| identity_number | string |
| address | text |
| photo_id | `public/img/guests` |

**Fitur:**
- CRUD
- Riwayat booking
- Total spending

---

### 4️⃣ Reservation Management

**Status:**
- Pending
- Confirmed
- Checked-in
- Checked-out
- Cancelled
- No-show

**Field:**
| Field | Type |
|-------|------|
| reservation_code | auto generate |
| guest_id | foreign key |
| room_id | foreign key |
| check_in_date | date |
| check_out_date | date |
| number_of_guests | integer |
| total_price | decimal |
| payment_status | enum |
| source | walk-in, website, OTA |

**Fitur:**
- Cek ketersediaan kamar otomatis
- Auto calculate total price
- Early check-in fee
- Late check-out fee
- Cancellation rule
- Overlapping booking prevention

---

### 5️⃣ Check-In / Check-Out System

**Check-In:**
- Assign room
- Capture payment
- Upload ID
- Generate invoice

**Check-Out:**
- Hitung total akhir
- Tambahan minibar
- Tambahan laundry
- Generate invoice PDF

---

### 6️⃣ Billing & Payment

**Metode:**
- Cash
- Transfer
- QRIS
- Credit Card

**Field:**
| Field | Type |
|-------|------|
| invoice_number | string |
| reservation_id | foreign key |
| subtotal | decimal |
| tax | decimal |
| service_charge | decimal |
| discount | decimal |
| grand_total | decimal |
| payment_method | enum |
| payment_status | enum |

**Fitur:**
- Generate PDF Invoice
- Email Invoice
- Refund system
- Partial payment support

---

### 7️⃣ Housekeeping Module

**Fitur:**
- Room cleaning schedule
- Assign staff
- Update room status
- Cleaning checklist
- Maintenance report

---

### 8️⃣ Financial Reports

**Laporan:**
- Revenue harian
- Revenue bulanan
- Occupancy rate
- Room performance
- Most booked room type
- Guest spending report

**Export:**
- PDF
- Excel

---

### 9️⃣ Staff Management

**Field:**
| Field | Type |
|-------|------|
| name | string |
| role | string |
| phone | string |
| email | string |
| salary | decimal |
| join_date | date |

**Fitur:**
- Attendance
- Performance notes

---

## 🔐 SECURITY

- Laravel CSRF
- Form Request validation
- Policy authorization
- Password hashing
- Activity log
- Audit trail
- Login rate limit

---

## 🎨 UI DESIGN SPECIFICATION

### Layout
- Sidebar fixed modern
- Top navbar
- Card based dashboard
- Rounded-2xl components
- Soft shadow
- Clean spacing
- Neutral professional color palette
- **Primary color:** Indigo / Slate theme
- Dark mode support

### Components (Reusable)
- Card
- Button
- Badge
- Modal
- Dropdown
- Alert
- Table with pagination
- Confirmation modal
- Datepicker (AlpineJS)

---

## 📊 DATABASE DESIGN (Core Tables)

- `users`
- `roles`
- `permissions`
- `room_types`
- `rooms`
- `guests`
- `reservations`
- `payments`
- `invoices`
- `housekeeping_tasks`
- `reports`

> Gunakan foreign key dan indexing yang benar.

---

## ⚙️ ADVANCED FEATURES

- Multi hotel support (optional SaaS ready)
- API endpoint for mobile app
- Notification system
- WhatsApp reminder (optional)
- Email automation
- Revenue forecasting
- Room availability calendar view
- Drag & drop booking calendar

---

## 📂 FOLDER STRUCTURE RULE

**Image upload:**
```
public/img/room-types
public/img/rooms
public/img/guests
public/img/invoices
```

> ⚠️ Jangan gunakan `storage:link`.

---

## 🧠 CODING STANDARD

- Clean architecture
- Service layer
- Repository layer
- Form Request validation
- Resource controller
- Proper naming convention
- SOLID principle
- Comment important logic only
- Use DTO if needed

---

## 🚀 FINAL GOAL

Bangun sistem hotel profesional modern setara:

- OYO internal dashboard
- Traveloka property system
- Hotel PMS enterprise level

**Harus:**
- ✅ Clean UI
- ✅ Enterprise ready
- ✅ Secure
- ✅ Scalable
- ✅ Production ready

---
