# Zabibu Residence — Deployment Checklist

## Server Requirements
- PHP 8.1+ with extensions: `pdo_mysql`, `mbstring`, `openssl`, `fileinfo`, `mod_rewrite`
- MySQL 8+ / MariaDB 10.6+
- Apache with `mod_rewrite` enabled

---

## 1. Upload Files
Upload everything **except**:
- `.env` (create fresh on server)
- `public/uploads/` (or copy if migrating)
- `vendor/` if using Composer (run `composer install --no-dev` on server)

---

## 2. Set Document Root
Point your domain's **Document Root** to the `public/` folder.

If your host doesn't allow changing document root, use the root `.htaccess`
which redirects traffic to `public/` automatically.

---

## 3. Create `.env` on Server
Copy `.env.example` to `.env` and fill in:

```
APP_ENV=production
APP_DEBUG=false
APP_URL=https://yourdomain.com

DB_HOST=localhost
DB_NAME=your_db_name
DB_USER=your_db_user
DB_PASS=your_db_password

MAIL_HOST=smtp.yourmailhost.com
MAIL_PORT=587
MAIL_USERNAME=noreply@yourdomain.com
MAIL_PASSWORD=your_mail_password
```

---

## 4. Create & Import Database
```sql
CREATE DATABASE zabibu_residence CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
```
Then import: `database/zabibu_residence.sql`

---

## 5. File Permissions
```bash
chmod -R 755 public/
chmod -R 775 public/uploads/
chmod -R 775 public/assets/images/site/
chmod -R 775 storage/
chmod 600 .env
```

---

## 6. Enable HTTPS
In `public/.htaccess`, uncomment:
```apache
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
```
Also uncomment HSTS header:
```apache
Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
```

---

## 7. Test Checklist
- [ ] Home page loads
- [ ] Admin login works (`/admin`)
- [ ] File uploads work (property photos, avatars)
- [ ] Email test passes (Admin → Settings → Email tab)
- [ ] HTTPS redirect works
- [ ] `/login` shows no debug errors
- [ ] `.env` is NOT accessible via browser (should return 403)
- [ ] `APP_DEBUG=false` in `.env`

---

## Default Super Admin Credentials
Change these immediately after first login:
- **Email:** admin@zabiburesidence.co.tz
- **Password:** *(set during installation)*
