# DEPLOY-ME — Ammarah Clinic live karo (clinic.munshiji.pk)

Files upload hone ke baad **har naya click / is file ka order** follow karo.

## Step 1 — Files upload
1. cPanel → **File Manager** → `clinic.munshiji.pk` ka docroot folder (jaise `public_html/clinic`)
2. **Upload** `clinic_app_deploy.zip` wahan
3. Zip select kar ke **Extract** (tariko "Extract to", no subfolder chahiye — seedha docroot me files)

Verify: `https://clinic.munshiji.pk/` par agar `index.php`, `application/`, `system/` dikhe to files sahi hain.

## Step 2 — Database
1. cPanel → **MySQL® Databases** → naya DB banao (e.g. `mun_siteDB`), uska naam yaad rakho
2. Yahan DB ke saath ek **user** banao + **Add User to Database → ALL privileges**
3. cPanel → **phpMyAdmin** → apna naya DB → **Import** → local se export ki `clinic_ammarah.sql` (001/002 applied wali) import karo

## Step 3 — Config badlo (File Manager → Edit)

**a) `application/config/database.php`** (upar wale 3 fields):
```php
'hostname' => 'localhost',
'username' => 'cpanel_loginhai_dbuser',   // aapka cPanel username wala
'password' => 'wapas_dbpassword',
'database' => 'munshi_DBnaam',           // cPanel wala exact
```
Aur neeche tenant-default bhi wahi DB naam karo:
```php
$_tenant_id = 'munshi_DBnaam';
```

**b) `application/config/tenant.php`** (pehle letter hai):
```php
'ammarah' => 'munshi_DBnaam',   // live DB ka naam
```

**c) `application/config/config.php`** base_url:
```php
$config['base_url'] = 'http://clinic.munshiji.pk/';
```
(SSL hai to `https://`)

## Step 4 — PHP / permissions
- cPanel → MultiPHP → **PHP 8.1 ya 8.2** select (clinic hi domain)
- Extensions check: `pdo`, `pdo_mysql`, `mysqli`, `gd`, `mbstring`
- `application/logs`, `application/cache`, `uploads`, `uploads/settings` → writable (File Manager → Permissions → 755/775)

## Step 5 — Test
1. `http://clinic.munshiji.pk/admin` → login page
2. Login (apna username hmshahid... + password) — iska bcrypt hash live waste
3. Token add → QR/slip

> Iterable main multi-tenant: `in phase 2/3`. Abhi single-clinic root par chalta hai.