diff --git a/CLAUDE.md b/CLAUDE.md index 905f3b7f..06cdde68 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -24,12 +24,11 @@ Design document: `/dev-docs/design-document.md` - `composer rector` — Rector dry-run for modernisation suggestions. See `/dev-docs/RECTOR.md`. Apply only in scoped sprints, never automatically. -- ts-reset patches TypeScript's loosest default types in both SPAs. +- ts-reset patches TypeScript's loosest default types in the SPA. See `/dev-docs/FRONTEND-TOOLING.md`. New TypeScript code adheres to ts-reset's stricter types automatically. -- Vitest — `apps/portal` has 113+ tests; `apps/app` currently has - no Vitest setup (tracked as TECH-APP-VITEST, must close before - S3b lands). +- Vitest — `apps/app` has Vitest with 213 tests as of WS-3 PR-B2a. + Test count grows with each PR; check `pnpm test` for current value. ## Development tooling @@ -40,24 +39,23 @@ Design document: `/dev-docs/design-document.md` ## Repository layout - `api/` — Laravel backend -- `apps/app/` — Organizer SPA (main product app + Platform Admin for super admins) -- `apps/portal/` — External portal (volunteers, artists, suppliers, etc.) +- `apps/app/` — Single SPA covering organizers, volunteers, crew, super admins (context-routed in-app) plus the public form-fill / artist-advance flows -## Apps and portal architecture +## App architecture -- `apps/app/` — Organizer: event management per organisation. Includes **Platform Admin** section (`/platform/*`) for super_admin users (organisation management, user management, impersonation, activity log). -- `apps/portal/` — External users: one app, two access modes: - - Login-based (`auth:sanctum`): volunteers, crew — persons with `user_id` - - Token-based (`portal.token` middleware): artists, suppliers, press — persons without `user_id` +`apps/app/` — single workspace, two access modes: + +- Login-based (`auth:sanctum`): organizers, volunteers, crew, super_admin. Includes **Platform Admin** section (`/platform/*`) for super_admin users (organisation management, user management, impersonation, activity log). Context-aware routing inside the SPA distinguishes organizer vs. volunteer experience based on `useAuthStore.availableContexts` (see `dev-docs/AUTH_ARCHITECTURE.md`). +- Token-based (`portal.token` middleware): artists, suppliers, press — persons without `user_id`. Stateless per-request token via `Authorization: Bearer` header or `?token=` query parameter. ### CORS -Configure two frontend origins in both Laravel (`config/cors.php` via env) and the Vite dev server proxy: +Single frontend origin in both Laravel (`config/cors.php` via env) and the Vite dev server proxy: -- app: `localhost:5174` -- portal: `localhost:5175` +- dev: `localhost:5174` +- prod: `https://crewli.app` -**Production (`crewli.app`):** API `https://api.crewli.app`, SPAs `https://crewli.app`, `https://portal.crewli.app` — see `api/.env.example` for `FRONTEND_*` and `SANCTUM_STATEFUL_DOMAINS`. **`crewli.nl`** is only for a future marketing site; this application stack uses **`crewli.app`** (not `.nl` for API, SPAs, or transactional mail). +See `api/.env.example` for `FRONTEND_*` and `SANCTUM_STATEFUL_DOMAINS`. **`crewli.nl`** is only for a future marketing site; this application stack uses **`crewli.app`** (not `.nl` for API, SPA, or transactional mail). ## Backend rules (strict) diff --git a/Makefile b/Makefile index 587ae267..fffccbdb 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: help services services-stop api app portal docs migrate fresh db-shell test test-db-create schema-dump +.PHONY: help services services-stop api app docs migrate fresh db-shell test test-db-create schema-dump # Colors GREEN := \033[0;32m @@ -19,7 +19,6 @@ help: @echo " $(YELLOW)Development Servers:$(NC)" @echo " make api Laravel API → http://localhost:8000" @echo " make app Organizer SPA → http://localhost:5174" - @echo " make portal Portal SPA → http://localhost:5175" @echo " make docs VitePress docs → http://localhost:5176" @echo "" @echo " $(YELLOW)Database:$(NC)" @@ -58,10 +57,6 @@ app: @echo "$(GREEN)Starting Organizer SPA → http://localhost:5174$(NC)" @cd apps/app && pnpm dev -portal: - @echo "$(GREEN)Starting Portal SPA → http://localhost:5175$(NC)" - @cd apps/portal && pnpm dev - docs: @echo "$(GREEN)Starting VitePress docs → http://localhost:5176$(NC)" @cd docs && npm run docs:dev diff --git a/README.md b/README.md index 8d6c6d8b..3ffbdef6 100644 --- a/README.md +++ b/README.md @@ -21,10 +21,9 @@ Implementation is phased; the authoritative feature and schema list lives in the | App | Path | Port | Role | |-----|------|------|------| -| **Organizer** | `apps/app/` | 5174 | Main product for **org and event staff**: events, sections, shifts, people, artists, accreditation, briefings, reports. Includes **Platform Admin** section for super admins (`/platform/*`). | -| **Portal** | `apps/portal/` | 5175 | **External** users: stripped layout; login- or token-based access. | +| **SPA** | `apps/app/` | 5174 | Single-SPA product covering **organizers, volunteers, crew, super admins** (context-routed in-app), plus token-based access for artists, suppliers, press. Includes **Platform Admin** section for super admins (`/platform/*`). | -All apps talk to the API over **CORS** with **Laravel Sanctum** tokens. +The SPA talks to the API over **CORS** with **Laravel Sanctum** tokens. ---