# Advanced WABA Panel — Installation Guide

## 3 Ways to Install

---

### Option 1: Web Installer (Recommended for Shared Hosting)

**Time: 2 minutes | No SSH required**

1. Upload all files to your hosting (via cPanel File Manager or FTP)
2. Create a MySQL database in cPanel → MySQL Databases
3. Open `https://yourdomain.com/installer/` in browser
4. Follow the 5-step wizard:
   - ✅ Server requirements auto-check
   - ✅ Database connection test
   - ✅ Admin account creation
   - ✅ Business settings
   - ✅ Auto-install (tables + config + license)
5. Done! Login to your dashboard

**After installation:** Delete the `public/installer/` folder for security.

---

### Option 2: CLI Installer (For VPS / SSH Access)

**Time: 30 seconds**

```bash
# Interactive mode
bash install.sh

# Or one-liner with all params
bash install.sh \
  --domain panel.yourdomain.com \
  --db-name mydb \
  --db-user myuser \
  --db-pass mypass \
  --admin-email admin@yourdomain.com \
  --admin-pass YourPassword123
```

**After installation:** Delete `install.sh` and `public/installer/` for security.

---

### Option 3: Docker (For VPS with Docker)

**Time: 1 minute**

```bash
# Start all services (app + MySQL + Redis)
docker-compose up -d

# Wait 30 seconds for MySQL to initialize, then visit:
# http://your-server-ip:8080/installer/

# Follow the web wizard (DB credentials are pre-filled in docker-compose.yml)
```

**Default Docker credentials:**
- DB Host: `db`
- DB Name: `waba_panel`
- DB User: `waba_user`
- DB Pass: `waba_secret_2024`

---

## Server Requirements

| Requirement | Minimum |
|-------------|---------|
| PHP | 8.2+ |
| MySQL | 5.7+ / MariaDB 10.3+ |
| Extensions | PDO_MySQL, Mbstring, OpenSSL, cURL, JSON, Tokenizer, XML, Ctype, BCMath, GD, FileInfo |
| Disk Space | 500 MB |
| RAM | 512 MB |

---

## Post-Installation

1. **Configure WhatsApp Business API** — Go to Admin → WhatsApp Setup
2. **Set up email** — Admin → Settings → Email (SMTP details)
3. **Add your logo** — Admin → Settings → General
4. **Create subscription plans** — Admin → Subscription Plans
5. **Delete installer** — Remove `public/installer/` folder

---

## Troubleshooting

| Issue | Solution |
|-------|----------|
| 500 Error after install | Run `chmod -R 775 storage bootstrap/cache` |
| Database connection failed | Check DB credentials in `.env` file |
| Blank page | Set `APP_DEBUG=true` in `.env` temporarily |
| Permission denied | Run `chown -R www-data:www-data .` (Linux) |
| Installer not loading | Check if PHP 8.2+ is active for your domain |

---

## Support

For installation support, contact us on WhatsApp or email.
