Files
nuzlocke-tracker/.beans/nuzlocke-tracker-d98o--user-account-integration.md
Julian Tabel c9d42b091f
All checks were successful
CI / backend-tests (push) Successful in 26s
CI / frontend-tests (push) Successful in 29s
Daedalus and Talos integration test
2026-03-20 16:31:19 +01:00

93 lines
3.3 KiB
Markdown

---
# nuzlocke-tracker-d98o
title: User Account integration
status: todo
type: epic
priority: normal
created_at: 2026-02-04T16:17:01Z
updated_at: 2026-03-20T15:28:45Z
blocking:
- nuzlocke-tracker-0jec
---
Enable user accounts so players can track multiple Nuzlocke runs, access them from any device, and view detailed statistics across all their playthroughs.
## Goals
- Users can create accounts and log in securely
- Support social login providers for frictionless onboarding
- Each user can have multiple runs (no longer single-user assumption)
- Provide an overview dashboard of all runs
- Provide detailed statistics aggregated across all runs
## Features
### Authentication
- [ ] Email/password registration and login
- [ ] Social login with Google
- [ ] Social login with Apple
- [ ] Password reset flow via email
- [ ] Session management (remember me, logout)
- [ ] Secure token handling (JWT or session-based)
### User Profile
- [ ] Basic profile info (display name, avatar)
- [ ] Account settings page
- [ ] Delete account option (with data export)
### Multi-Run Support
- [ ] Associate runs with user accounts
- [ ] Users can have unlimited runs
- [ ] Migrate any existing local/anonymous runs to account
- [ ] Run visibility settings (private by default)
### Runs Overview Page
- [ ] Dashboard showing all user's runs
- [ ] Display per run: game, start date, status (active/completed/abandoned), team snapshot
- [ ] Filter/sort runs by game, status, date
- [ ] Quick actions: continue run, view details, archive
- [ ] Visual indicator for currently active run(s)
- [ ] Create new run button
### Detailed Stats Page
- [ ] Aggregate statistics across all runs:
- [ ] Total runs started / completed / abandoned
- [ ] Total Pokémon caught / lost
- [ ] Favorite games (most runs)
- [ ] Average run completion rate
- [ ] Longest surviving Pokémon across runs
- [ ] Most common cause of death
- [ ] Per-game statistics breakdown
- [ ] Historical timeline of runs
- [ ] Achievements/milestones (e.g., "Completed 5 runs", "No deaths in a run")
## Technical Considerations
- Backend: Add user model, auth middleware, update all run endpoints
- Frontend: Auth context/provider, protected routes, login/register forms
- Database: Users table, user_id foreign key on runs
- Consider OAuth libraries (e.g., Authlib for Python, or Auth0/Firebase Auth)
- GDPR considerations for EU users (data export, deletion)
## Dependencies
- Requires MVP core features to be functional first
- API endpoints need user-scoping
- Database schema needs user table and migrations
## Out of Scope (for now)
- Social features (sharing runs, leaderboards)
- Team collaboration
- Public run profiles
## Decisions (resolved 2026-03-20)
- **Auth provider:** Supabase Auth (third-party, self-hostable, AWS-compatible)
- **Social login:** Google + Discord
- **Run migration:** Existing runs stay unowned, admin assigns manually post-signup
- **Auth scope:** Write operations require auth; per-run public/private visibility toggle
- **Editor for journal (related):** Plain markdown
## Execution Order
1. `nuzlocke-tracker-2561` — Supabase project setup (unblocked)
2. `nuzlocke-tracker-b311` + `nuzlocke-tracker-bnhh` + `nuzlocke-tracker-l9xh` — Backend auth, user model, frontend auth (parallel, after setup)
3. `nuzlocke-tracker-k1l1` — Run ownership + visibility (after all above)