# CLAUDE.md - EZSCALE Site ## Project EZSCALE Site — Laravel 12 application replacing WHMCS for VPS/Dedicated Server hosting management (billing, subscriptions, provisioning, customer management, SSO). ## Phase Tracking (MANDATORY) All work MUST be tracked against GitHub issues and `TASKS.md`: 1. **Before starting any phase work:** Check the relevant GitHub issue (see `gh issue list`) and `TASKS.md` for current status. 2. **While working:** Update the GitHub issue with progress comments as significant milestones are completed (e.g., `gh issue comment --body "Completed X"`). 3. **After completing work:** Update `TASKS.md` to check off completed items and close/update the corresponding GitHub issue. 4. **New tasks discovered during work:** Create sub-issues or add items to `TASKS.md` immediately. 5. **Commit messages:** Reference the GitHub issue number (e.g., `Fix checkout validation (#3)`). GitHub issues: https://github.com/EZSCALE/accounting/issues ## Laravel App Location The Laravel application is in **`website/`**. All artisan, composer, and npm commands run from there. ``` website/ ├── app/ │ ├── Models/ # 14 Eloquent models │ ├── Http/Controllers/ # Account/ and Admin/ controllers │ ├── Services/Billing/ # BillingServiceInterface, Stripe, PayPal, Dunning │ ├── Events/ # PaymentSucceeded/Failed, SubscriptionCreated/Cancelled │ ├── Listeners/ # HandlePaymentSucceeded/Failed │ └── Providers/ # AppServiceProvider, FortifyServiceProvider ├── bootstrap/app.php # Middleware, exceptions, routing (Laravel 12 style) ├── config/ # App, auth, fortify, passport, cashier, paypal, permission ├── database/ │ ├── migrations/ # 30 migrations (15 custom + defaults + packages) │ ├── factories/ # 7 factories │ └── seeders/ # Roles, plans, admin user ├── resources/ │ ├── js/ # Vue 3 + Inertia pages (TO BE MIGRATED TO TypeScript) │ │ ├── Layouts/ # AppLayout, AuthLayout, AdminLayout │ │ ├── Pages/ # Auth/, Billing/, Plans/, Subscriptions/, Admin/ │ │ └── Components/ # Card, Button, NavLink, FlashMessages │ ├── css/app.css # Tailwind CSS 4 │ └── views/app.blade.php # Inertia root template ├── routes/ # web.php, account.php, admin.php, marketing.php, webhooks.php, api.php ├── tests/ # 53 Pest tests (Phase 1 + Phase 2) ├── composer.json ├── package.json └── vite.config.js ``` ## Tech Stack - **Framework:** Laravel 12 (PHP 8.3), Laravel 12 slim structure (no Kernel files) - **Frontend:** Vue 3 + Inertia.js v2 + TypeScript (REQUIRED) + Tailwind CSS 4 + Vite 7 - **UI Theme:** Vuexy Vue + Laravel Admin Dashboard (reference at `../vuexy-theme-vue-laravel-full-example-typescript/`) - **Testing:** Pest 4 + PHPUnit 12 - **Formatting:** Laravel Pint - **Payments:** Laravel Cashier (Stripe) + srmklive/paypal (PayPal) - **Database:** MySQL 8.x, Redis for cache/queue/sessions - **Auth:** Laravel Fortify (login, register, 2FA, password reset, email verify) + Passport (OAuth2/SSO) - **Roles:** spatie/laravel-permission (admin, customer) ## Commands ```bash cd website composer run dev # Start all dev servers (artisan serve + queue + pail + vite) php artisan serve # Laravel dev server only php artisan test --compact # Run Pest tests php artisan migrate # Run migrations npm run dev # Vite dev server only npm run build # Production build vendor/bin/pint --dirty --format agent # Format changed files ``` ## TypeScript Requirement (MANDATORY) **All frontend code MUST use TypeScript.** This applies to all Vue components, composables, utilities, and type definitions. ### Rules - All `.vue` files must use ` ``` ### Migration Note Existing `.vue` files in `resources/js/` were written in plain JavaScript during Phase 1-2. They must be migrated to TypeScript as they are touched. When working on a page, convert it to TypeScript as part of the work. ## Vuexy Theme Reference The Vuexy theme is at `../vuexy-theme-vue-laravel-full-example-typescript/`. Use it as a **reference** for UI patterns, component design, and styling conventions. ### Key Vuexy Patterns to Follow - **Component structure:** `