Commit Graph

132 Commits

Author SHA1 Message Date
Radosław Gierwiało
420209c037 fix(frontend): add error message display on login page
- Show error alert when login fails instead of console-only logging
- Display user-friendly error message: "Invalid email or password"
- Clear error state before new login attempt
- Use existing Alert component for consistency with RegisterPage
2025-11-29 15:26:40 +01:00
Radosław Gierwiało
634cd97032 refactor(frontend): simplify event chat UI
- Replace "Edit heats" button with icon-only version
- Remove connection status indicator (show "Disconnected" warning only when offline)
- Remove event location from header
- Hide Participants tab on desktop (sidebar already visible)
- Remove "Participants" header from sidebar on desktop
2025-11-29 15:18:22 +01:00
Radosław Gierwiało
b79173937b chore: add .repl_history and .claude/ to gitignore 2025-11-29 15:05:38 +01:00
Radosław Gierwiało
dfb5313f9a refactor(frontend): implement mobile-first layout for chat pages
- Add fullWidth prop to Layout component for chat pages
- Redesign EventChatPage and MatchChatPage with fixed layout:
  - Navbar sticky to top (no gaps)
  - Event/partner header directly below navbar
  - Chat content fills available space (flex-1)
  - Input area fixed to bottom
  - Full screen width on mobile (no margins)
- Translate RecordingTab UI strings to English
- Move Leave Event button to header
- Remove unnecessary margins and max-width constraints

This provides a better mobile experience with full-screen chat
interface similar to native messaging apps.
2025-11-29 15:04:41 +01:00
Radosław Gierwiało
9206565523 security: add nginx headers and fix npm vulnerabilities
- Add security headers to nginx (X-Frame-Options, CSP, etc.)
- Reduce client_max_body_size from 500M to 10M
- Add npm overrides to fix cookie vulnerability in csurf
- Make navbar sticky with full width
2025-11-29 15:04:26 +01:00
Radosław Gierwiało
61d23681ff docs: update README with current features and test count
- Add Dashboard, Recording Matching, Competitor Numbers to features
- Update test count: 223 → 286 (73% coverage)
- Mark security features as implemented (CSRF, account lockout)
- Update Phase 3 section with actual completed items
- Update last modified date
2025-11-23 23:12:00 +01:00
Radosław Gierwiało
0d083dcb22 docs: optimize documentation for token efficiency
- SESSION_CONTEXT.md: 485 → 132 lines (-73%)
  - Remove outdated "Next Steps" sections
  - Remove detailed file listings
  - Keep only essential quick-reference info

- TODO.md: 917 → 118 lines (-87%)
  - Move detailed phase descriptions to COMPLETED.md
  - Keep security audit, checklist, future improvements
  - Remove redundant implementation details

