# BrandsTrack cPanel Installation

## Requirements
Use PHP 8.3+ for this package, MySQL/MariaDB, Composer, SSL, cron and required PHP extensions.

## 1. Create Laravel project
Because this ZIP is application source, create a fresh Laravel 13 project in cPanel Terminal:
composer create-project laravel/laravel:^13.0 brandstrack

Then copy this package's app/, routes/, config/, resources/, database/ and composer.json into the Laravel project. Run composer install.

## 2. Database
Create a MySQL database/user in cPanel. Copy .env.example to .env and set DB_* values.
Run:
php artisan key:generate
php artisan migrate

## 3. Web root
Set the domain/subdomain document root to:
~/brandstrack/public
Laravel's public directory must be the web root so application files and .env are not exposed.

## 4. Storage/cache
php artisan storage:link
php artisan optimize

## 5. Queue
php artisan queue:table
php artisan migrate
Cron every minute:
* * * * * cd /home/CPANELUSER/brandstrack && php artisan queue:work --stop-when-empty --tries=3 >> /dev/null 2>&1

## 6. Scheduler
* * * * * cd /home/CPANELUSER/brandstrack && php artisan schedule:run >> /dev/null 2>&1

## 7. AI
Set OPENAI_API_KEY and OPENAI_MODEL in .env. Never place the key in frontend JavaScript.

## 8. Payments
Configure Stripe, PayPal, Paystack, Flutterwave and bank-transfer variables. Configure each provider's HTTPS webhook endpoint and verify provider signatures before changing invoice/subscription state.

## 9. Data connectors
Configure only APIs/data sources you are licensed/authorized to use. Store evidence URL, source name, retrieval time and content snapshot.

## 10. Production
APP_ENV=production
APP_DEBUG=false
Use HTTPS, backups, least-privilege DB credentials, rate limits and regular dependency updates.

## 11. Troubleshooting
500: check storage/logs/laravel.log.
DB errors: verify cPanel DB credentials.
404: verify domain document root is /public.
Queue not processing: verify cron path and PHP CLI binary.
