From 265926b01940b823ec07a231d05cbb75b1ea6efd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Gierwia=C5=82o?= Date: Fri, 14 Nov 2025 17:31:38 +0100 Subject: [PATCH] docs: update SESSION_CONTEXT for Phase 1.6 heats system backend --- docs/SESSION_CONTEXT.md | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/docs/SESSION_CONTEXT.md b/docs/SESSION_CONTEXT.md index 0d76177..a1bd9d0 100644 --- a/docs/SESSION_CONTEXT.md +++ b/docs/SESSION_CONTEXT.md @@ -15,9 +15,10 @@ ## Current Status -**Phase:** 1.5 (Email Verification & WSDC Integration + User Profiles + Security) - ✅ COMPLETED -**Progress:** ~65% -**Next Goal:** Phase 2 - Core Features (Matches API, Ratings, WebRTC signaling) +**Phase:** 1.6 (Competition Heats System) - ⏳ IN PROGRESS (Backend ✅ Complete, Frontend ⏳ Pending) +**Previous Phase:** 1.5 (Email & WSDC & Profiles & Security & QR Check-in) - ✅ COMPLETED +**Progress:** ~70% +**Next Goal:** Complete Phase 1.6 Frontend, then Phase 2 - Core Features (Matches API, Ratings, WebRTC signaling) ### What Works Now - ✅ Docker Compose (nginx:8080 + frontend + backend + PostgreSQL) @@ -130,9 +131,11 @@ - `backend/src/controllers/auth.js` - Register, login, email verification, password reset - `backend/src/controllers/user.js` - **UPDATED: Profile updates (social, location) - Phase 1.5** - `backend/src/controllers/wsdc.js` - WSDC API proxy for dancer lookup -- `backend/src/routes/events.js` - **UPDATED: QR check-in endpoints (checkin, details, leave), participant verification - Phase 1.5** +- `backend/src/routes/events.js` - **UPDATED: Heats management endpoints (POST/GET/DELETE /heats) - Phase 1.6** +- `backend/src/routes/divisions.js` - **NEW: List all divisions - Phase 1.6** +- `backend/src/routes/competitionTypes.js` - **NEW: List all competition types - Phase 1.6** - `backend/src/routes/users.js` - **UPDATED: Public profile endpoint - Phase 1.5** -- `backend/src/socket/index.js` - **UPDATED: Participant verification before room join, security fix - Phase 1.5** +- `backend/src/socket/index.js` - **UPDATED: heats_updated broadcast event, getIO export - Phase 1.6** - `backend/src/utils/email.js` - AWS SES email service with HTML templates - `backend/src/utils/auth.js` - Token generation utilities - `backend/src/middleware/auth.js` - Email verification middleware @@ -152,7 +155,7 @@ ## Database Schema (Implemented - Prisma) -8 tables with relations: +11 tables with relations: - `users` - **EXTENDED in Phase 1.5:** - Base: id, username, email, password_hash, avatar, created_at, updated_at - **WSDC:** first_name, last_name, wsdc_id @@ -163,6 +166,9 @@ - `events` - id, **slug (unique)**, name, location, start_date, end_date, description, worldsdc_id, participants_count - `event_participants` - **NEW in Phase 1.5:** id, user_id, event_id, joined_at (many-to-many) - `event_checkin_tokens` - **NEW in Phase 1.5:** id, event_id (unique), token (cuid, unique), created_at +- `divisions` - **NEW in Phase 1.6:** id, name, abbreviation, display_order (Newcomer, Novice, Intermediate, Advanced, All-Star, Champion) +- `competition_types` - **NEW in Phase 1.6:** id, name, abbreviation (Jack & Jill, Strictly) +- `event_user_heats` - **NEW in Phase 1.6:** id, user_id, event_id, division_id, competition_type_id, heat_number (1-9), role (Leader/Follower/NULL) - `chat_rooms` - id, event_id, match_id, type (event/private), created_at - `messages` - id, room_id, user_id, content, type, created_at - `matches` - id, user1_id, user2_id, event_id, room_id, status, created_at @@ -173,8 +179,9 @@ - `20251113151534_add_wsdc_and_email_verification` - Phase 1.5 (email, WSDC, social, location) - `20251113202500_add_event_slug` - **Phase 1.5 (event security - unique slugs)** - `20251114125544_add_event_checkin_tokens` - **Phase 1.5 (QR code check-in system)** +- `20251114142504_add_competition_heats_system` - **Phase 1.6 (competition heats for matchmaking)** -**Seed data:** 3 events, 2 users, event chat rooms +**Seed data:** 4 events, 6 divisions, 2 competition types, event chat rooms --- @@ -373,4 +380,9 @@ RUN apk add --no-cache openssl - Event participation tracking - Event security (unique slugs, no ID enumeration) - **QR code event check-in system** (physical presence required, dev mode bypass) +**Phase 1.6 Status:** ⏳ IN PROGRESS - Competition Heats System + - ✅ Backend Complete: 3 new tables (divisions, competition_types, event_user_heats) + - ✅ API endpoints (GET /divisions, GET /competition-types, heats CRUD) + - ✅ Socket.IO heats_updated broadcast + - ⏳ Frontend Pending: HeatsBanner component, EventChatPage updates, badges, filtering **Next Phase:** Phase 2 - Core Features (Matches API + Ratings + WebRTC)