- CONTEXT.md: Update test count to 286/286
2025-11-23 23:09:30 +01:00
Radosław Gierwiało
93c5680397 docs: update documentation with recent features
- Add Recording Matching System section (auto-matching algorithm)
- Add Competitor Number (Bib) Support section
- Add Frontend Refactoring section (component extraction, constants)
- Update test count: 223 → 286 tests (73% coverage)
- Update dates to 2025-11-23
2025-11-23 23:05:23 +01:00
Radosław Gierwiało
6f7465ee5a fix(tests): add wsdcId cleanup to prevent unique constraint violations
Both users.test.js and auth-phase1.5.test.js were failing due to
unique constraint violations on wsdc_id field when running after
other test suites. Added wsdcId to cleanup queries and proper
deletion of related data (messages, matches, eventParticipants).
2025-11-23 22:59:06 +01:00
Radosław Gierwiało
0ca79b6c7d refactor(backend): add status constants and update code to use them
- Create constants/statuses.js with MATCH_STATUS, SUGGESTION_STATUS
- Update routes/dashboard.js to use MATCH_STATUS
- Update routes/matches.js to use MATCH_STATUS
- Update routes/events.js to use SUGGESTION_STATUS
- Update services/matching.js to use SUGGESTION_STATUS
- Update tests to use constants
2025-11-23 22:40:54 +01:00
Radosław Gierwiało
408317b974 refactor(frontend): add CONNECTION_STATE and SUGGESTION_TYPE constants
- Add CONNECTION_STATE (disconnected, connecting, connected, failed)
- Add SUGGESTION_TYPE (toBeRecorded, toRecord)
- Update useWebRTC.js to use CONNECTION_STATE
- Update MatchChatPage.jsx to use CONNECTION_STATE
- Update RecordingTab.jsx to use SUGGESTION_TYPE
2025-11-23 22:28:54 +01:00
Radosław Gierwiało
b3a6d39d7a refactor(frontend): replace status string literals with constants
- Create constants/statuses.js with MATCH_STATUS, SUGGESTION_STATUS, MATCH_FILTER
- Update MatchCard, MatchesPage, HistoryPage, RatePartnerPage to use MATCH_STATUS
- Update RecordingTab to use SUGGESTION_STATUS
- Update Navbar to use MATCH_STATUS for API calls
2025-11-23 22:21:12 +01:00
Radosław Gierwiało
93ff331bfb refactor(frontend): extract ProfileForm and PasswordChangeForm from ProfilePage
- Create components/profile/ProfileForm.jsx (192 lines)
- Create components/profile/PasswordChangeForm.jsx (99 lines)
- Create components/profile/index.js barrel export
- Reduce ProfilePage.jsx from 394 → 84 lines (-79%)
2025-11-23 22:13:56 +01:00
Radosław Gierwiało
185c485ec7 refactor(frontend): extract MatchCard component from MatchesPage
- Create components/matches/MatchCard.jsx (119 lines)
- Create components/matches/index.js barrel export
- Reduce MatchesPage.jsx from 349 → 240 lines (-31%)
2025-11-23 22:11:43 +01:00
Radosław Gierwiało
8e17c10353 refactor(frontend): extract DashboardPage into components
Split DashboardPage (578 lines) into focused components:
- DashboardEventCard: event card with chat access
- DashboardMatchCard: match card with status indicators
- MatchRequestCards: incoming/outgoing request cards
- EmptyState: reusable empty state component (in common/)

DashboardPage now 295 lines (-49%)
2025-11-23 22:08:16 +01:00
Radosław Gierwiało
bddcf5f4f9 refactor(frontend): extract EventDetailsPage into components
Split large EventDetailsPage (545 lines) into smaller, focused components:
- QRCodeSection: QR code display and copy link functionality
- ParticipantsSection: participants list with avatars
- MatchingConfigSection: deadline and matching controls
- ScheduleConfigSection: division slot configuration

EventDetailsPage now 148 lines (-73%)
2025-11-23 22:02:09 +01:00
Radosław Gierwiało
4467c570b0 feat(matching): add schedule config for division collision groups
Allow event organizers to configure which divisions run in parallel
(same time slot) for accurate collision detection in the auto-matching
algorithm. Divisions in the same slot will collide with each other.

- Add scheduleConfig JSON field to Event model
- Add PUT /events/:slug/schedule-config API endpoint
- Update matching algorithm to use slot-based collision detection
- Add UI in EventDetailsPage for managing division slots
- Add unit tests for schedule-based collision detection
2025-11-23 19:05:25 +01:00
Radosław Gierwiało
a5a1296a4e feat(frontend): add recording matching UI
Add frontend components for auto-matching recording partners:

- RecordingTab component with suggestions list and opt-out toggle
- Tab navigation in EventChatPage (Chat, Uczestnicy, Nagrywanie)
- Matching configuration in EventDetailsPage (deadline, run matching)
- matchingAPI functions in api.js
- Return registrationDeadline and matchingRunAt in GET /events/:slug/details

UI allows users to:
- View who will record their heats
- View heats they need to record
- Accept/reject suggestions
- Opt-out from being a recorder
- Set registration deadline (admin)
- Manually trigger matching (admin)
2025-11-23 18:50:35 +01:00
Radosław Gierwiało
c18416ad6f feat(matching): add auto-matching system for recording partners
Implement algorithm to match dancers with recorders based on:
- Heat collision avoidance (division + competitionType + heatNumber)
- Buffer time (1 heat after dancing before can record)
- Location preference (same city > same country > anyone)
- Max 3 recordings per person
- Opt-out support (falls to bottom of queue)

