# WEBX Travel

Multi-tenant SaaS for travel agencies — a **modular monolith** with one central
catalog database and **one independent database per tenant**. Amaka Tours is the
first tenant, never a special case in code.

- **Backend:** Laravel 12 · PHP 8.2+ (built/tested on 8.3, runs on 8.4)
- **Frontend:** Vue 3 + TypeScript + Vite + Tailwind CSS
- **API:** `/api/v1` with Laravel Sanctum
- **DB:** MySQL 8 / MariaDB (SQLite for dev & tests)

## Documentation

- [Architecture overview](docs/architecture/overview.md)
- [Multi-tenancy design](docs/architecture/multi-tenancy.md)
- [Configuration, brands & permissions (Phase 02)](docs/architecture/configuration.md)
- [CRM: customers, passengers & documents (Phase 03)](docs/architecture/crm.md)
- [Commercial file, bookings & payments (Phase 04)](docs/architecture/sales.md)
- [Tours & inventory (Phase 05)](docs/architecture/tours.md)
- [Lodging & rooming (Phase 06)](docs/architecture/lodging.md)
- [Design system](docs/design/design-system.md)
- [Decision log](docs/architecture/decisions.md)
- [Local development](docs/installation/local-development.md)
- [Deploy to cPanel shared hosting](docs/installation/shared-hosting-cpanel.md)

## Quick start (local)

```bash
composer install
cp .env.example .env && php artisan key:generate
php -r "file_exists('database/central.sqlite') || touch('database/central.sqlite');"
php artisan core:migrate --force
php artisan tenant:provision "Amaka Tours" --domain=amaka.webxtravel.test --driver=sqlite --force
npm install && npm run build
php artisan serve
```

## Quality gates

```bash
php artisan test        # tenant isolation, security, migration separation
npm run type-check      # vue-tsc
npm run build           # Vite production build
```

## Key commands

| Command | Purpose |
|---|---|
| `php artisan core:migrate` | Run central (platform) migrations |
| `php artisan tenant:migrate {uuid\|--all}` | Run tenant migrations |
| `php artisan tenant:provision "Name" --domain=host` | Create + migrate a tenant |
| `php artisan tenants:list` | List tenants (read-only) |
| `php artisan tenant:seed-baseline {uuid}` | Seed permissions/roles/currencies/brand |
| `php artisan tenant:create-admin {uuid} {email}` | Create a tenant administrator |

## License

Proprietary — © WEBX Travel.
