2025-11-12 18:07:42 +01:00
|
|
|
# Session Context - spotlight.cam
|
|
|
|
|
|
2025-11-23 23:09:30 +01:00
|
|
|
**Quick reference for resuming development sessions**
|
2025-11-12 18:07:42 +01:00
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## Project Overview
|
|
|
|
|
|
|
|
|
|
**Name:** spotlight.cam
|
|
|
|
|
**Purpose:** P2P video exchange app for dance event participants
|
|
|
|
|
**Main Feature:** WebRTC P2P video file transfer (no server storage)
|
|
|
|
|
**Tech Stack:** React + Vite + Tailwind | Node.js + Express + Socket.IO | PostgreSQL 15 | Docker Compose
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## Current Status
|
|
|
|
|
|
2025-11-23 23:09:30 +01:00
|
|
|
**Phase:** MVP Complete - Ready for Production Deployment
|
2025-11-29 23:39:44 +01:00
|
|
|
**Tests:** 285/286 backend tests passing - 99.7% (73% coverage)
|
2025-11-23 23:09:30 +01:00
|
|
|
**Next Goal:** Infrastructure setup (server, domain, SSL)
|
2025-11-12 18:07:42 +01:00
|
|
|
|
2025-11-23 23:09:30 +01:00
|
|
|
### Core Features (All Implemented)
|
|
|
|
|
- JWT authentication with email verification (AWS SES)
|
|
|
|
|
- Real-time chat (Socket.IO) - event rooms + private 1:1
|
|
|
|
|
- WebRTC P2P file transfer (RTCDataChannel, up to 700MB tested)
|
|
|
|
|
- Competition heats system for matchmaking
|
2025-11-29 23:39:44 +01:00
|
|
|
- Recording matching system with 3-tier account system (BASIC/SUPPORTER/COMFORT)
|
|
|
|
|
- Fairness algorithm (karma tracking: recordingsDone vs recordingsReceived)
|
|
|
|
|
- Dual buffer system (prep before + rest after dancing)
|
|
|
|
|
- Clickable usernames with @ prefix, country flags
|
2025-11-23 23:09:30 +01:00
|
|
|
- Matches & ratings API
|
|
|
|
|
- QR code event check-in
|
|
|
|
|
- PWA (offline support, iOS compatible)
|
|
|
|
|
- Security: CSRF, rate limiting, account lockout
|
2025-11-29 23:39:44 +01:00
|
|
|
- Test bot for automated testing
|
2025-11-12 18:07:42 +01:00
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
2025-11-23 23:09:30 +01:00
|
|
|
## Project Structure (Key Paths)
|
2025-11-12 18:07:42 +01:00
|
|
|
|
|
|
|
|
```
|
|
|
|
|
/spotlightcam
|
2025-11-23 23:09:30 +01:00
|
|
|
├── docker-compose.yml # nginx:8080 + frontend + backend + db
|
|
|
|
|
├── frontend/src/
|
|
|
|
|
│ ├── pages/ # React pages
|
|
|
|
|
│ ├── components/ # Reusable components
|
|
|
|
|
│ ├── contexts/ # AuthContext
|
|
|
|
|
│ ├── services/ # api.js, socket.js
|
|
|
|
|
│ ├── hooks/ # useWebRTC.js
|
|
|
|
|
│ └── constants/ # MATCH_STATUS, SUGGESTION_STATUS, etc.
|
|
|
|
|
├── backend/src/
|
|
|
|
|
│ ├── routes/ # API endpoints
|
|
|
|
|
│ ├── controllers/ # Business logic
|
|
|
|
|
│ ├── services/ # matching.js (auto-matching algorithm)
|
|
|
|
|
│ ├── socket/ # Socket.IO handlers
|
|
|
|
|
│ ├── constants/ # Status constants
|
|
|
|
|
│ └── __tests__/ # Jest tests
|
2025-11-12 18:07:42 +01:00
|
|
|
└── docs/
|
2025-11-23 23:09:30 +01:00
|
|
|
├── TODO.md # Current tasks & security audit
|
|
|
|
|
├── ARCHITECTURE.md # Technical details
|
|
|
|
|
└── archive/COMPLETED.md # Historical reference
|
2025-11-12 18:07:42 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
2025-11-23 23:09:30 +01:00
|
|
|
## Database Schema (11 tables)
|
2025-11-12 18:07:42 +01:00
|
|
|
|
2025-11-23 23:09:30 +01:00
|
|
|
Key models:
|
|
|
|
|
- `users` - Auth, profile, social links, location, lockout fields
|
2025-11-29 23:39:44 +01:00
|
|
|
- Account tiers: `accountTier` (BASIC/SUPPORTER/COMFORT), `recordingsDone`, `recordingsReceived`
|
2025-11-23 23:09:30 +01:00
|
|
|
- `events` - Dance events with unique slugs
|
2025-11-29 23:39:44 +01:00
|
|
|
- `event_participants` - User-event relationship, competitorNumber, recorderOptOut, `accountTierOverride`
|
2025-11-23 23:09:30 +01:00
|
|
|
- `divisions` / `competition_types` / `event_user_heats` - Competition system
|
|
|
|
|
- `matches` - User pairings with CUID slugs
|
|
|
|
|
- `ratings` - 1-5 stars, comments
|
2025-11-29 23:39:44 +01:00
|
|
|
- `recording_suggestions` - Auto-matching results with collision detection
|
2025-11-23 23:09:30 +01:00
|
|
|
- `chat_rooms` / `messages` - Real-time chat persistence
|
2025-11-12 18:07:42 +01:00
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
2025-11-23 23:09:30 +01:00
|
|
|
## Quick Commands
|
2025-11-12 18:07:42 +01:00
|
|
|
|
|
|
|
|
```bash
|
2025-11-23 23:09:30 +01:00
|
|
|
# Start development
|
2025-11-12 18:07:42 +01:00
|
|
|
docker compose up --build
|
|
|
|
|
|
2025-11-23 23:09:30 +01:00
|
|
|
# Run backend tests
|
|
|
|
|
docker compose exec backend npm test
|
2025-11-12 18:07:42 +01:00
|
|
|
|
2025-11-23 23:09:30 +01:00
|
|
|
# Access
|
|
|
|
|
# Frontend: http://localhost:8080
|
|
|
|
|
# API: http://localhost:8080/api
|
|
|
|
|
# Health: http://localhost:8080/api/health
|
2025-11-12 18:07:42 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
2025-11-23 23:09:30 +01:00
|
|
|
## Development Guidelines
|
2025-11-12 18:07:42 +01:00
|
|
|
|
2025-11-23 23:09:30 +01:00
|
|
|
- **Code language:** All code, strings, comments in ENGLISH
|
|
|
|
|
- **Communication:** POLISH with developer
|
|
|
|
|
- **Git commits:** Standard format, NO AI mentions
|
|
|
|
|
- **Port:** 8080 (not 80)
|
|
|
|
|
- **Tailwind:** v3.4.0 (v4 has breaking changes)
|
2025-11-12 18:07:42 +01:00
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
2025-11-23 23:09:30 +01:00
|
|
|
## Key Constants
|
2025-11-14 17:55:29 +01:00
|
|
|
|
2025-11-23 23:09:30 +01:00
|
|
|
```javascript
|
|
|
|
|
// frontend/src/constants/ & backend/src/constants/
|
|
|
|
|
MATCH_STATUS: pending | accepted | rejected | completed
|
|
|
|
|
SUGGESTION_STATUS: pending | accepted | rejected | not_found
|
|
|
|
|
CONNECTION_STATE: disconnected | connecting | connected | failed
|
2025-11-29 23:39:44 +01:00
|
|
|
ACCOUNT_TIER: BASIC | SUPPORTER | COMFORT
|
|
|
|
|
|
|
|
|
|
// Tier fairness penalties
|
|
|
|
|
FAIRNESS_SUPPORTER_PENALTY: 10
|
|
|
|
|
FAIRNESS_COMFORT_PENALTY: 50
|
2025-11-23 23:09:30 +01:00
|
|
|
```
|
2025-11-12 18:07:42 +01:00
|
|
|
|
2025-11-14 17:55:29 +01:00
|
|
|
---
|
|
|
|
|
|
2025-11-23 23:09:30 +01:00
|
|
|
## Test Accounts (Seeded)
|
2025-11-12 18:07:42 +01:00
|
|
|
|
2025-11-23 23:09:30 +01:00
|
|
|
| Username | Email | Password |
|
|
|
|
|
|----------|-------|----------|
|
|
|
|
|
| john_dancer | john@example.com | Dance123! |
|
|
|
|
|
| sarah_swings | sarah@example.com | Swing456! |
|
|
|
|
|
| mike_blues | mike@example.com | Blues789! |
|
2025-11-12 18:07:42 +01:00
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
2025-11-23 23:09:30 +01:00
|
|
|
## For More Details
|
2025-11-12 18:07:42 +01:00
|
|
|
|
2025-11-23 23:09:30 +01:00
|
|
|
- `docs/TODO.md` - Security audit, future improvements
|
|
|
|
|
- `docs/ARCHITECTURE.md` - Technical implementation details
|
|
|
|
|
- `docs/archive/COMPLETED.md` - Full history of completed features
|
2025-11-12 18:07:42 +01:00
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
2025-11-29 23:39:44 +01:00
|
|
|
**Last Updated:** 2025-11-29
|