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
This commit is contained in:
68
docs/API.md
68
docs/API.md
@@ -1,56 +1,56 @@
|
||||
# EventCrew API Contract
|
||||
# Crewli API Contract
|
||||
|
||||
# Base: /api/v1/
|
||||
Base path: `/api/v1/`
|
||||
|
||||
# Auth: Bearer token (Sanctum)
|
||||
Auth: Bearer token (Sanctum)
|
||||
|
||||
## Auth
|
||||
|
||||
POST /auth/login
|
||||
POST /auth/logout
|
||||
GET /auth/me
|
||||
- `POST /auth/login`
|
||||
- `POST /auth/logout`
|
||||
- `GET /auth/me`
|
||||
|
||||
## Organisations
|
||||
|
||||
GET /organisations -- lijst (super admin)
|
||||
POST /organisations -- aanmaken
|
||||
GET /organisations/{org} -- detail
|
||||
PUT /organisations/{org} -- bijwerken
|
||||
GET /organisations/{org}/members -- leden
|
||||
POST /organisations/{org}/invite -- uitnodigen
|
||||
- `GET /organisations` — list (super admin)
|
||||
- `POST /organisations` — create
|
||||
- `GET /organisations/{org}` — show
|
||||
- `PUT /organisations/{org}` — update
|
||||
- `GET /organisations/{org}/members` — members
|
||||
- `POST /organisations/{org}/invite` — invite user
|
||||
|
||||
## Events
|
||||
|
||||
GET /organisations/{org}/events
|
||||
POST /organisations/{org}/events
|
||||
GET /organisations/{org}/events/{event}
|
||||
PUT /organisations/{org}/events/{event}
|
||||
- `GET /organisations/{org}/events`
|
||||
- `POST /organisations/{org}/events`
|
||||
- `GET /organisations/{org}/events/{event}`
|
||||
- `PUT /organisations/{org}/events/{event}`
|
||||
|
||||
## Festival Sections
|
||||
## Festival sections
|
||||
|
||||
GET /events/{event}/sections
|
||||
POST /events/{event}/sections
|
||||
GET /events/{event}/sections/{section}
|
||||
- `GET /events/{event}/sections`
|
||||
- `POST /events/{event}/sections`
|
||||
- `GET /events/{event}/sections/{section}`
|
||||
|
||||
## Time Slots
|
||||
## Time slots
|
||||
|
||||
GET /events/{event}/time-slots
|
||||
POST /events/{event}/time-slots
|
||||
- `GET /events/{event}/time-slots`
|
||||
- `POST /events/{event}/time-slots`
|
||||
|
||||
## Shifts
|
||||
|
||||
GET /events/{event}/sections/{section}/shifts
|
||||
POST /events/{event}/sections/{section}/shifts
|
||||
PUT /events/{event}/sections/{section}/shifts/{shift}
|
||||
POST /events/{event}/sections/{section}/shifts/{shift}/assign
|
||||
POST /events/{event}/sections/{section}/shifts/{shift}/claim
|
||||
- `GET /events/{event}/sections/{section}/shifts`
|
||||
- `POST /events/{event}/sections/{section}/shifts`
|
||||
- `PUT /events/{event}/sections/{section}/shifts/{shift}`
|
||||
- `POST /events/{event}/sections/{section}/shifts/{shift}/assign`
|
||||
- `POST /events/{event}/sections/{section}/shifts/{shift}/claim`
|
||||
|
||||
## Persons
|
||||
|
||||
GET /events/{event}/persons
|
||||
POST /events/{event}/persons
|
||||
GET /events/{event}/persons/{person}
|
||||
PUT /events/{event}/persons/{person}
|
||||
POST /events/{event}/persons/{person}/approve
|
||||
- `GET /events/{event}/persons`
|
||||
- `POST /events/{event}/persons`
|
||||
- `GET /events/{event}/persons/{person}`
|
||||
- `PUT /events/{event}/persons/{person}`
|
||||
- `POST /events/{event}/persons/{person}/approve`
|
||||
|
||||
# ... (volledig API contract uitbreiden per module)
|
||||
_(Extend this contract per module as endpoints are implemented.)_
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# EventCrew — Core Database Schema
|
||||
# Crewli — Core Database Schema
|
||||
|
||||
> Source: Design Document v1.3 — Section 3.5
|
||||
> All 12 findings from the database review (v1.3) are incorporated.
|
||||
|
||||
195
docs/SETUP.md
195
docs/SETUP.md
@@ -1,6 +1,6 @@
|
||||
# Event Crew - Setup Guide
|
||||
# Crewli - Setup Guide
|
||||
|
||||
This guide walks you through setting up the Event Crew project from scratch.
|
||||
This guide walks you through setting up the Crewli project from scratch.
|
||||
|
||||
## Cursor AI Configuration
|
||||
|
||||
@@ -60,7 +60,7 @@ docker -v # Should show Docker version
|
||||
## Step 1: Start Docker Services
|
||||
|
||||
```bash
|
||||
cd event-crew
|
||||
cd crewli
|
||||
make services
|
||||
```
|
||||
|
||||
@@ -85,8 +85,8 @@ Requirements:
|
||||
- Set up CORS for localhost:5173, localhost:5174, localhost:5175
|
||||
- Use MySQL with these credentials:
|
||||
- Host: 127.0.0.1
|
||||
- Database: event_crew
|
||||
- Username: event_crew
|
||||
- Database: crewli
|
||||
- Username: crewli
|
||||
- Password: secret
|
||||
|
||||
Follow the conventions in .cursor/rules for code style.
|
||||
@@ -95,7 +95,7 @@ Follow the conventions in .cursor/rules for code style.
|
||||
### Manual Alternative
|
||||
|
||||
```bash
|
||||
cd event-crew
|
||||
cd crewli
|
||||
composer create-project laravel/laravel api
|
||||
cd api
|
||||
composer require laravel/sanctum
|
||||
@@ -107,46 +107,38 @@ Then configure `api/.env`:
|
||||
DB_CONNECTION=mysql
|
||||
DB_HOST=127.0.0.1
|
||||
DB_PORT=3306
|
||||
DB_DATABASE=event_crew
|
||||
DB_USERNAME=event_crew
|
||||
DB_DATABASE=crewli
|
||||
DB_USERNAME=crewli
|
||||
DB_PASSWORD=secret
|
||||
|
||||
FRONTEND_ADMIN_URL=http://localhost:5173
|
||||
FRONTEND_APP_URL=http://localhost:5174
|
||||
FRONTEND_PORTAL_URL=http://localhost:5175
|
||||
SANCTUM_STATEFUL_DOMAINS=localhost:5173,localhost:5174,localhost:5175
|
||||
SESSION_DOMAIN=localhost
|
||||
```
|
||||
|
||||
**Production (domain `crewli.app`):** set `APP_URL=https://api.crewli.app`, point `FRONTEND_ADMIN_URL` / `FRONTEND_APP_URL` / `FRONTEND_PORTAL_URL` to `https://admin.crewli.app`, `https://app.crewli.app`, and `https://portal.crewli.app`, and `SANCTUM_STATEFUL_DOMAINS=admin.crewli.app,app.crewli.app,portal.crewli.app` (hostnames only). Each SPA build should use `VITE_API_URL=https://api.crewli.app/api/v1`. Full template: `api/.env.example`. The product uses **`crewli.app`** only; **`crewli.nl`** is for a future public marketing site, not this API or SPAs.
|
||||
|
||||
---
|
||||
|
||||
## Step 3: Copy Vuexy Files
|
||||
## Step 3: Vuexy frontends (this repo)
|
||||
|
||||
### Admin SPA (Full Version)
|
||||
This monorepo already contains three SPAs under `apps/`:
|
||||
|
||||
1. Extract your Vuexy download
|
||||
2. Navigate to: `vuexy-vuejs-admin-template/typescript-version/full-version/`
|
||||
3. Copy ALL contents to: `apps/admin/`
|
||||
| Directory | Role | Typical Vuexy source |
|
||||
|-----------|------|----------------------|
|
||||
| `apps/admin/` | Super Admin | full-version (TypeScript) |
|
||||
| `apps/app/` | Organizer (main product) | full-version or customized starter |
|
||||
| `apps/portal/` | External portal (volunteers, token links) | stripped starter / custom layout |
|
||||
|
||||
If you ever need to re-copy from a Vuexy ZIP, use the paths above — not legacy `apps/band` or `apps/customers`.
|
||||
|
||||
```bash
|
||||
# Example (adjust path to your Vuexy download)
|
||||
# Example only — adjust to your Vuexy download path
|
||||
cp -r ~/Downloads/vuexy/typescript-version/full-version/* apps/admin/
|
||||
```
|
||||
|
||||
### Band Portal (Starter Kit)
|
||||
|
||||
1. Navigate to: `vuexy-vuejs-admin-template/typescript-version/starter-kit/`
|
||||
2. Copy ALL contents to: `apps/band/`
|
||||
|
||||
```bash
|
||||
cp -r ~/Downloads/vuexy/typescript-version/starter-kit/* apps/band/
|
||||
```
|
||||
|
||||
### Customer Portal (Starter Kit)
|
||||
|
||||
1. Copy starter-kit to: `apps/customers/`
|
||||
|
||||
```bash
|
||||
cp -r ~/Downloads/vuexy/typescript-version/starter-kit/* apps/customers/
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Step 4: Configure SPAs
|
||||
@@ -155,8 +147,8 @@ cp -r ~/Downloads/vuexy/typescript-version/starter-kit/* apps/customers/
|
||||
|
||||
```bash
|
||||
cd apps/admin && pnpm install
|
||||
cd ../band && pnpm install
|
||||
cd ../customers && pnpm install
|
||||
cd ../app && pnpm install
|
||||
cd ../portal && pnpm install
|
||||
```
|
||||
|
||||
### Create Environment Files
|
||||
@@ -164,139 +156,96 @@ cd ../customers && pnpm install
|
||||
**apps/admin/.env.local**
|
||||
```env
|
||||
VITE_API_URL=http://localhost:8000/api/v1
|
||||
VITE_APP_NAME="Event Crew Admin"
|
||||
VITE_APP_NAME="Crewli Admin"
|
||||
```
|
||||
|
||||
**apps/band/.env.local**
|
||||
**apps/app/.env.local**
|
||||
```env
|
||||
VITE_API_URL=http://localhost:8000/api/v1
|
||||
VITE_APP_NAME="Band Portal"
|
||||
VITE_APP_NAME="Crewli Organizer"
|
||||
```
|
||||
|
||||
**apps/customers/.env.local**
|
||||
**apps/portal/.env.local**
|
||||
```env
|
||||
VITE_API_URL=http://localhost:8000/api/v1
|
||||
VITE_APP_NAME="Customer Portal"
|
||||
VITE_APP_NAME="Crewli Portal"
|
||||
```
|
||||
|
||||
### Update Vite Ports
|
||||
### Dev server ports
|
||||
|
||||
**apps/band/vite.config.ts** - Add port 5174:
|
||||
```typescript
|
||||
export default defineConfig({
|
||||
// ... existing config
|
||||
server: {
|
||||
port: 5174,
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
**apps/customers/vite.config.ts** - Add port 5175:
|
||||
```typescript
|
||||
export default defineConfig({
|
||||
// ... existing config
|
||||
server: {
|
||||
port: 5175,
|
||||
},
|
||||
})
|
||||
```
|
||||
From the repo root, `make admin`, `make app`, and `make portal` start Vite on **5173**, **5174**, and **5175** respectively. If you run `pnpm dev` manually, configure the same ports in each app’s `vite.config.ts` under `server.port`.
|
||||
|
||||
---
|
||||
|
||||
## Step 5: Set Up API Client in SPAs
|
||||
## Step 5: API client in SPAs
|
||||
|
||||
Use Cursor to add the API client. Prompt:
|
||||
|
||||
```
|
||||
Add an API client to apps/admin/src/lib/api-client.ts that:
|
||||
1. Uses axios with base URL from VITE_API_URL
|
||||
2. Adds auth token from localStorage to requests
|
||||
3. Handles 401 responses by redirecting to /login
|
||||
4. Logs requests and responses in development
|
||||
|
||||
Follow the pattern in .cursor/rules
|
||||
```
|
||||
`apps/admin/src/lib/api-client.ts`, `apps/app/src/lib/api-client.ts`, and `apps/portal/src/lib/api-client.ts` share the same pattern: `VITE_API_URL` base, Bearer token from the `accessToken` cookie, 401 → clear cookies and redirect to `/login`. Build new composables on `apiClient`; keep Vuexy `useApi` for template demos only.
|
||||
|
||||
---
|
||||
|
||||
## Step 6: Create Database Schema
|
||||
## Step 6: Create database schema
|
||||
|
||||
Use Cursor to create migrations. Prompt:
|
||||
Implement migrations from the canonical schema, not a legacy intranet model:
|
||||
|
||||
```
|
||||
Create Laravel migrations for all tables defined in .cursor/rules:
|
||||
- users (with roles and types)
|
||||
- customers
|
||||
- locations
|
||||
- events
|
||||
- event_invitations
|
||||
- music_numbers
|
||||
- music_attachments
|
||||
- setlists
|
||||
- setlist_items
|
||||
- booking_requests
|
||||
- notifications
|
||||
- activity_logs
|
||||
- **`docs/SCHEMA.md`** — table list, columns, indexes
|
||||
- **`.cursor/ARCHITECTURE.md`** — overview and relationships
|
||||
- **`.cursor/rules/103_database.mdc`** — ULIDs, soft deletes, index rules
|
||||
|
||||
Use ULIDs for primary keys and follow Laravel conventions.
|
||||
```
|
||||
**Checked-in foundation (this repo):** Laravel defaults (`users`, `cache`, `jobs`) then `2026_04_07_*` migrations: Sanctum tokens → Spatie permission → activity log → `organisations` → `organisation_user` → `events` → `user_invitations` → `event_user_roles`. New modules should append migrations with a later timestamp in dependency order.
|
||||
|
||||
Typical next expansion order from `103_database.mdc`: festival sections, time slots, persons, shifts, …
|
||||
|
||||
Then run:
|
||||
|
||||
```bash
|
||||
cd api && php artisan migrate
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Step 7: Start Development
|
||||
## Step 7: Start development
|
||||
|
||||
Open 4 terminal tabs:
|
||||
Open separate terminals (or use the Makefile from the repo root):
|
||||
|
||||
```bash
|
||||
# Tab 1: Services (already running)
|
||||
# Tab 1: Services (Docker)
|
||||
make services
|
||||
|
||||
# Tab 2: Laravel API
|
||||
make api
|
||||
|
||||
# Tab 3: Admin SPA
|
||||
# Tab 3: Admin SPA (optional)
|
||||
make admin
|
||||
|
||||
# Tab 4: Band Portal (optional)
|
||||
make band
|
||||
# Tab 4: Organizer SPA (optional)
|
||||
make app
|
||||
|
||||
# Tab 5: Portal SPA (optional)
|
||||
make portal
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Building Features
|
||||
## Building features
|
||||
|
||||
Use these Cursor prompts to build features:
|
||||
Use Cursor with **`CLAUDE.md`** and **`.cursor/instructions.md`**. Example directions:
|
||||
|
||||
### Authentication
|
||||
|
||||
```
|
||||
Create the authentication system:
|
||||
1. AuthController with login, logout, register, user endpoints
|
||||
2. Form requests for validation
|
||||
3. API resources for user responses
|
||||
4. Update Vuexy's auth to use our API instead of fake backend
|
||||
Wire Sanctum API auth: login, logout, me; form requests; API resources; Vue apps use axios + token storage (see .cursor/rules).
|
||||
```
|
||||
|
||||
### Events Module
|
||||
### Events module (Crewli)
|
||||
|
||||
```
|
||||
Create the Events module:
|
||||
1. Event model with relationships (location, customer, setlist, invitations)
|
||||
2. EventController with CRUD + invite and RSVP endpoints
|
||||
3. Form requests and API resources
|
||||
4. Event policy for authorization
|
||||
Events nested under organisations: ULID PK, OrganisationScope, policies, EventResource, feature tests (200/401/403/422).
|
||||
```
|
||||
|
||||
### RSVP System
|
||||
### Portal token flow
|
||||
|
||||
```
|
||||
Create the RSVP system:
|
||||
1. EventInvitation model
|
||||
2. Endpoints for members to respond to invitations
|
||||
3. Admin view of all RSVPs per event
|
||||
4. Email notifications for new invitations
|
||||
Portal token middleware and routes for artist/supplier contexts; document links on https://portal.crewli.app/... (see .cursor/rules/102_multi_tenancy.mdc).
|
||||
```
|
||||
|
||||
---
|
||||
@@ -325,15 +274,13 @@ pnpm type-check
|
||||
|
||||
---
|
||||
|
||||
## Next Steps
|
||||
## Next steps
|
||||
|
||||
1. ✅ Services running
|
||||
2. ✅ Laravel API created
|
||||
3. ✅ Vuexy copied to SPAs
|
||||
4. ✅ Environment configured
|
||||
5. 🔲 Build authentication
|
||||
6. 🔲 Build events module
|
||||
7. 🔲 Build members module
|
||||
8. 🔲 Build music catalog
|
||||
9. 🔲 Build setlist manager
|
||||
10. 🔲 Build customer portal
|
||||
1. Services running (Docker)
|
||||
2. Laravel API configured and migrated
|
||||
3. SPAs installed (`apps/admin`, `apps/app`, `apps/portal`)
|
||||
4. Environment files for API + each SPA
|
||||
5. Authentication and organisation switching
|
||||
6. Events, sections, time slots, shifts
|
||||
7. Persons, crowd types, portal flows
|
||||
8. Accreditation, briefings, operational modules per roadmap in `.cursor/instructions.md`
|
||||
|
||||
Reference in New Issue
Block a user