# DryClean360 PHP — Setup & Module Checklist

**Location:** `D:\e data\Cursor\Dryclean360aiphp`  
**URL:** http://127.0.0.1:8003 (same port as Django)  
**Database:** MySQL `dryclean360_db` (shared with Django — same data)

---

## Step 1 — Install PHP (required once)

PHP is **not installed** on this PC yet. Choose one option:

### Option A — XAMPP (easiest for Windows)
1. Download https://www.apachefriends.org/
2. Install XAMPP
3. PHP will be at `C:\xampp\php\php.exe`
4. `run.bat` finds it automatically

### Option B — PHP standalone
1. Download PHP 8.3 ZIP from https://windows.php.net/download/
2. Extract to `C:\php`
3. Add `C:\php` to Windows PATH

### Option C — Laragon
1. Download https://laragon.org/
2. PHP included automatically

---

## Step 2 — Configure `.env`

Already set:
- `DB_NAME=dryclean360_db`
- `DB_USER=root`
- `DB_PASSWORD=` (your MySQL password)
- `DEV_SERVER_PORT=8003`
- `MEDIA_PATH=../Dryclean360ai/media` (existing photos & invoices)

---

## Step 3 — Start the app

```bat
cd "D:\e data\Cursor\Dryclean360aiphp"
run.bat
```

**Stop Django first** if it is running on port 8003.

Open: **http://127.0.0.1:8003/accounts/login**

### Login (same as Django — shared database)
| Username | Password |
|----------|----------|
| admin | Admin@123 |
| counter1 | Counter@123 |
| delivery1 | Delivery@123 |

---

## Modules implemented

| Module | URL | Status |
|--------|-----|--------|
| Login / Logout | `/accounts/login` | Ready |
| Dashboard | `/` | Ready |
| Staff | `/accounts/staff` | Ready |
| Activity Logs | `/accounts/activity-logs` | Ready |
| Customers | `/customers/` | Ready |
| Categories | `/categories/` | Ready |
| Items | `/items/` | Ready |
| Orders | `/orders/` | Ready |
| Payments | `/payments/` | Ready |
| Invoices | `/billing/invoices/` | Ready |
| AI Damage Detection | `/damage/reports/` | Ready |
| Reports | `/reports/` | Ready |
| Shop Settings | `/settings/shop/` | Ready |

---

## Shared hosting deployment

1. Upload entire `Dryclean360aiphp` folder to server
2. Point domain document root to `public/` folder
3. Import `mysql_backup_dryclean360_db_03072026.sql` on server MySQL
4. Edit `.env` with production DB credentials
5. Set folder permissions: `storage/` writable

No VPS or Gunicorn needed — works on cheap PHP hosting.

---

## Django vs PHP

| | Django (`Dryclean360ai`) | PHP (`Dryclean360aiphp`) |
|---|--------------------------|---------------------------|
| Run locally | `python manage.py runserver 127.0.0.1:8003` | `run.bat` |
| Hosting | VPS required | Shared PHP hosting |
| Database | Same MySQL | Same MySQL |
| UI | Tailwind + sidebar | Same CSS/JS copied |

---

## Files created (95+ files)

- `app/Controllers/` — 12 controllers
- `app/Services/` — Order, Payment, Invoice, Damage, Report, Shop, ActivityLog
- `app/Core/` — Router, Auth, Database, View
- `resources/views/` — All module templates
- `public/assets/` — CSS, JS from Django
- `routes/web.php` — All routes

---

## Troubleshooting

| Issue | Fix |
|-------|-----|
| PHP not found | Install XAMPP or PHP, then run `run.bat` |
| Port in use | Stop Django: Ctrl+C in terminal running runserver |
| DB connection error | Check MySQL running, `.env` password |
| Blank page | Enable `APP_DEBUG=true` in `.env` |
| Photos not showing | Check `MEDIA_PATH` points to Django `media/` folder |