New API endpoints:
- PUT /events/:slug/registration-deadline
- PUT /events/:slug/recorder-opt-out
- POST /events/:slug/run-matching
- GET /events/:slug/match-suggestions
- PUT /events/:slug/match-suggestions/:id/status

Database changes:
- Event: registrationDeadline, matchingRunAt
- EventParticipant: recorderOptOut
- RecordingSuggestion: new model for match suggestions
2025-11-23 18:32:14 +01:00
Radosław Gierwiało
edf68f2489 feat(events): add competitor number (bib) support
Allow participants to set their bib/competitor number per event.
Display as badge next to username in participant lists.

- Add competitorNumber field to EventParticipant model
- Add PUT /events/:slug/competitor-number endpoint
- Include competitorNumber in heats/me and heats/all responses
- Add input field in HeatsBanner component
- Display badge in UserListItem component
- Add unit tests for competitor number feature
2025-11-23 17:55:25 +01:00
Radosław Gierwiało
a2279662dc docs: archive DASHBOARD_PLAN.md and update task tracking
- Move completed DASHBOARD_PLAN.md to docs/archive/
- Update COMPLETED.md with dashboard implementation details
- Update TODO.md to reflect dashboard completion
- Mark remaining dashboard features as optional Phase 4
2025-11-21 21:59:51 +01:00
Radosław Gierwiało
8a369c1fc4 fix(socket): improve connection stability with heartbeat and auto-reconnect
- Backend: Add pingInterval (25s) and pingTimeout (60s) for better keep-alive
- Frontend: Increase reconnection attempts to Infinity (keep trying forever)
- Frontend: Add reconnect event handlers to rejoin rooms after reconnection
- Frontend: Check initial connection state when reusing socket instance
2025-11-21 21:53:51 +01:00
Radosław Gierwiało
78280ca8d8 feat(dashboard): add unread count for match chats
Track unread messages in match chats and display count badge:
- Schema: Add user1LastReadAt/user2LastReadAt to Match model
- Backend: Calculate unreadCount in dashboard API
- Socket: Update lastReadAt when user joins match room
- Frontend: Display red badge with unread count on match avatar
2025-11-21 21:46:00 +01:00
Radosław Gierwiało
2c0620db6a feat(dashboard): add online count for events
Show real-time count of users currently in each event chat room.
- Backend: Export getEventsOnlineCounts from socket module
- Dashboard API: Include onlineCount for each active event
- Frontend: Display online count with animated green dot indicator
2025-11-21 21:41:16 +01:00
Radosław Gierwiało
c15031db9f feat(frontend): add skeleton loading state for dashboard
Replace simple spinner with skeleton loading placeholders that match
the dashboard layout structure, providing better visual feedback during
data loading.
2025-11-21 21:37:05 +01:00
Radosław Gierwiało
87b0079b84 feat(frontend): add toast notifications for dashboard actions
- Install react-hot-toast library
- Add Toaster component to App.jsx
- Show success/error toasts for match accept/reject/cancel
- Show toasts for real-time match events
- Update tests with toast mocks
2025-11-21 21:27:03 +01:00
Radosław Gierwiało
4187157b94 feat(frontend): add Rate Partner button and dashboard tests
- Add Rate button to MatchCard (shows when video exchange complete & not rated)
- Add 15 comprehensive tests for DashboardPage component
- Tests cover: loading, empty states, events, matches, requests, navigation
2025-11-21 21:21:58 +01:00
Radosław Gierwiało
f3bd169dbf feat(frontend): implement dashboard page
- Create DashboardPage with active events, matches, and requests
- Add dashboardAPI.getData() to services/api.js
- Add /dashboard route as default landing after login
- Update Navbar with Dashboard and Events links
- Show video exchange and rating status for matches
- Handle match accept/reject/cancel actions
2025-11-21 21:12:25 +01:00
Radosław Gierwiało
901b046a34 feat(backend): implement dashboard API endpoint
- Add GET /api/dashboard endpoint for authenticated users
- Returns active events with user heats
- Returns accepted matches with partner info
- Detects video exchange status from message parsing
- Tracks rating completion status (rated by me/partner)
- Returns incoming/outgoing pending match requests
- Add comprehensive test suite (12 tests, 93% coverage)
- Add DASHBOARD_PLAN.md with full design documentation
2025-11-21 21:00:50 +01:00
Radosław Gierwiało
b945354db3 docs: move completed frontend refactoring to COMPLETED.md
Moved the entire frontend refactoring section (3 phases + bug fixes)
from TODO.md to docs/archive/COMPLETED.md for better organization.

