# Property Management System (PMS)

A premium, modern, and robust Property Management System built with Laravel, Livewire, and Tailwind CSS.

## Features

- **Multi-Property Management**: Manage multiple properties, each with their own units, rate plans, and dynamic seasonal pricing.
- **Unified Booking Engine**: A seamless interface to create, manage, and modify reservations.
- **Point of Sale (POS)**: A clean, tablet-optimized interface to quickly book rooms and checkout guests.
- **Housekeeping & Maintenance**: Kanban boards and tracking for cleaning schedules, statuses, and property repairs.
- **Finance & Accounting**: Full UK VAT-compliant invoicing engine, expense tracking, and P&L (Profit & Loss) reports.
- **Data Exporting Hub**: Download reports in Excel and PDF formats for bookings, expenses, housekeeping, arrears, and maintenance.
- **Admin Tools**:
  - **GDPR Compliance**: Easily execute "Right to be Forgotten" (data anonymization) and Data Portability requests.
  - **Night Audit**: Automate daily revenue recognition and No-Show / Overstay detection.
  - **Activity Logs**: Track all system modifications per-user with full transparency.
- **Progressive Web App (PWA)**: Installable on Mobile, Tablet, and Desktop with offline caching for key assets and a responsive layout.

## Tech Stack

- **Backend**: Laravel 11, PHP 8.2+
- **Frontend**: Livewire 3, Alpine.js, Tailwind CSS
- **Database**: MySQL / MariaDB
- **Reporting**: Laravel Excel, DomPDF, Chart.js

## Requirements

- PHP >= 8.2
- Composer
- Node.js & NPM
- MySQL / MariaDB

## Installation

1. **Clone the repository:**
   ```bash
   git clone <repository_url>
   cd rms
   ```

2. **Install PHP Dependencies:**
   ```bash
   composer install
   ```

3. **Install NPM Dependencies:**
   ```bash
   npm install
   npm run build
   ```

4. **Environment Configuration:**
   Copy the `.env.example` file to `.env` and configure your database and SMTP credentials.
   ```bash
   cp .env.example .env
   php artisan key:generate
   ```

5. **Run Migrations & Seeders:**
   ```bash
   php artisan migrate --seed
   ```

6. **Storage Link:**
   ```bash
   php artisan storage:link
   ```

7. **Start the Development Server:**
   ```bash
   php artisan serve
   ```

## Configuration

You can manage system configurations (Currency, VAT rate, SMTP) directly from the application's Admin Dashboard under **Settings**.

## Architecture & Workflows

### Billing & Invoices
Invoices are automatically generated upon check-out or can be generated manually. The system distinguishes between:
- **Advance Payments**
- **Security Deposits** (held and later refunded or captured)
- **Balance Payments**

### Housekeeping
Upon a guest checking out, the system automatically dispatches an `App\Events\GuestCheckedOut` event, which automatically generates a Cleaning Task for that specific unit, ensuring rooms are prepped for the next arrival.

## Security
- User passwords use Bcrypt hashing.
- Role-based Access Control (RBAC) ensures Staff cannot access Admin Settings, Financial Reports, or GDPR modules.
- Form inputs are validated using Laravel Form Requests.

## License
Proprietary / Closed Source. All rights reserved.
