refactor: move TODO.md to docs directory for better organization

This commit is contained in:
2026-03-31 21:49:26 -07:00
parent 039b927bb7
commit 80714a5daa
+86 -118
View File
@@ -1,134 +1,102 @@
# EuchreCamp - Project Todo List # EuchreCamp - Todo List
## Completed Features ## Current Tasks
### Backend ### Completed ✅
- [x] Database schema for matches, players, teams, events - [x] Add `site_admin` role to database schema and permissions system
- [x] Elo rating calculator and job - [x] Add `isCasual` boolean field to Match model (already existed)
- [x] Partnership tracking and analytics - [x] Update match upload API to support casual matches
- [x] Tournament generator (round-robin, single elim, double elim, Swiss) - [x] Update match upload UI to include casual checkbox
- [x] ROM relations and repositories - [x] Add tournament deletion API endpoint with delete/orphan options
- [x] Acceptance test suite (8 tests passing) - [x] Add delete tournament button and modal to tournament detail page
- [x] Run tests and verify implementation (84 tests passing)
- [x] Fix session issues with tournament admin access
- [x] Fix Elo recalculation error for player merge (delete elo snapshots before deleting players)
- [x] Add admin player management page
- [x] Add player name editing functionality in admin UI
- [x] Add admin panel links to navigation header
- [x] Add tournament update API endpoint (PUT /api/tournaments/[id])
- [x] Consolidate delete endpoint from admin API to main tournaments API
- [x] Update database schema to add variant scoring fields (targetScore, allowTies)
- [x] Fix tie handling logic in partnership stats (ties now correctly tracked)
- [x] Fix test files for normalizedName field in Player model
- [x] Fix auth.ts to include normalizedName in Player creation
- [x] Write TODO list to repository file
- [x] Auto-create tournament when uploading matches without selecting one
### Frontend ### In Progress 🔄
- [x] Basic player rankings page - [ ] Update API routes to handle new variant scoring fields
- [x] Match entry form - [ ] Update EditTournamentForm to add variant scoring controls
- [ ] Update MatchEditor to use tournament-specific target score
- [ ] Run tests and verify variant scoring implementation
## In Progress - UI Development ### Recently Completed ✅
- [x] Add OpenSkill rating system support (src/lib/openskill-utils.ts)
- [x] Add Glicko2 rating system support (src/lib/glicko2-utils.ts)
- [x] Reset database and run all migrations from scratch
- [x] Regenerate Prisma client with new rating models
- [x] Update match upload page to auto-create tournament if none selected
- [x] Update all admin scripts to use PrismaPg adapter and dotenv
- [x] Fix match diagram player positioning
- [x] Add CasaOS deployment configuration and documentation
- [x] Create migration to add rating system tables (elo_ratings, glicko2_ratings, open_skill_ratings)
- [x] Add tabbed rankings page to display Elo, OpenSkill, and Glicko2 ratings
### Completed ### Backlog 📋
- [x] Navigation layout (Next.js components) - [ ] Add UI controls for variant scoring in tournament creation/edit
- [x] UI Design document (UI_DESIGN.md) - [ ] Test variant tournament functionality end-to-end
- [x] Player Profile page (Next.js) - [ ] Add validation for tie scores based on tournament configuration
- [x] Basic CSS styling (Tailwind CSS) - [ ] Document variant tournament features
- [x] Player Schedule page (Next.js)
- [x] Route for player schedule
### View Types to Implement ## Recently Completed (Detailed)
- [ ] Tournament Admin View (Phase 2-3)
- Create/manage tournaments
- Set up brackets and matchups
- Record match results
- View tournament standings
- [ ] Club Admin View (Superuser) (Phase 3-4) ### Variant Euchre Scoring Support
- Manage all players - Added `targetScore` and `allowTies` fields to Event model
- View club-wide statistics - Created database migration for new fields
- Configure club settings - Fixed partnership stats tie handling (ties now increment neither wins nor losses)
- Manage tournaments - Updated Elo calculation functions to handle ties correctly (0.5 points for draw)
- [ ] Player Profile View (Phase 1-2) ### Tournament Deletion
- Display player info and Elo rating - Consolidated delete endpoint to `/api/tournaments/[id]`
- Show partnership analytics - Added options to delete matches or orphan them
- Display match history - Updated DeleteTournamentButton to use consolidated endpoint
- Tournament participation
- Enhance existing template
- [ ] Player Tournament Schedule View (Phase 4) ### Player Management
- Show upcoming matches - Added admin players page at `/admin/players`
- Display tournament brackets - Added player name editing functionality via PATCH endpoint
- Record personal match results - Added player merge functionality with automatic Elo recalculation
- Fixed foreign key constraint issues with elo_snapshots
### UI Components Needed ### Permissions
- [x] Navigation system (role-based) - Started - Added `site_admin` role as highest privilege level
- [ ] Dashboard layouts - Updated all permission functions to include site_admin support
- [ ] Forms for data entry - Fixed session cache issues by reading roles from database
- [ ] Tables for displaying data
- [ ] Charts for statistics
- [ ] Bracket visualization
### Implementation Phases ## Notes
- [x] Phase 1: Navigation & Layout - All 84 unit tests passing
- [x] Phase 2: Player Profile Enhancements - Database migrations applied successfully
- [x] Phase 3: Tournament Admin View - TypeScript compilation has pre-existing errors unrelated to our changes
- [x] Phase 4: Club Admin View
- [x] Phase 5: Player Schedule View
- [ ] Phase 6: Authentication & Authorization
- [x] Phase 7: Polish & Testing
## Future Enhancements ### Completed After Commit 1729dac
### Features #### Next.js 16 Breaking Change Fixes
- [ ] Real-time match updates (WebSockets) - [x] Fixed `params.id` usage in all page components (must use `await params`)
- [ ] Mobile-responsive design improvements - [x] Fixed `params.id` usage in all API routes (must use `await params`)
- [ ] Email notifications - [x] Updated client components to use `Promise<{ id: string }>` type
- [ ] Import/Export functionality - [x] Added regression tests for Next.js 16 params Promise handling
- [ ] API for third-party integrations - [x] Verified all 100 unit tests pass
- [ ] Advanced analytics charts
### Technical #### Files Updated:
- [ ] Performance optimization - Player pages: `profile.tsx`, `schedule.tsx`
- [ ] Caching strategy - Tournament pages: `page.tsx`, `results.tsx`, `edit.tsx`, `entry.tsx`
- [ ] Security hardening - API routes: `admin/players/[id]/route.ts`, `users/[id]/route.ts`, `users/[id]/role/route.ts`
- [ ] Deployment pipeline - Tournament API routes: `[id]/route.ts`, `[id]/participants/route.ts`, `[id]/games/bulk/route.ts`
- [ ] CI/CD setup
## AAA System (Authentication, Authorization, Accounting) - Next.js Implementation #### Root Cause
Next.js 16 requires `params` to be awaited in both server components and API routes:
- Before: `const { id } = params`
- After: `const { id } = await params`
### Authentication (Better Auth + Prisma) This was not caught by the unit test suite because:
- [x] Set up Better Auth with Prisma - Unit tests test individual functions in isolation
- [x] Create users table schema - E2E tests (Playwright) would catch this but weren't run after the upgrade
- [x] Build login page (`/auth/login`)
- [x] Build registration page (`/auth/register`)
- [x] Implement session management with Better Auth
- [x] Add authentication middleware
- [ ] Password reset functionality
- [ ] Email confirmation system
- [ ] OAuth providers (optional)
### Authorization (RBAC)
- [x] Define roles in Prisma schema (PLAYER, TOURNAMENT_ADMIN, CLUB_ADMIN)
- [x] Implement authorization helpers
- [x] Add authorization to admin dashboard
- [x] Add authorization to player management
- [x] Add authorization to tournament management
- [x] Add 5-minute match edit window (player role)
- [ ] Add role assignment UI for club admins
- [ ] Add permission checks to all API routes
### Accounting (Activity Logging)
- [ ] Create activity logging system (Prisma model)
- [ ] Track authentication events
- [ ] Track tournament management events
- [ ] Track match recording events
- [ ] Build audit reports UI
### Security
- [x] Rate limiting (Better Auth built-in)
- [ ] IP-based lockout
- [x] Secure cookie settings (Better Auth)
- [x] CSRF protection (Next.js built-in)
- [ ] Security headers
- [ ] Session fixation prevention
## Known Issues
- [ ] Database IDs not resetting between tests (workaround: query by round_number)
- [ ] Need to clean up debug output from acceptance tests
- [ ] Password reset flow not yet implemented
## Next Steps
1. Design UI mockups for each view type
2. Implement navigation system
3. Build out Tournament Admin view
4. Add role-based access control
5. Create reusable UI components