# Primon Digital Hotel Platform — Installation Guide
## Location: Naalya, Kampala, Uganda • Contact: 0782195634

The **Primon Digital Hotel Platform** supports both a guided web browser-based installer (`/install`) and standard command-line (CLI) provisioning.

---

## 1. Web-Based Guided Installer (`/install`)

The platform comes equipped with a 5-step installer wizard:

1. **Step 1 — Environment & Server Requirements:**
   - Evaluates PHP version (>= 8.2 required, 8.4 recommended).
   - Verifies mandatory PHP extensions: `pdo`, `pdo_mysql`, `openssl`, `mbstring`, `curl`, `json`, `fileinfo`.
   - Checks writable directory permissions for `storage/` and `bootstrap/cache/`.

2. **Step 2 — Database Engine & Credentials:**
   - Supports **SQLite** (instant development) and **MySQL / MariaDB** (cPanel / production).
   - Includes real-time **Test MySQL Connection** button to validate DB Host, Port, Database Name, Username, and Password before running migrations.

3. **Step 3 — Hotel Identity & Payment Gateway:**
   - Hotel Name: `Primon Hotel`
   - Location: `Naalya, Kampala, Uganda`
   - Phone: `0782195634`
   - Email: `reservations@primonhotel.com`
   - Optional: Pesapal 3.0 API Consumer Key & Secret.

4. **Step 4 — Super Administrator Master Account:**
   - Full Name, Master Email (`admin@primonhotel.com`), Phone (`0782195634`), and Secure Password.
   - Automatically provisions the `super_admin` role with full privileges across PMS, CRM, and Front Desk modules.

5. **Step 5 — Migration, Seeding & Lock:**
   - Executes database schema migrations and seeds default room types, rates, packages, and services.
   - Places `storage/installed.lock` to permanently secure the installer against unauthorized re-runs.

---

## 2. Command-Line (CLI) / SSH Installation

```bash
# 1. Clone or extract project files
git clone https://github.com/primonhotel/platform.git .

# 2. Install production dependencies
composer install --no-dev --optimize-autoloader
npm install && npm run build

# 3. Environment setup
cp .env.example .env
php artisan key:generate --force

# 4. Configure database in .env (MySQL or SQLite)
# DB_CONNECTION=mysql
# DB_HOST=127.0.0.1
# DB_PORT=3306
# DB_DATABASE=your_database_name
# DB_USERNAME=your_username
# DB_PASSWORD=your_password

# 5. Run migrations and seeders
php artisan migrate --force --seed
php artisan storage:link

# 6. Lock the installer
touch storage/installed.lock

# 7. Optimize caches for production speed
php artisan config:cache
php artisan route:cache
php artisan view:cache
```

For complete cPanel hosting instructions, refer to [`docs/CPANEL_DEPLOYMENT.md`](CPANEL_DEPLOYMENT.md).
