# HIGHRA CRM — Single Tenant V1

## 1. Requirements

- PHP 8.2+
- Composer 2+
- MySQL 8+
- Node.js 20+ and npm
- A web server or Laravel's local server

## 2. Database

Create a database named `highra_crm`, then update `.env`.

## 3. Install

Run:

```bash
composer install
php artisan key:generate
php artisan migrate --seed
php artisan storage:link
npm install
npm run build
```

For local development:

```bash
php artisan serve
```

## 4. First URLs

- Dashboard: `/dashboard`
- Leads: `/leads`
- Meta Integration: `/meta`
- Meta webhook: `/api/webhooks/meta`

## 5. Meta setup

Set these values in `.env`:

```env
META_APP_ID=
META_APP_SECRET=
META_ACCESS_TOKEN=
META_VERIFY_TOKEN=
META_API_VERSION=v23.0
```

The webhook verification endpoint is ready. The next production integration step is OAuth/business asset discovery and lead-form subscription.

## 6. Storage

The Laravel storage directories are included. Run:

```bash
php artisan storage:link
```

to expose public storage.

## 7. Vendor

`vendor/` is intentionally not bundled. It is generated from `composer.lock` / `composer.json` with:

```bash
composer install
```

This avoids shipping a platform-specific and unnecessarily large dependency tree.

## 8. Production checklist

Before production:
- set `APP_ENV=production`
- set `APP_DEBUG=false`
- use a strong database password
- use HTTPS
- generate a strong Meta verify token
- configure queue worker
- configure scheduler
- configure backups
- configure log rotation
- complete Meta OAuth and webhook subscription
- enable authentication and role/permission enforcement
