# AutoSales Hub - Setup and Deployment Guide

## 1. System Requirements
- PHP 8.3 or PHP 8.4 with SQLite, OpenSSL, and cURL extensions enabled
- Composer 2.x
- Node.js 18+ and npm
- Web server or built-in PHP development server

---

## 2. Quick Start Steps

### Step 1: Clone and Configure Environment
Copy the example environment file and generate the application key:
```bash
cp .env.example .env
php artisan key:generate
```

Ensure the database connection in `.env` is set to SQLite:
```env
DB_CONNECTION=sqlite
```

### Step 2: Install PHP & Node Dependencies
```bash
composer install
npm install
npm run build
```

### Step 3: Link Storage
```bash
php artisan storage:link
```

### Step 4: Run Migrations and Seeders
This seeds worldwide showrooms (21 locations, 17 countries), departments, admin users, seller contacts, and bilingual advertising descriptions:
```bash
php artisan migrate:fresh --seed
```

### Step 5: Start the Local Development Server
```bash
php artisan serve --host=127.0.0.1 --port=8000
```
Open your browser at `http://127.0.0.1:8000`.

---

## 3. Seeded Accounts & Credentials

| Role | Email | Password | Access Level |
|---|---|---|---|
| Administrator | `admin@dealership.com` | `password` | Full Admin & Post Moderation |
| Administrator | `admin@admin.com` | `password` | Filament Admin Panel (`/admin`) |
| Sales Agent | `pending@dealership.com` | `password` | Standard Agent Portal |

---

## 4. Key Application Features

### A. Structured Table Layout with Text Area Line
- Vehicle listings feature prominent `<thead>` headers.
- Attributes (VIN, engine, powertrain, mileage, price) are displayed in clean text fields.
- A dedicated secondary table row provides a multiline `<textarea readonly>` displaying vehicle advertising copy.

### B. International Fleet Partitioned by Country & Model
- 21 worldwide showrooms across 17 countries.
- 59 vehicle advertisements across 55 unique car models.
- Interactive tab view switchers allow viewing the Complete Fleet Table, Individual Country Tables, or Individual Model Tables.

### C. Arabic & English Bilingual Dropdown Guidance
- Guided dropdown cards with CSS styling and descriptive text hints (`tx`).
- Dual-language toggle (English / العربية / Both).

### D. Seller Contact ("Name and Phone ONLY")
- Clicking the `📞 Seller` button opens a focused modal.
- Strictly displays the seller's full name and direct telephone number with a one-click `tel:` call button.
- Excludes email addresses, street addresses, and contact forms for direct communication.

### E. Prohibited Words Filter & Post Moderation
- `WordFilterService` intercepts prohibited scam and offensive words in both English and Arabic.
- User-submitted vehicle advertisements are flagged as `pending` and remain hidden from public search until accepted by an administrator at `/approvals` or via the Filament Admin Panel (`/admin/cars`).

---

## 5. Verification and Automated Testing
Execute the complete test suite:
```bash
php artisan test
```
All 22 feature tests validate search filters, dealership workflows, word filtering, admin approvals, and seller contact privacy.