Changes:
- TODO.md: Removed completed refactoring tasks (lines 363-728)
- COMPLETED.md: Added comprehensive refactoring summary with:
  - All 3 phases (Components, Hooks, Advanced Components)
  - Bug fixes (formatHeat, ChatRoom missing)
  - Final metrics (-559 lines, 16 new components, 3 new hooks)
  - Component structure diagram
2025-11-21 17:41:39 +01:00
Radosław Gierwiało
198c216b44 fix(backend): auto-create event ChatRoom on first check-in
Problem:
- User got "Chat room not found" error when trying to send messages
- Event ChatRooms were only created by seed script, not for manually
  created events
- Event "Another Dance Event" (ID: 420) was missing its ChatRoom

Root Cause:
- Seed script (seed.js:179-188) correctly creates ChatRooms for events
- But events created outside of seed (CLI, manual DB insert) didn't
  create ChatRooms
- Socket handler requires ChatRoom to exist before accepting messages

Solution:
1. Added defensive check in check-in handler (POST /api/events/checkin/:token)
2. Automatically creates ChatRoom if missing when first user checks in
3. Logs creation for debugging: "Created missing chat room for event: {slug}"

Impact:
- Existing events without ChatRooms will get them on next check-in
- Future manually-created events will work correctly
- No breaking changes - all 223 tests pass

Changes:
- backend/src/routes/events.js: Added ChatRoom existence check and
  auto-creation logic (lines 256-272)

Note: Manually created ChatRoom for event ID 420 to fix immediate issue
2025-11-21 17:34:17 +01:00
Radosław Gierwiało
ade5190d7b fix(frontend): resolve missing formatHeat function in EventChatPage
Bug: EventChatPage referenced formatHeat() function in header's heat display
(line 365) but the function was removed during Phase 3 refactoring when
creating the HeatBadges component.

Solution:
1. Enhanced HeatBadges component with badgeClassName prop to support
   custom styling (needed for dark header background)
2. Replaced manual heat rendering in EventChatPage header with
   HeatBadges component
3. Passed custom badge styling to match the dark primary-700 header

Changes:
- HeatBadges.jsx: Added badgeClassName prop for style customization
- EventChatPage.jsx: Replaced manual heat map with HeatBadges component

Fixes: "Uncaught ReferenceError: formatHeat is not defined" error
2025-11-21 17:29:12 +01:00
Radosław Gierwiało
082105c5bf refactor(frontend): Phase 3 - create advanced composite components
Extract complex UI sections into reusable composite components

New Components Created:
1. HeatBadges (heats/HeatBadges.jsx)
   - Displays competition heats with compact notation
   - Configurable max visible badges with "+X more" overflow
   - Tooltips with full heat information

2. UserListItem (users/UserListItem.jsx)
   - Reusable user entry with avatar, username, full name
   - Optional heat badges display
   - Flexible action button slot (render props pattern)
   - Online/offline status support

3. ParticipantsSidebar (events/ParticipantsSidebar.jsx)
   - Complete sidebar component for event participants
   - Filter checkbox for hiding users from own heats
   - Participant and online counters
   - Integrated UserListItem with match actions

