docs: streamline README and update SESSION_CONTEXT, archive outdated docs

- Streamline README.md from 645 to 365 lines (43% reduction)
- Remove duplicate content with other documentation files
- Focus README on quick start, features overview, and links to detailed docs
- Update SESSION_CONTEXT.md with recent changes (342/342 tests, matching runs audit)
- Archive outdated documentation:
  - CONTEXT.md (duplicated in README)
  - QUICKSTART.md (mentions mock auth, outdated)
  - QUICK_TEST.md (outdated)
- Keep SESSION_CONTEXT.md active for context restoration
This commit is contained in:
Radosław Gierwiało
2025-11-30 20:17:27 +01:00
parent 9af4447e1d
commit 913d685721
5 changed files with 370 additions and 567 deletions

View File

@@ -15,9 +15,9 @@
## Current Status
**Phase:** MVP Complete - Ready for Production Deployment
**Tests:** 285/286 backend tests passing - 99.7% (73% coverage)
**Next Goal:** Infrastructure setup (server, domain, SSL)
**Phase:** MVP Complete - Production Ready
**Tests:** 342/342 backend tests passing - 100% ✅ (72.5% coverage)
**Recent Work:** Matching runs audit, ratings & stats system, comprehensive test suite
### Core Features (All Implemented)
- JWT authentication with email verification (AWS SES)
@@ -27,6 +27,10 @@
- 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)
- Matching runs audit with origin_run_id tracking
- Incremental matching (preserves accepted/completed suggestions)
- Scheduler integration (automated matching with cron)
- Atomic stats updates with race condition prevention
- Clickable usernames with @ prefix, country flags
- Matches & ratings API
- QR code event check-in
@@ -49,16 +53,26 @@
│ ├── hooks/ # useWebRTC.js
│ └── constants/ # MATCH_STATUS, SUGGESTION_STATUS, etc.
├── backend/src/
│ ├── routes/ # API endpoints
│ ├── routes/ # API endpoints (events.js, matches.js, admin.js)
│ ├── controllers/ # Business logic
│ ├── services/ # matching.js (auto-matching algorithm)
│ ├── socket/ # Socket.IO handlers
│ ├── constants/ # Status constants
│ └── __tests__/ # Jest tests
│ └── __tests__/ # Jest tests (342 tests - 100% passing)
│ ├── matching-algorithm.test.js # 19 tests
│ ├── ratings-stats-flow.test.js # 9 tests
│ ├── matching-runs-audit.test.js # 6 tests
│ ├── matching-incremental.test.js # 5 tests
│ └── socket.test.js # 12 tests
└── docs/
├── TODO.md # Current tasks & security audit
├── SESSION_CONTEXT.md # This file - quick context
├── TODO.md # Current tasks & roadmap
├── ARCHITECTURE.md # Technical details
── archive/COMPLETED.md # Historical reference
── DEPLOYMENT.md # Deployment guide
├── MONITORING.md # Operations guide
├── TESTING_MATCHING_RATINGS.md # Comprehensive test documentation (45 tests)
├── WEBRTC_TESTING_GUIDE.md # WebRTC testing guide
└── archive/ # Archived documentation
```
---
@@ -72,21 +86,58 @@ Key models:
- `event_participants` - User-event relationship, competitorNumber, recorderOptOut, `accountTierOverride`
- `divisions` / `competition_types` / `event_user_heats` - Competition system
- `matches` - User pairings with CUID slugs
- `ratings` - 1-5 stars, comments
- `recording_suggestions` - Auto-matching results with collision detection
- `ratings` - 1-5 stars, comments, `statsApplied` flag
- `recording_suggestions` - Auto-matching results with collision detection, `originRunId` tracking
- `matching_runs` - Audit trail (manual/scheduler, status, stats)
- `chat_rooms` / `messages` - Real-time chat persistence
---
## Recent Changes (Last 2 Days)
### Matching Runs Audit System
- **File:** `backend/src/__tests__/matching-runs-audit.test.js` (6 tests)
- **Features:**
- origin_run_id assignment and tracking
- Sequential runs create separate audit records
- Accepted suggestions preserve origin_run_id across re-runs
- Admin endpoints with filtering (onlyAssigned, includeNotFound)
- Manual vs scheduler trigger differentiation
### Ratings & Stats Integration
- **File:** `backend/src/__tests__/ratings-stats-flow.test.js` (9 tests)
- **Features:**
- Atomic stats updates (recordingsDone, recordingsReceived)
- Race condition prevention with `statsApplied` flag
- Source filtering (only auto matches update stats)
- Idempotency (double-rating prevention)
- E2E double-rating completion flow
### Documentation
- **Updated:** README.md with current test statistics (342/342)
- **New:** docs/TESTING_MATCHING_RATINGS.md (comprehensive 45-test overview)
- **Archived:** Outdated quick start guides
---
## Quick Commands
```bash
# Start development
docker compose up --build
docker compose --profile dev up
# Run backend tests
# Run all backend tests
docker compose exec backend npm test
# Run specific test suite
docker compose exec backend npm test -- matching-runs-audit.test.js
# Coverage report
docker compose exec backend npm run test:coverage
# Admin CLI
docker compose exec backend npm run cli -- users:list --limit 20
# Access
# Frontend: http://localhost:8080
# API: http://localhost:8080/api
@@ -117,6 +168,11 @@ ACCOUNT_TIER: BASIC | SUPPORTER | COMFORT
// Tier fairness penalties
FAIRNESS_SUPPORTER_PENALTY: 10
FAIRNESS_COMFORT_PENALTY: 50
// Matching config
MAX_RECORDINGS_PER_PERSON: 3
PREP_BUFFER_MINUTES: 30
REST_BUFFER_MINUTES: 60
```
---
@@ -131,12 +187,38 @@ FAIRNESS_COMFORT_PENALTY: 50
---
## Test Coverage Summary
**Total:** 342/342 tests passing (100% ✅)
- **Matching Algorithm:** 19 tests (TC1-TC19)
- Fundamentals, collision detection, limits, fairness, edge cases
- **Ratings & Stats:** 9 tests
- Atomic updates, race prevention, idempotency
- **Matching Runs Audit:** 6 tests
- origin_run_id tracking, sequential runs, filtering
- **Incremental Matching:** 5 tests
- **Recording Stats Integration:** 6 tests
- **WebRTC Signaling:** 12 tests
- **Socket.IO:** 12 tests
- **API Routes:** Full CRUD coverage (auth, events, matches, dashboard)
**Code Coverage:**
- matching.js: 94.71% statements, 91.5% branches
- routes/matches.js: 76.11% statements
- routes/events.js: 78.2% statements
---
## For More Details
- `docs/TODO.md` - Security audit, future improvements
- `docs/TODO.md` - Active tasks, security audit, future improvements
- `docs/ARCHITECTURE.md` - Technical implementation details
- `docs/TESTING_MATCHING_RATINGS.md` - Comprehensive test documentation
- `docs/DEPLOYMENT.md` - Production deployment guide
- `docs/MONITORING.md` - Operations and monitoring
- `docs/archive/COMPLETED.md` - Full history of completed features
---
**Last Updated:** 2025-11-29
**Last Updated:** 2025-11-30