From fda161ee096fd82c499e2c28f162143196c479db Mon Sep 17 00:00:00 2001 From: "bert.hausmans" Date: Tue, 7 Apr 2026 10:45:34 +0200 Subject: [PATCH] chore: align migrations, docs, and frontends with crewli.app setup - Replace dated migrations with ordered 2026_04_07_* chain; fold users update into base migration - Update OrganisationScope, AppServiceProvider, seeders, api routes, and .env.example - Refresh Cursor rules, CLAUDE.md, Makefile, README, and docs (API, SCHEMA, SETUP) - Adjust admin/app/portal HTML, packages, api-client, events types, and theme config - Update docker-compose and VS Code settings; remove stray Office lock files from resources Made-with: Cursor --- .cursor/ARCHITECTURE.md | 8 +- .cursor/instructions.md | 14 +- .cursor/rules/001_workspace.mdc | 19 +- .cursor/rules/100_laravel.mdc | 2 +- .cursor/rules/101_vue.mdc | 4 +- .cursor/rules/102_multi_tenancy.mdc | 8 +- .cursor/rules/103_database.mdc | 2 +- .cursor/rules/200_testing.mdc | 2 +- .cursorrules | 32 +-- .vscode/settings.json | 4 +- CLAUDE.md | 171 +++++++-------- Makefile | 6 +- README.md | 23 ++- api/.env.example | 23 ++- api/app/Models/Scopes/OrganisationScope.php | 6 + api/app/Providers/AppServiceProvider.php | 8 +- api/config/app.php | 2 +- .../0001_01_01_000000_create_users_table.php | 13 +- ...20000_update_users_table_for_eventcrew.php | 46 ----- ...0_create_personal_access_tokens_table.php} | 0 ...04_07_110000_create_permission_tables.php} | 2 + ...4_07_120000_create_activity_log_table.php} | 2 + ..._07_200000_create_organisations_table.php} | 0 ...210000_create_organisation_user_table.php} | 0 ...2026_04_07_220000_create_events_table.php} | 0 ..._230000_create_user_invitations_table.php} | 0 ..._240000_create_event_user_roles_table.php} | 0 api/database/seeders/DatabaseSeeder.php | 2 +- api/routes/api.php | 2 +- apps/admin/README.md | 6 +- apps/admin/index.html | 2 +- apps/admin/package.json | 2 +- apps/admin/src/lib/api-client.ts | 2 +- apps/admin/src/pages/events/[id]/edit.vue | 4 +- apps/admin/src/pages/events/create.vue | 4 +- apps/admin/src/types/events.ts | 8 +- apps/app/README.md | 31 +-- apps/app/index.html | 2 +- apps/app/package.json | 2 +- apps/app/src/lib/api-client.ts | 21 +- apps/app/src/types/events.ts | 6 +- apps/app/themeConfig.ts | 2 +- apps/portal/README.md | 31 +-- apps/portal/index.html | 2 +- apps/portal/package.json | 2 +- apps/portal/themeConfig.ts | 2 +- docker-compose.yml | 6 +- docs/API.md | 68 +++--- docs/SCHEMA.md | 2 +- docs/SETUP.md | 195 +++++++----------- resources/~$entCrew_Design_Document_v1.3.docx | Bin 162 -> 0 bytes resources/~$entCrew_Dev_Guide_v1.0.docx | Bin 162 -> 0 bytes resources/~$entCrew_Start_Guide_v1.0.docx | Bin 162 -> 0 bytes 53 files changed, 355 insertions(+), 446 deletions(-) delete mode 100644 api/database/migrations/2026_03_28_020000_update_users_table_for_eventcrew.php rename api/database/migrations/{2025_12_29_001636_create_personal_access_tokens_table.php => 2026_04_07_100000_create_personal_access_tokens_table.php} (100%) rename api/database/migrations/{2026_03_28_010508_create_permission_tables.php => 2026_04_07_110000_create_permission_tables.php} (99%) rename api/database/migrations/{2026_03_28_010508_create_activity_log_table.php => 2026_04_07_120000_create_activity_log_table.php} (96%) rename api/database/migrations/{2026_03_28_020001_create_organisations_table.php => 2026_04_07_200000_create_organisations_table.php} (100%) rename api/database/migrations/{2026_03_28_020002_create_organisation_user_table.php => 2026_04_07_210000_create_organisation_user_table.php} (100%) rename api/database/migrations/{2026_03_28_020003_create_events_table.php => 2026_04_07_220000_create_events_table.php} (100%) rename api/database/migrations/{2026_03_28_020004_create_user_invitations_table.php => 2026_04_07_230000_create_user_invitations_table.php} (100%) rename api/database/migrations/{2026_03_28_020005_create_event_user_roles_table.php => 2026_04_07_240000_create_event_user_roles_table.php} (100%) delete mode 100644 resources/~$entCrew_Design_Document_v1.3.docx delete mode 100644 resources/~$entCrew_Dev_Guide_v1.0.docx delete mode 100644 resources/~$entCrew_Start_Guide_v1.0.docx diff --git a/.cursor/ARCHITECTURE.md b/.cursor/ARCHITECTURE.md index 3def2bb..d4f5472 100644 --- a/.cursor/ARCHITECTURE.md +++ b/.cursor/ARCHITECTURE.md @@ -1,7 +1,7 @@ -# EventCrew - Architecture +# Crewli - Architecture > Multi-tenant SaaS platform for event- and festival management. -> Source of truth: `/resources/design/EventCrew_Design_Document_v1.3.docx` +> Source of truth: `/resources/design/Crewli_Design_Document_v1.3.docx` ## System Overview @@ -432,6 +432,8 @@ Three frontend origins in `config/cors.php` (via env): | App | `http://localhost:5174` | `FRONTEND_APP_URL` | | Portal | `http://localhost:5175` | `FRONTEND_PORTAL_URL` | +Production (registered domain **crewli.app**): API `https://api.crewli.app` (`APP_URL`); SPAs `https://admin.crewli.app`, `https://app.crewli.app`, `https://portal.crewli.app` via the same env keys. Frontends use `VITE_API_URL=https://api.crewli.app/api/v1`. `SANCTUM_STATEFUL_DOMAINS` = comma-separated SPA hostnames only (e.g. `admin.crewli.app,app.crewli.app,portal.crewli.app`). **`crewli.nl`** is reserved for a future marketing site only — not used for this application stack. + --- ## Real-time Events (WebSocket) @@ -446,4 +448,4 @@ Via Laravel Echo + Pusher/Soketi: --- -*Source: EventCrew Design Document v1.3, March 2026* +*Source: Crewli Design Document v1.3, March 2026* diff --git a/.cursor/instructions.md b/.cursor/instructions.md index bb24a67..e9f039d 100644 --- a/.cursor/instructions.md +++ b/.cursor/instructions.md @@ -1,19 +1,19 @@ -# EventCrew - Cursor AI Instructions +# Crewli - Cursor AI Instructions > Multi-tenant SaaS platform for event- and festival management. -> Design Document: `/resources/design/EventCrew_Design_Document_v1.3.docx` -> Dev Guide: `/resources/design/EventCrew_Dev_Guide_v1.0.docx` -> Start Guide: `/resources/design/EventCrew_Start_Guide_v1.0.docx` +> Design Document: `/resources/design/Crewli_Design_Document_v1.3.docx` +> Dev Guide: `/resources/design/Crewli_Dev_Guide_v1.0.docx` +> Start Guide: `/resources/design/Crewli_Start_Guide_v1.0.docx` ## Project Overview -**Name**: EventCrew +**Name**: Crewli **Type**: Multi-tenant SaaS platform (API-first architecture) **Status**: Development ### Description -EventCrew is a multi-tenant SaaS platform for professional event and festival management. It supports the full operational cycle: artist booking and advancing, staff planning and volunteer management, accreditation, briefings, and real-time show-day operations (Mission Control). Built for a professional volunteer organisation, with SaaS expansion potential. +Crewli is a multi-tenant SaaS platform for professional event and festival management. It supports the full operational cycle: artist booking and advancing, staff planning and volunteer management, accreditation, briefings, and real-time show-day operations (Mission Control). Built for a professional volunteer organisation, with SaaS expansion potential. ## Quick Reference @@ -130,7 +130,7 @@ Build auth flow in apps/app/: 1. stores/useAuthStore.ts - token storage, isAuthenticated, me() loading 2. pages/login.vue - use Vuexy login layout 3. Router guard - redirect to login if not authenticated -4. Replace Vuexy demo navigation with EventCrew structure +4. Replace Vuexy demo navigation with Crewli structure 5. CASL permissions: connect to Spatie roles from auth/me response ``` diff --git a/.cursor/rules/001_workspace.mdc b/.cursor/rules/001_workspace.mdc index 688cb4e..dedacb9 100644 --- a/.cursor/rules/001_workspace.mdc +++ b/.cursor/rules/001_workspace.mdc @@ -1,12 +1,12 @@ --- -description: Core workspace rules for EventCrew multi-tenant SaaS platform +description: Core workspace rules for Crewli multi-tenant SaaS platform globs: ["**/*"] alwaysApply: true --- # Workspace Rules -You are an expert full-stack developer working on EventCrew, a multi-tenant SaaS platform for event and festival management. The backend is a Laravel 12 REST API (JSON only, no Blade), and three Vue 3 SPA frontends communicate via CORS + Sanctum tokens. +You are an expert full-stack developer working on Crewli, a multi-tenant SaaS platform for event and festival management. The backend is a Laravel 12 REST API (JSON only, no Blade), and three Vue 3 SPA frontends communicate via CORS + Sanctum tokens. ## Tech Stack @@ -36,7 +36,7 @@ You are an expert full-stack developer working on EventCrew, a multi-tenant SaaS ## Project Structure ``` -event-crew/ +crewli/ ├── api/ # Laravel 12 REST API (JSON only) │ ├── app/ │ │ ├── Http/ @@ -130,8 +130,19 @@ event-crew/ | Redis | `localhost:6379` | - | | Mailpit | `http://localhost:8025` | - | +### Production URLs (crewli.app) + +**Note:** `crewli.app` = this SaaS product. `crewli.nl` is for a future public marketing site only — never use `.nl` for API, SPAs, or app-originated mail in this project. + +| Service | URL | Env variable | +|---------|-----|--------------| +| API | `https://api.crewli.app` | `APP_URL` | +| Admin SPA | `https://admin.crewli.app` | `FRONTEND_ADMIN_URL` | +| Organizer SPA | `https://app.crewli.app` | `FRONTEND_APP_URL` | +| Portal SPA | `https://portal.crewli.app` | `FRONTEND_PORTAL_URL` | + ### CORS -Three frontend origins configured in `config/cors.php` via env variables. Each Vite dev server gets its own port for CORS isolation. +Three frontend origins configured in `config/cors.php` via env variables. Each Vite dev server gets its own port for CORS isolation. In production, set the same env vars to the `https://…` origins above (see `api/.env.example`). ## Git Conventions diff --git a/.cursor/rules/100_laravel.mdc b/.cursor/rules/100_laravel.mdc index 406cfde..a86dbcd 100644 --- a/.cursor/rules/100_laravel.mdc +++ b/.cursor/rules/100_laravel.mdc @@ -1,5 +1,5 @@ --- -description: Laravel API development guidelines for EventCrew multi-tenant platform +description: Laravel API development guidelines for Crewli multi-tenant platform globs: ["api/**/*.php"] alwaysApply: true --- diff --git a/.cursor/rules/101_vue.mdc b/.cursor/rules/101_vue.mdc index 2ec4bfe..8327393 100644 --- a/.cursor/rules/101_vue.mdc +++ b/.cursor/rules/101_vue.mdc @@ -1,5 +1,5 @@ --- -description: Vue 3, TypeScript, and Vuexy patterns for EventCrew platform +description: Vue 3, TypeScript, and Vuexy patterns for Crewli platform globs: ["apps/**/*.{vue,ts,tsx}"] alwaysApply: true --- @@ -23,7 +23,7 @@ alwaysApply: true - Minimal modifications needed ### `apps/app/` (Organizer - Main App) -- Sidebar nav customized for EventCrew structure +- Sidebar nav customized for Crewli structure - Remove Vuexy demo/customizer components - Full Vuetify component usage - 90% of development work happens here diff --git a/.cursor/rules/102_multi_tenancy.mdc b/.cursor/rules/102_multi_tenancy.mdc index 2cc4f49..15bee8e 100644 --- a/.cursor/rules/102_multi_tenancy.mdc +++ b/.cursor/rules/102_multi_tenancy.mdc @@ -1,5 +1,5 @@ --- -description: Multi-tenancy and portal architecture rules for EventCrew +description: Multi-tenancy and portal architecture rules for Crewli globs: ["api/**/*.php", "apps/portal/**/*.{vue,ts}"] alwaysApply: true --- @@ -101,7 +101,7 @@ Route::middleware(['auth:sanctum', 'event.role:event_manager'])->group(...); ### Token-Based Authentication Flow ``` -1. Artist/supplier receives email with link: https://portal.eventcrew.app/advance?token=01HQ3K... +1. Artist/supplier receives email with link: https://portal.crewli.app/advance?token=01HQ3K... 2. Portal detects token in URL query parameter 3. POST /api/v1/portal/token-auth { token: '01HQ3K...' } 4. Backend validates token against artists.portal_token or production_requests.token @@ -111,7 +111,7 @@ Route::middleware(['auth:sanctum', 'event.role:event_manager'])->group(...); ### Login-Based Authentication Flow ``` -1. Volunteer navigates to https://portal.eventcrew.app/login +1. Volunteer navigates to https://portal.crewli.app/login 2. Enters email + password 3. POST /api/v1/auth/login (same endpoint as apps/app/) 4. Returns user + organisations + event roles @@ -196,6 +196,8 @@ class PortalTokenMiddleware 'supports_credentials' => true, ``` +Production example (subdomains on **crewli.app**): `FRONTEND_ADMIN_URL=https://admin.crewli.app`, `FRONTEND_APP_URL=https://app.crewli.app`, `FRONTEND_PORTAL_URL=https://portal.crewli.app`, and `SANCTUM_STATEFUL_DOMAINS=admin.crewli.app,app.crewli.app,portal.crewli.app`. + ## Shift Claiming & Approval Flow ### Three Assignment Strategies per Shift diff --git a/.cursor/rules/103_database.mdc b/.cursor/rules/103_database.mdc index b98fc65..754e43d 100644 --- a/.cursor/rules/103_database.mdc +++ b/.cursor/rules/103_database.mdc @@ -1,5 +1,5 @@ --- -description: Database schema conventions, ULID primary keys, JSON column rules, soft delete strategy, and index requirements for EventCrew +description: Database schema conventions, ULID primary keys, JSON column rules, soft delete strategy, and index requirements for Crewli globs: ["api/database/**/*.php", "api/app/Models/**/*.php"] alwaysApply: true --- diff --git a/.cursor/rules/200_testing.mdc b/.cursor/rules/200_testing.mdc index 14cad25..292d185 100644 --- a/.cursor/rules/200_testing.mdc +++ b/.cursor/rules/200_testing.mdc @@ -1,5 +1,5 @@ --- -description: Testing standards for EventCrew multi-tenant platform +description: Testing standards for Crewli multi-tenant platform globs: ["**/tests/**", "**/*.test.ts", "**/*.test.tsx", "**/*.spec.ts", "**/*.spec.tsx", "**/Test.php"] alwaysApply: true --- diff --git a/.cursorrules b/.cursorrules index 49121b6..9940783 100644 --- a/.cursorrules +++ b/.cursorrules @@ -1,21 +1,21 @@ -# EventCrew Cursor Rules - +# Crewli Cursor Rules + ## Stack PHP 8.2 + Laravel 12 | TypeScript + Vue 3 + Vuexy/Vuetify | Pinia + TanStack Query - + ## Laravel -- Resource Controllers, Form Requests, API Resources — altijd -- HasUlids op business modellen, HasFactory, SoftDeletes waar gedocumenteerd -- Global Scope OrganisationScope op event-gerelateerde modellen -- Policies voor autorisatie, nooit inline role checks - +- Resource controllers, form requests, API resources — always +- `HasUlids` on business models, `HasFactory`, `SoftDeletes` where documented +- Global scope `OrganisationScope` on event-related models +- Policies for authorization — never inline role checks + ## Vue 3 --