4. FileTransferProgress (webrtc/FileTransferProgress.jsx)
   - WebRTC P2P file transfer UI
   - Progress bar with percentage
   - Send/Cancel actions

5. LinkShareInput (webrtc/LinkShareInput.jsx)
   - Fallback link sharing when WebRTC unavailable
   - Google Drive, Dropbox link support

Pages Refactored:
- EventChatPage: 564 → 471 lines (-93 lines, -16%)
  * Replaced 90-line participants sidebar with <ParticipantsSidebar />
  * Removed duplicate formatHeat logic (now in HeatBadges)

- MatchChatPage: 446 → 369 lines (-77 lines, -17%)
  * Replaced 56-line file transfer UI with <FileTransferProgress />
  * Replaced 39-line link input form with <LinkShareInput />

Phase 3 Total: -170 lines
Grand Total (Phase 1+2+3): -559 lines (-17%)

Final Results:
- EventChatPage: 761 → 471 lines (-290 lines, -38% reduction)
- MatchChatPage: 567 → 369 lines (-198 lines, -35% reduction)

Benefits:
- Massive complexity reduction in largest components
- Composite components can be reused across pages
- Better testability - each component tested independently
- Cleaner code organization - single responsibility principle
- Easier maintenance - changes in one place propagate everywhere
2025-11-21 17:10:53 +01:00
Radosław Gierwiało
9e74343c3b refactor(frontend): Phase 2 - extract business logic into custom hooks
Separate concerns - move Socket.IO and form logic from components to reusable hooks

New Hooks:
- useForm: Generic form state management with handleChange/handleSubmit/reset
- useEventChat: Extract Socket.IO logic from EventChatPage (156 lines)
  * Manages messages, active users, connection state
  * Handles send message, load older messages with scroll preservation
  * Real-time updates via Socket.IO event listeners
- useMatchChat: Extract Socket.IO logic from MatchChatPage (115 lines)
  * Manages 1:1 chat messages and connection
  * Loads message history from API
  * Real-time message sync via Socket.IO

Pages Refactored:
- EventChatPage: 661 → 564 lines (-97 lines, -15%)
- MatchChatPage: 517 → 446 lines (-71 lines, -14%)

Benefits:
- Cleaner component code - UI separated from business logic
- Reusable hooks can be used in other components
- Easier to test - hooks can be unit tested independently
- Better code organization - single responsibility principle
- 168 lines eliminated from pages, moved to 271 lines of reusable hooks

Phase 2 Total: -168 lines
Grand Total (Phase 1+2): -389 lines (-12%)
2025-11-21 17:02:04 +01:00
Radosław Gierwiało
dea9d70bb9 refactor(frontend): integrate reusable components across all pages
Phase 1 refactoring - eliminate code duplication and improve maintainability

Changes:
- LoginPage: Integrate FormInput and LoadingButton components (-9 lines)
- RegisterPage: Replace inline forms with FormInput/LoadingButton/Alert (-62 lines)
- EventChatPage: Integrate ChatMessageList/ChatInput and Modal components (-100 lines)
- MatchChatPage: Integrate ChatMessageList/ChatInput components (-50 lines)
- ProfilePage: Already using reusable components (no changes)

Total reduction: 221 lines (-11.6%)

Benefits:
- Eliminated ~40% code duplication in chat UI
- Unified form inputs across authentication pages
- Consistent modal dialogs with ConfirmationModal
- Improved maintainability - changes propagate to all uses
- Faster feature development with component library

Components used:
- Alert, FormInput, FormSelect, LoadingButton, LoadingSpinner
- ChatMessageList, ChatMessage, ChatInput
- Modal, ConfirmationModal
2025-11-21 16:50:46 +01:00
Radosław Gierwiało
1772fc522e feat(frontend): create reusable components for Phase 1 refactoring
- Add Alert component with 4 variants (success/error/warning/info)
- Add LoadingSpinner and LoadingButton components
- Add FormInput and FormSelect components with icon support
- Add Modal and ConfirmationModal components
- Add ChatMessage, ChatMessageList, and ChatInput components
- Add EventCard component

