# Deploying on cPanel shared hosting

## 1. Directory layout

Only `public_html` is web-facing. Everything else sits above it.

```
/home/USER/
├── app/            # application code
├── bin/            # cron runner
├── database/       # schema and seeder
├── docs/
├── storage/        # documents, keys, logs — never web-reachable
├── tests/
├── config.php      # written by the installer
└── public_html/    # document root
```

If your host forces the document root to be `~/public_html`, this layout already
matches. If it is set to something else, point the domain at the `public_html`
directory in this bundle.

## 2. Upload

Upload the archive via File Manager and extract in `/home/USER/`. Do not extract
into `public_html` — that would expose the application source.

## 3. PHP version

MultiPHP Manager → select **PHP 8.1 or newer** for the domain.
MultiPHP INI Editor → enable `pdo_mysql`, `openssl`, `mbstring`, `curl`,
`fileinfo`. Set `upload_max_filesize` and `post_max_size` to at least `8M`.

## 4. Database

MySQL Databases → create a database and a user, then add the user to the
database with **All Privileges**. Note the full prefixed names
(`cpaneluser_dbname`, `cpaneluser_dbuser`).

## 5. Install

Visit `https://yourdomain.com/install/` and work through the three steps. The
installer checks requirements, creates the tables, generates the encryption key,
writes `config.php`, seeds reference data and creates your admin account.

## 6. Immediately afterwards

- Delete `public_html/install/`.
- Download a copy of `config.php` and store it offline.
- `chmod 640 config.php`, `chmod 750 storage` and its subdirectories.
- Confirm `https://yourdomain.com/storage/` returns 403 and
  `https://yourdomain.com/config.php` does not render.

## 7. SSL

cPanel → SSL/TLS Status → run AutoSSL. The application forces HTTPS once
`app.force_https` is true, which the installer sets by default.

## 8. Cron

See `docs/CRON.md`.

## 9. Go-live checks

- `/robots.txt` and `/sitemap.xml` both respond.
- Admin sign-in works and Providers shows every driver as `mock`.
- A test search returns the mock challans and the eligibility split renders.
