Three load-bearing files still described the pre-WS-3 dual-SPA reality. Surgical edits to reflect the single-SPA architecture shipped in WS-3 PR-B (B1: portal moves; B2a: auth+routing consolidation; B2b: server-side cookie consolidation). CLAUDE.md: - Quality-gates ts-reset bullet (line 27): "both SPAs" → "the SPA" - Quality-gates Vitest bullet (lines 30-32): rewrite from "apps/portal has 113+ tests; apps/app currently has no Vitest setup (TECH-APP-VITEST)" to current truth: apps/app has Vitest with 213 tests as of PR-B2a. TECH-APP-VITEST is implicitly closed. - Repository layout (line 44): drop apps/portal/ bullet; rephrase apps/app/ as the single workspace - "Apps and portal architecture" → "App architecture": rewrite for single-workspace + two access modes. Login-based covers organizers + volunteers + crew + super_admin (context-routed in-app via useAuthStore.availableContexts); token-based covers artists, suppliers, press - CORS subsection: collapse two-origin config to single origin (localhost:5174 dev, https://crewli.app prod). Preserve the existing crewli.nl marketing-only note WS-TOOLING-001 sections (Larastan, Rector, Telescope tooling configuration) verified untouched via `git diff CLAUDE.md`. README.md (line 25): collapse the Applications table from two rows (Organizer + Portal) to one (SPA). Adjust trailing sentence accordingly. Makefile: - .PHONY list: drop `portal` - help echo: drop "make portal" line - portal target: removed (the underlying `cd apps/portal && pnpm dev` would fail since the directory was removed in PR-B1) Out of scope (deferred to TECH-DOCS-APPS-PORTAL-PURGE backlog item): .cursor/ instructions, MASTER_PROMPT_*, dev-docs/SETUP, dev-docs/dev-guide, dev-docs/CLAUDE_CODE_TOOLING. WS-3-SESSION-1C-AUDIT.md skipped (frozen historical doc). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
94 lines
3.8 KiB
Makefile
94 lines
3.8 KiB
Makefile
.PHONY: help services services-stop api app docs migrate fresh db-shell test test-db-create schema-dump
|
|
|
|
# Colors
|
|
GREEN := \033[0;32m
|
|
YELLOW := \033[0;33m
|
|
CYAN := \033[0;36m
|
|
NC := \033[0m
|
|
|
|
help:
|
|
@echo ""
|
|
@echo "$(GREEN)╔══════════════════════════════════════════════════════════════╗$(NC)"
|
|
@echo "$(GREEN)║ CREWLI - Development Commands ║$(NC)"
|
|
@echo "$(GREEN)╚══════════════════════════════════════════════════════════════╝$(NC)"
|
|
@echo ""
|
|
@echo " $(YELLOW)Services (Docker):$(NC)"
|
|
@echo " make services Start MySQL, Redis, Mailpit"
|
|
@echo " make services-stop Stop all Docker services"
|
|
@echo ""
|
|
@echo " $(YELLOW)Development Servers:$(NC)"
|
|
@echo " make api Laravel API → http://localhost:8000"
|
|
@echo " make app Organizer SPA → http://localhost:5174"
|
|
@echo " make docs VitePress docs → http://localhost:5176"
|
|
@echo ""
|
|
@echo " $(YELLOW)Database:$(NC)"
|
|
@echo " make migrate Run migrations"
|
|
@echo " make fresh Fresh migrate + seed"
|
|
@echo " make db-shell Open MySQL shell"
|
|
@echo " make test-db-create Create crewli_test database (one-time)"
|
|
@echo " make schema-dump Regenerate MySQL schema dump (run after new migrations)"
|
|
@echo ""
|
|
@echo " $(YELLOW)Testing:$(NC)"
|
|
@echo " make test Run PHPUnit suite (creates crewli_test if needed)"
|
|
@echo ""
|
|
|
|
services:
|
|
@echo "$(GREEN)Starting Docker services...$(NC)"
|
|
@docker compose up -d
|
|
@echo ""
|
|
@echo "$(GREEN)Services:$(NC)"
|
|
@echo " $(CYAN)MySQL:$(NC) localhost:3306 (crewli / secret)"
|
|
@echo " $(CYAN)Redis:$(NC) localhost:6379"
|
|
@echo " $(CYAN)Mailpit:$(NC) http://localhost:8025"
|
|
@echo ""
|
|
@echo "$(YELLOW)Waiting for MySQL...$(NC)"
|
|
@until docker exec bm_mysql mysqladmin ping -h localhost -u root -proot --silent 2>/dev/null; do sleep 1; done
|
|
@echo "$(GREEN)✓ Ready!$(NC)"
|
|
|
|
services-stop:
|
|
@docker compose down
|
|
@echo "$(GREEN)✓ Services stopped$(NC)"
|
|
|
|
api:
|
|
@echo "$(GREEN)Starting Laravel API → http://localhost:8000$(NC)"
|
|
@cd api && php artisan serve
|
|
|
|
app:
|
|
@echo "$(GREEN)Starting Organizer SPA → http://localhost:5174$(NC)"
|
|
@cd apps/app && pnpm dev
|
|
|
|
docs:
|
|
@echo "$(GREEN)Starting VitePress docs → http://localhost:5176$(NC)"
|
|
@cd docs && npm run docs:dev
|
|
|
|
migrate:
|
|
@cd api && php artisan migrate
|
|
|
|
fresh:
|
|
@cd api && php artisan migrate:fresh --seed
|
|
|
|
db-shell:
|
|
@docker exec -it bm_mysql mysql -u crewli -psecret crewli
|
|
|
|
test-db-create:
|
|
@echo "$(GREEN)Creating crewli_test database...$(NC)"
|
|
@docker exec bm_mysql mysql -u root -proot -e "CREATE DATABASE IF NOT EXISTS crewli_test CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; GRANT ALL PRIVILEGES ON crewli_test.* TO 'crewli'@'%'; FLUSH PRIVILEGES;"
|
|
@echo "$(GREEN)✓ crewli_test ready$(NC)"
|
|
|
|
test: test-db-create
|
|
@cd api && php artisan test
|
|
|
|
# Regenerate api/database/schema/mysql-schema.sql via Laravel's native
|
|
# `schema:dump` command. Brings crewli_test to head first so the dump
|
|
# always reflects the latest migration set. Requires mysql-client on
|
|
# host PATH (see CLAUDE.md "Schema dumps (CI fast path)").
|
|
#
|
|
# After adding a new migration: run `make schema-dump` and commit the
|
|
# regenerated dump alongside the migration.
|
|
schema-dump: test-db-create
|
|
@echo "$(GREEN)Migrating crewli_test to head...$(NC)"
|
|
@cd api && DB_DATABASE=crewli_test php artisan migrate --force --quiet
|
|
@echo "$(GREEN)Regenerating api/database/schema/mysql-schema.sql...$(NC)"
|
|
@cd api && DB_DATABASE=crewli_test php artisan schema:dump --database=mysql
|
|
@echo "$(YELLOW)Note: Commit the updated schema dump alongside any new migrations.$(NC)"
|