# Website + CMS Installation Guide

## Prerequisites
- PHP 8.1+
- MySQL 8+
- Composer
- Node.js 18+

## 1) Install dependencies
```bash
composer install
npm install
```

## 2) Environment
- Copy `.env.example` to `.env`
- Configure DB credentials
- Set:
  - `QUEUE_CONNECTION=database`
  - `CACHE_DRIVER=file` (or redis if available)
  - `APP_URL` to your domain

## 3) Database and storage
```bash
php artisan key:generate
php artisan migrate
php artisan storage:link
```

## 4) Build frontend assets
```bash
npm run build
```

## 5) Queue and scheduler
- Run queue worker:
```bash
php artisan queue:work
```
- Add cron (every minute):
```bash
* * * * * php /path/to/artisan schedule:run >> /dev/null 2>&1
```

## 6) Admin login and CMS setup
- Login to admin panel: `/admin` (or configured `ADMIN_SLUG`)
- Configure:
  - CMS > Homepage Settings
  - CMS > Hero Slides
  - CMS > Blogs
  - CMS > Features/Testimonial/Gallery/Legal

## 7) Push notifications (optional)
- Add your VAPID public key to setting key `push_public_key`.
- Service worker is available at `/sw.js`.

## 8) MLM Compensation configuration
- Admin > Plans:
  - `matching_type`: `member` or `amount`
  - `pair_income`, `binary_percentage`
  - `daily_pair_limit`, `weekly_pair_limit`
  - `carry_forward_enabled`
- Admin > Ranks:
  - Configure `required_left_bv` and `required_right_bv`

## 9) Verify
```bash
php artisan route:list
php artisan test
```
