2.0 KiB
2.0 KiB
TASK METADATA
- Target Files:
server/db.tsserver/main.tsui/components/EventJoinPage.tsxui/components/EventSplashPage.tsxserver/main.test.ts
- Core Objective: Implement Multi-Claim Event Passes with short vanity URLs
(
/e/:slug), universal PIN join portal (/join), and CLI environment 1-liner (/join/:slug?format=env). - Dependencies:
server/db.ts,server/auth-session.ts - Additional Important Notes: Provisions isolated guest seats
(
guest_<slug>_<index>) with individual sessions.
1. Architectural Considerations & Risks
- Concurrency & Seat Limits:
- Ensure atomicity when incrementing
seats_claimedonevent_passesso events with strict seat limits (e.g. 50 seats) do not oversubscribe.
- Ensure atomicity when incrementing
- Multi-Channel Accessibility:
- Support web browser UI (
/e/:slug,/join), JSON API (POST /api/join), and CLI environment output (GET /join/:slug?format=env).
- Support web browser UI (
- Session Isolation:
- Each attendee gets their own dedicated guest session and UUID, preventing state collision in shared sandbox apps.
2. Proposed Implementation
- Database Schema (
server/db.ts):- Create
event_passestable with columns:id,slug,pin_code,name,app_id,role,max_seats,seats_claimed,lifespan_hours,created_by,is_active,expires_at,created_at.
- Create
- API Endpoints (
server/main.ts):POST /api/events: Create a new event pass.GET /e/:slug: Web landing splash with "Enter Workshop" button.GET /join: Universal PIN / code entry page.POST /api/join: Redeems code or PIN, creates isolated guest user and session, sets cookie or returns JSON.GET /join/:slug: Returns CLI 1-liner (export AUTH_YES_TOKEN="..."when?format=env).
- SSR UI Components:
ui/components/EventJoinPage.tsxui/components/EventSplashPage.tsx
- Automated Tests (
server/main.test.ts):- Test event creation, PIN redemption, seat limit capping, and CLI output format.