# Freight TMS Technical Documentation

## Stack
- Laravel 12
- PHP 8.2+
- MySQL / MariaDB
- Blade + Tailwind/Breeze foundation
- XAMPP local development
- cPanel or VPS production deployment

## Route Structure
The system uses multiple route files to reduce conflict risk:
- routes/web.php for core app.
- routes/admin_*.php for module route packs.
- routes/api_*.php for API integration packs.

Every installed step normally asks you to add one require line to web.php or api.php.

## Database Strategy
The system was built step-by-step using safe SQL patches. Tables are repair-friendly and most SQL patches can be rerun because they use IF NOT EXISTS, INFORMATION_SCHEMA checks, and INSERT IGNORE where possible.

## Important Commands
`php artisan optimize:clear`
`php artisan route:clear`
`php artisan config:clear`
`php artisan view:clear`
`php artisan cache:clear`
`php artisan storage:link`

## Queue and Cron
For production, configure Laravel scheduler:
`* * * * * cd /path/to/project && php artisan schedule:run >> /dev/null 2>&1`

For queues, use Supervisor on VPS or cPanel cron fallback.

## File Storage
Use public disk and run `php artisan storage:link`. Uploaded files are usually stored under storage/app/public and served through public/storage.

## API Foundation
API endpoints exist for tracking, customer portal, driver, carrier integration, compliance, AI automation, and real integrations. For live usage, configure provider credentials and endpoint mappings.
