# cPanel Deployment Guide — AARJAY GDP Portal MVC

## 1. Upload

Upload the contents of `mvc/` into the target document root, for example:

- `public_html/`
- or a subdomain folder such as `gdp.yourdomain.com/`

The following should be directly inside the web root:

- `index.php`
- `.htaccess`
- `install.php`
- `install.sql`
- `app/`
- `assets/`
- `uploads/`

Do not upload the outer `AARJAY_GDP_Portal/` folder as an extra nested level unless your domain points to that folder.

## 2. PHP requirements

Enable/check:

- PHP 8.0+
- `pdo_mysql`
- `mbstring`
- `json`
- `session`
- Apache `mod_rewrite`
- Optional: `ZipArchive` for accountant ZIP export

## 3. Database

Create a MySQL database and user in cPanel.

Then either:

1. Visit `/install.php` and use the installer, or
2. Import `install.sql` through phpMyAdmin and edit `app/config.php`.

## 4. First login

Seed account:

- Email: `admin@pharma.com`
- Password: `Admin@1234`

Change this password immediately.

## 5. Post-install hardening

After successful installation:

- Confirm `install.lock` exists, or remove/rename `install.php`.
- Remove `install.sql` from production if not needed.
- Confirm `.htaccess` blocks direct access to `app/`, `logs/`, `.sql`, `.md`, `.log` files.
- Confirm upload folders are writable by PHP only where required.
- Set correct production `app.url` in config/installer.

## 6. Staging verification

Before production, run:

```bash
find app -name '*.php' -print0 | xargs -0 -n1 php -l
mysql -u USER -p DATABASE < install.sql
BASE_URL=https://staging.example.com ./scripts/regression_smoke_test.sh
```

Also visit `/system-health` as admin.