These components will eliminate ~450 lines of duplicated code across pages.
Part of Phase 1 (Quick Wins) frontend refactoring.
2025-11-20 23:22:05 +01:00
Radosław Gierwiało
c1b5ae2ad3 docs: add comprehensive frontend refactoring analysis and Phase 1 roadmap to TODO.md 2025-11-20 23:15:24 +01:00
Radosław Gierwiało
5cc11242ef docs: add comprehensive security audit findings to TODO.md 2025-11-20 23:02:59 +01:00
Radosław Gierwiało
c14d99d1b8 docs: update README.md to reflect current project state (Phase 3 completed, 11 tables, 223 tests passing) 2025-11-20 22:47:25 +01:00
Radosław Gierwiało
23e5382aa7 docs: update README.md documentation links after reorganization 2025-11-20 22:44:24 +01:00
Radosław Gierwiało
975d258497 docs: reorganize documentation structure for better context efficiency
Reorganization changes:
1. Moved from root → docs/:
   - QUICKSTART.md
   - QUICK_TEST.md
   - WEBRTC_TESTING_GUIDE.md

2. Created docs/archive/ and moved archival files:
   - COMPLETED.md (completed tasks archive)
   - PHASE_1.5.md (historical phase documentation)
   - RESOURCES.md (learning resources)
   - SECURITY_AUDIT.md (security audit)
   - ADMIN_CLI.md (CLI documentation)

3. Updated all references in:
   - README.md
   - docs/CONTEXT.md
   - docs/TODO.md
   - docs/SESSION_CONTEXT.md
   - docs/DEPLOYMENT.md
   - docs/QUICK_TEST.md

Active docs/ now contains only essential files:
- SESSION_CONTEXT.md (primary for context restoration)
- TODO.md
- CONTEXT.md
- ARCHITECTURE.md
- DEPLOYMENT.md
- MONITORING.md
- QUICKSTART.md
- QUICK_TEST.md
- WEBRTC_TESTING_GUIDE.md

Benefits:
- Reduced token usage when reading docs/ for context
- Clear separation between active and archived documentation
- Better organization for future maintenance
2025-11-20 22:42:06 +01:00
Radosław Gierwiało
1463b83882 docs: add Phase 2.5 (WebRTC) and Phase 3 (MVP Finalization) to COMPLETED.md
Added comprehensive completion documentation for:

Phase 2.5 (WebRTC P2P File Transfer):
- WebRTC signaling implementation
- File transfer with 16KB chunking
- Tested up to 700MB files
- E2E encryption (DTLS)
- NAT traversal (STUN servers)
- 7 backend tests passing

Phase 3 (MVP Finalization):
- Security hardening (CSRF, rate limiting, account lockout)
- 223/223 tests passing (100%), 71% coverage
- PWA features (manifest, service worker, iOS support)
- Production Docker configs
- Operations scripts (backup, restore, health-check)
- Monitoring documentation

Updated Last Updated date to 2025-11-20
Added MVP completion status
2025-11-20 22:35:41 +01:00
Radosław Gierwiało
63d528367e docs: update CONTEXT.md and ARCHITECTURE.md to reflect completed MVP
CONTEXT.md updates:
- Changed 'Planned' to 'Implemented' for backend, db, and WebRTC
- Updated Docker Compose components - all services now implemented
- Updated database models section with actual schema
- Updated tech stack - removed 'Planned' labels
- Added test coverage stats (223/223 tests passing)
- Updated Last Updated date to 2025-11-20
- Added MVP complete status

ARCHITECTURE.md updates:
- Updated architecture diagram - marked backend and db as  IMPL
- Changed 'Planned Services' to 'Implemented Services'
- Added production Dockerfile info
- Added test coverage (223/223 passing, 71%)
- Added Prisma ORM details
- Updated Last Updated date to 2025-11-20
- Added production-ready status

