# Lakhsman Wellness cPanel Go-Live Guide

## 1) Environment
- Set `.env` values:
  - `APP_ENV=production`
  - `APP_DEBUG=false`
  - `QUEUE_CONNECTION=database`
  - `CACHE_STORE=file` (or database if configured)
  - `SESSION_DRIVER=file` (or database)

## 2) One-time Commands
- Run once after upload/deploy:
```bash
php artisan key:generate
php artisan migrate --force
php artisan storage:link
php artisan optimize
```
- Frontend asset requirement:
  - Run `npm run build` before go-live (or in CI pipeline).
  - Ensure `public/hot` does not exist on production (that file forces dev-server assets and breaks UI when Vite server is not running).

## 3) Cron Jobs (cPanel)
- Scheduler every minute:
```cron
* * * * * /usr/local/bin/php /home/USERNAME/public_html/artisan schedule:run >> /home/USERNAME/cron-schedule.log 2>&1
```
- Optional queue worker cron:
```cron
* * * * * /usr/local/bin/php /home/USERNAME/public_html/artisan queue:work --queue=default --tries=3 --timeout=120 --stop-when-empty >> /home/USERNAME/cron-queue.log 2>&1
```

## 4) Security and Access
- Keep installer locked after setup.
- Confirm admin URL is changed from default if required.
- Enforce HTTPS and secure cookies.
- Verify `APP_KEY` is set and not rotated without planning.

## 5) Final Validation
- Check Admin > Performance for recent cron logs.
- Confirm no failed jobs backlog.
- Verify wallet ledger reconciliation.
- Validate webhook signature checks and duplicate protection.
- Confirm legal pages are published in Admin CMS.