Both files now accurately reflect the completed MVP state.
2025-11-20 22:34:05 +01:00
Radosław Gierwiało
268cd73365 docs: fix outdated and inconsistent information in TODO.md
Corrections made:
-  Phase 1.6 (Competition Heats) - marked as COMPLETED (was IN PROGRESS)
-  Phase 2.5 (WebRTC) - marked as COMPLETED (was NEXT)
-  Phase 3 - marked as COMPLETED in progress table
-  Infrastructure section - added completed Docker prod configs
-  Testing section - updated with 223/223 passing tests
-  Progress table - updated to show 100% MVP complete
-  Overall progress - updated from 72% to 100%
-  Removed outdated 'Next Priority: WebRTC' section
-  Updated 'Last Updated' date to 2025-11-20
-  Updated Notes section with current status

All information now accurately reflects completed MVP state.
2025-11-20 22:30:18 +01:00
Radosław Gierwiało
eda7055e08 docs: mark Phase 3 (MVP Finalization) as completed
Update project status to reflect completion of all MVP features:

Phase 3 achievements:
-  Security hardening (CSRF, rate limiting, account lockout)
-  All tests passing (223/223, 71% coverage)
-  PWA features (manifest, service worker, iOS support)
-  Production deployment preparation
-  Operations scripts (backup, restore, health-check)
-  Monitoring documentation

Status: 100% MVP complete, ready for production deployment
Next: Infrastructure setup (server, domain, SSL)
2025-11-20 22:24:35 +01:00
Radosław Gierwiało
642c8f6d6f feat: add production operations scripts and monitoring guide
Add comprehensive tooling for production deployment:

Scripts (scripts/):
- backup-db.sh: Automated database backups with 7-day retention
- restore-db.sh: Safe database restore with confirmation prompts
- health-check.sh: Complete service health monitoring
- README.md: Operational scripts documentation

Monitoring (docs/MONITORING.md):
- Application health monitoring
- Docker container monitoring
- External monitoring setup (UptimeRobot, Pingdom)
- Log monitoring and rotation
- Alerting configuration
- Incident response procedures
- SLA targets and metrics

All scripts include:
- Environment support (dev/prod)
- Error handling and validation
- Detailed status reporting
- Safety confirmations where needed
2025-11-20 22:22:22 +01:00
Radosław Gierwiało
2e194e1640 docs: update SESSION_CONTEXT.md with completed test fixes
- All 223/223 backend tests now passing (100%)
- Code coverage improved to 71% (from ~43%)
- Updated progress to ~95% (from ~90%)
- Removed 'improved test coverage' from What's Missing
- Added test isolation achievement to Phase 3 status
2025-11-20 22:14:07 +01:00
Radosław Gierwiało
ab1e4a5cc8 docs: update TODO.md with completed test fixes (223/223 passing) 2025-11-20 22:12:58 +01:00
Radosław Gierwiało
688f71343d test: fix test isolation by using unique test data per suite
- Add unique prefixes to test usernames (users_, matches_, events_)
- Add unique prefixes to test emails to prevent conflicts
- Add unique prefixes to event slugs and worldsdc_id values
- This prevents race conditions when Jest runs tests in parallel

Results:
- All 223 tests now passing (was 145/223)
- 14/14 test suites passing (was 11/14)
- Code coverage improved to 71.31% (from ~45%)

Fixes:
- users.test.js: Changed john_dancer → users_john_dancer
- matches.test.js: Changed to matches_ prefix
- events.test.js: Changed to events_ prefix + unique worldsdc_id
2025-11-20 22:12:09 +01:00
Radosław Gierwiało
fd0dcdf77f test: improve test cleanup with selective deletion
- Replace deleteMany({}) with selective deletion by username/email/slug in:
  - events.test.js (target specific test users/events only)
  - matches.test.js (target specific test users/events only)
  - csrf.test.js (target csrftest user only)
- Replace delete() with deleteMany() for resilient cleanup:
  - matches.test.js (2 inline cleanups)
  - socket-webrtc.test.js (1 inline cleanup)
- Update TODO.md with test status and future UX/UI improvements

Test improvement: 189/223 passing (84.8%), up from 145/223 (65%)
2025-11-20 00:05:24 +01:00