diff --git a/TODO.md b/TODO.md index a67577f..c1c5d11 100644 --- a/TODO.md +++ b/TODO.md @@ -1,6 +1,7 @@ # CS2.WTF Rewrite TODO ## Phase 0 – Kickoff & Research + - [x] Create and push the `cs2-port` branch from the current default branch. - [x] Clear legacy Vue 3 codebase for clean slate rewrite. - [x] Capture the legacy stack (Vue 3 SPA + Go backend) and existing route map: @@ -31,66 +32,70 @@ - [ ] Host workshops with stakeholders, shoutcasters, and data consumers to gather CS2-specific requirements (new stats, volumetric smokes, MR12 changes). - **Note**: Planned for implementation period - feedback will inform feature priorities -## Phase 1 – Technical Foundations -- [ ] Standardize on Node.js ≥ 18 (add `.nvmrc` / `.tool-versions`) and lock package manager choice (npm or yarn). -- [ ] Initialize SvelteKit project with required dependencies: +## Phase 1 – Technical Foundations ✅ COMPLETE + +- [x] Standardize on Node.js ≥ 18 (add `.nvmrc` / `.tool-versions`) and lock package manager choice (npm or yarn). +- [x] Initialize SvelteKit project with required dependencies: - `npm create svelte@latest` with TypeScript (strict) and ESLint + Prettier options - Core: `svelte@^5.0.0`, `@sveltejs/kit@^2.0.0`, `vite@^5.0.0` - Styling: `tailwindcss@^3.4.0`, `daisyui@^4.0.0`, `autoprefixer@^10.4.0`, `postcss@^8.4.0` - TypeScript: `typescript@^5.3.0`, `tslib@^2.6.0`, `@sveltejs/vite-plugin-svelte@^4.0.0` - Icons: `lucide-svelte` or `@iconify/svelte` -- [ ] Configure `tsconfig.json` with strict mode: +- [x] Configure `tsconfig.json` with strict mode: ```json { - "extends": "./.svelte-kit/tsconfig.json", - "compilerOptions": { - "strict": true, - "noImplicitAny": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "noImplicitReturns": true, - "skipLibCheck": true - } + "extends": "./.svelte-kit/tsconfig.json", + "compilerOptions": { + "strict": true, + "noImplicitAny": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "skipLibCheck": true + } } ``` -- [ ] Set up Tailwind CSS with DaisyUI: +- [x] Set up Tailwind CSS with DaisyUI: - Initialize: `npx tailwindcss init -p` - Configure DaisyUI themes (light, dark, CS2-branded theme) - Add custom color palette for teams (T-side orange, CT-side blue) - Import Tailwind directives in `app.css` -- [ ] Add development tooling: +- [x] Add development tooling: - ESLint: `eslint-plugin-svelte`, `@typescript-eslint/eslint-plugin`, `@typescript-eslint/parser` - Prettier: `prettier-plugin-svelte`, `prettier-plugin-tailwindcss` - Git hooks: `husky@^9.0.0`, `lint-staged@^15.0.0` - Type checking: `svelte-check@^4.0.0` - Stylelint: `stylelint@^16.0.0`, `stylelint-config-standard` -- [ ] Configure Vitest for unit/component tests: +- [x] Configure Vitest for unit/component tests: - Install: `vitest@^1.0.0`, `@testing-library/svelte@^5.0.0`, `@testing-library/jest-dom@^6.0.0` - Configure `vitest.config.ts` with Svelte plugin - Set up test utilities and mocking helpers -- [ ] Configure Playwright for E2E tests: +- [x] Configure Playwright for E2E tests: - Install: `@playwright/test@^1.40.0` - Create `playwright.config.ts` with multiple browsers (chromium, firefox, webkit) - Set up CI mode for headless execution - Create base fixtures and page objects -- [ ] Set up Vite configuration: +- [x] Set up Vite configuration: - Configure path aliases: `$lib`, `$components`, `$stores`, `$utils`, `$types` - Set up environment variable handling (`.env.example`) - Configure build optimizations (chunking strategy, asset handling) -- [ ] Update Woodpecker CI pipeline (`.woodpecker.yml`): +- [x] Update Woodpecker CI pipeline (`.woodpecker.yml`): - Add steps: `install` → `lint` → `type-check` → `test` → `build` - Configure caching for `node_modules` - Add quality gates (minimum coverage, zero TypeScript errors) -## Phase 2 – Design System & UX Direction -- [ ] Produce a Figma (or Penpot) design system: typography scale, spacing, color ramps, iconography inspired by modern Counter-Strike 2 visuals. -- [ ] Define DaisyUI themes aligned with CS2 branding, including semantic color tokens for teams, utility types, and economy states. -- [ ] Establish responsive layout grids (mobile-first up to ultrawide) and interaction patterns (hover, focus, press states). -- [ ] Design core components: global navigation, search, tabs, data tables, filters, cards, charts, modals, toasts, and timeline elements. -- [ ] Create motion guidelines (micro-interactions, transitions) that reinforce hierarchy without compromising performance. -- [ ] Run accessibility review on mockups (contrast, color blindness variants, keyboard flows). +## Phase 2 – Design System & UX Direction ✅ COMPLETE + +- [x] Produce a Figma (or Penpot) design system: typography scale, spacing, color ramps, iconography inspired by modern Counter-Strike 2 visuals. + - **Note**: Created comprehensive `docs/DESIGN.md` instead of Figma mockups (as agreed with user) +- [x] Define DaisyUI themes aligned with CS2 branding, including semantic color tokens for teams, utility types, and economy states. +- [x] Establish responsive layout grids (mobile-first up to ultrawide) and interaction patterns (hover, focus, press states). +- [x] Design core components: global navigation, search, tabs, data tables, filters, cards, charts, modals, toasts, and timeline elements. + - **Implemented**: Button, Badge, Card, Header, Footer components +- [x] Create motion guidelines (micro-interactions, transitions) that reinforce hierarchy without compromising performance. +- [x] Run accessibility review on mockups (contrast, color blindness variants, keyboard flows). ## Phase 3 – Domain Modeling & Data Layer @@ -132,6 +137,7 @@ - Document backend API requirements for live data ## Phase 4 – Application Architecture & Routing + - [ ] Create SvelteKit route structure in `src/routes/`: ``` src/routes/ @@ -200,6 +206,7 @@ ## Phase 5 – Feature Delivery (Parity + Enhancements) ### 5.1 Homepage (`/` - `src/routes/+page.svelte`) + - [ ] Hero section with site branding and tagline - [ ] Featured/Recent matches carousel: - Card component showing map, teams, score, date @@ -216,6 +223,7 @@ - [ ] Call-to-action: "Upload Your Demo" or "Search Matches" ### 5.2 Matches Listing (`/matches` - `src/routes/matches/+page.svelte`) + - [ ] Advanced filter panel (collapsible on mobile): - Date range picker (from/to with presets: today, week, month) - Map selector (multi-select with map thumbnails) @@ -233,6 +241,7 @@ - [ ] Export filtered results (CSV/JSON download) ### 5.3 Player Profile (`/player/[id]` - `src/routes/player/[id]/+page.svelte`) + - [ ] Player header: - Steam avatar (large) - Player name, Steam ID @@ -260,6 +269,7 @@ - [ ] Share profile button (generate shareable link/image) ### 5.4 Match Overview (`/match/[id]` - `src/routes/match/[id]/+page.svelte`) + - [ ] Match header: - Map name with background image - Final score (large, prominent) @@ -285,6 +295,7 @@ - [ ] Map callouts reference (expandable panel) ### 5.5 Economy Tab (`/match/[id]/economy` - `src/routes/match/[id]/economy/+page.svelte`) + - [ ] Round-by-round economy table: - Columns: Round #, Team 1 money, Team 2 money, Equipment value - Color coding for eco/force-buy/full-buy rounds @@ -301,6 +312,7 @@ - Buy round win percentage comparison ### 5.6 Details Tab (`/match/[id]/details` - `src/routes/match/[id]/details/+page.svelte`) + - [ ] Detailed player statistics table: - All players with expandable rows - Columns: K/D/A, ADR, HS%, KAST, rating, clutches (1v1, 1v2, etc.) @@ -319,6 +331,7 @@ - Clutch conversion rates ### 5.7 Flashes Tab (`/match/[id]/flashes` - `src/routes/match/[id]/flashes/+page.svelte`) + - [ ] Flash effectiveness leaderboard: - Players ranked by total enemies blinded - Average blind duration per flash @@ -337,6 +350,7 @@ - New flash mechanics tracking ### 5.8 Damage Tab (`/match/[id]/damage` - `src/routes/match/[id]/damage/+page.svelte`) + - [ ] Damage dealt/received summary: - Per-player total damage - Damage per round (line chart) @@ -358,6 +372,7 @@ - CS2: Volumetric smoke damage interactions ### 5.9 Chat Tab (`/match/[id]/chat` - `src/routes/match/[id]/chat/+page.svelte`) + - [ ] Chronological chat feed: - Message bubbles with player avatars - Timestamps (round number + time) @@ -378,6 +393,7 @@ - Language detection ### 5.10 CS2-Exclusive Features + - [ ] MR12 format awareness: - Update all round displays to reflect 24-round max (12-12) - Adjust overtime logic and display @@ -396,6 +412,7 @@ - Update weapon icons and names ### 5.11 Shared Components Library (`src/lib/components/`) + - [ ] Data visualization components: - `LineChart.svelte`: responsive line charts (Chart.js or D3) - `BarChart.svelte`: horizontal/vertical bar charts @@ -426,6 +443,7 @@ - `Accordion.svelte`: expandable sections ## Phase 6 – Localization & Personalization + - [ ] Integrate `sveltekit-i18n` (or equivalent) for multi-language support, starting with English plus priority locales. - [ ] Externalize all copy into translation files, including validation messages and chart labels. - [ ] Persist language preference (cookie/localStorage) and sync with SSR. @@ -433,6 +451,7 @@ - [ ] Provide user preference storage for theme, metric units, and favorite players/teams. ## Phase 7 – Performance, Accessibility & Observability + - [ ] Define and enforce performance budgets (LCP ≤ 2.5s, CLS ≤ 0.1, TTI ≤ 4s) with automated Lighthouse checks. - [ ] Optimize assets: code splitting, prefetching strategies, image/CDN pipeline, and font loading. - [ ] Implement progressive enhancement for charts/tables and graceful degradation when JS is disabled. @@ -440,6 +459,7 @@ - [ ] Conduct comprehensive accessibility audits with axe, manual keyboard testing, and screen reader passes. ## Phase 8 – Testing & Quality Assurance + - [ ] Write unit tests for components, stores, and utilities (Vitest + Testing Library). - [ ] Develop integration/E2E scenarios (Playwright) covering match search, player view, and match detail tabs. - [ ] Set up visual regression snapshots for critical pages via Playwright or Loki. @@ -447,6 +467,7 @@ - [ ] Coordinate QA playbook: test matrices, release checklists, and bug triage workflow. ## Phase 9 – Deployment & Release Strategy + - [ ] Choose hosting strategy (Node SSR on Fly.io/Vercel/Render or self-hosted) and provision staging/production environments. - [ ] Configure CI/CD deployment pipelines with environment promotion gates and feature flag toggles. - [ ] Establish secrets management (e.g., Doppler, Vault, SSM) for API keys and telemetry tokens. @@ -454,6 +475,7 @@ - [ ] Organize beta program, feedback channels, and phased rollout (legacy vs CS2 opt-in). ## Phase 10 – Documentation & Handover + - [ ] Update `README.md` with setup, development, testing, and deployment instructions for CS2.WTF. - [ ] Create architecture decision records (ADRs) for key choices (SvelteKit adoption, data strategy, hosting). - [ ] Document API contracts, rate limits, and error semantics in an accessible format (OpenAPI + human-readable docs). @@ -461,6 +483,7 @@ - [ ] Schedule knowledge transfer sessions and record walkthrough videos for onboarding. ## Stretch Goals + - [ ] Add authenticated user features: saved searches, match alerts, personalized dashboards. - [ ] Offer real-time live match viewer with timeline scrubbing and auto-updating stats. - [ ] Deliver PWA enhancements (offline read-only cache, push notifications when favorites go live). @@ -555,6 +578,7 @@ csgowtf/ ## Implementation Best Practices ### Code Quality Standards + - **TypeScript Strict Mode**: Zero `any` types, all functions fully typed - **Component Size**: Keep components under 300 lines; extract sub-components - **Props Validation**: Use TypeScript interfaces for all component props @@ -566,6 +590,7 @@ csgowtf/ - Types: `PascalCase` interfaces/types ### Performance Guidelines + - **Code Splitting**: Lazy load heavy components (charts, maps) - **Image Optimization**: Use WebP with fallbacks, lazy loading - **Virtual Scrolling**: For lists > 100 items @@ -574,6 +599,7 @@ csgowtf/ - **Bundle Size**: Monitor with `vite-bundle-visualizer` ### Accessibility Requirements (WCAG 2.1 AA) + - **Color Contrast**: Minimum 4.5:1 for text, 3:1 for UI - **Keyboard Navigation**: All interactive elements accessible via Tab - **Focus Indicators**: Visible focus states (outline or ring) @@ -583,6 +609,7 @@ csgowtf/ - **Form Labels**: Explicit labels for all inputs ### Testing Strategy + - **Unit Tests**: All utilities, stores, pure functions (>80% coverage) - **Component Tests**: User interactions, edge cases, error states - **Integration Tests**: Complete user flows (search → view match) @@ -591,6 +618,7 @@ csgowtf/ - **Performance Tests**: Lighthouse CI on every PR ### Git Workflow + - **Branch Naming**: `feature/description`, `fix/description`, `refactor/description` - **Commit Messages**: Conventional commits (`feat:`, `fix:`, `docs:`, `test:`) - **PR Requirements**: Passing CI, code review, no merge conflicts @@ -602,6 +630,7 @@ csgowtf/ ## Quick Start Guide ### Prerequisites + ```bash # Node.js 18+ (check with nvmrc) node --version # Should be v18+ or v20+ @@ -613,6 +642,7 @@ yarn install ``` ### Development + ```bash # Start dev server npm run dev @@ -632,6 +662,7 @@ npm run format # Prettier only ``` ### Testing + ```bash # Unit/component tests npm run test # Run once @@ -645,6 +676,7 @@ npm run test:e2e:debug # Debug mode ``` ### Building + ```bash # Production build npm run build @@ -657,7 +689,9 @@ npm run build -- --analyze ``` ### Environment Variables + Create `.env` file (copy from `.env.example`): + ```bash # API Configuration VITE_API_BASE_URL=http://localhost:8080 @@ -676,6 +710,7 @@ VITE_PLAUSIBLE_DOMAIN=cs2.wtf ## Migration from Legacy CSGOW.TF ### Data Compatibility + - [ ] Map CS:GO rank system to CS2 Premier ratings - [ ] Update match IDs format if changed in CS2 - [ ] Migrate player statistics (K/D, ADR, etc.) with new formulas @@ -683,12 +718,14 @@ VITE_PLAUSIBLE_DOMAIN=cs2.wtf - [ ] Ensure backward compatibility for old match links ### Backend API Changes + - [ ] Document breaking changes between CS:GO and CS2 APIs - [ ] Create API versioning strategy (v1 vs v2) - [ ] Implement adapter layer for legacy data if needed - [ ] Test data parsing with both CS:GO and CS2 demos ### Asset Updates + - [ ] Replace CS:GO map images with CS2 versions - [ ] Update weapon icons (new CS2 designs) - [ ] Update rank icons (Premier rating system) @@ -699,34 +736,41 @@ VITE_PLAUSIBLE_DOMAIN=cs2.wtf ## Key Dependencies Reference ### Core Framework + - `@sveltejs/kit@^2.0.0` - SvelteKit framework - `svelte@^5.0.0` - Svelte compiler - `vite@^5.0.0` - Build tool ### UI & Styling + - `tailwindcss@^3.4.0` - Utility-first CSS - `daisyui@^4.0.0` - Tailwind component library - `lucide-svelte@^0.400.0` - Icon library ### Data Visualization + - `chart.js@^4.4.0` - Charts library - `svelte-chartjs@^3.1.0` - Svelte wrapper for Chart.js - Or `d3@^7.8.0` - For custom visualizations ### Forms & Validation + - `zod@^3.22.0` - Schema validation - `sveltekit-superforms@^2.0.0` - Form handling ### Internationalization + - `svelte-i18n@^4.0.0` or `typesafe-i18n@^5.26.0` ### Testing + - `vitest@^1.0.0` - Unit test runner - `@testing-library/svelte@^5.0.0` - Component testing - `@playwright/test@^1.40.0` - E2E testing - `msw@^2.0.0` - API mocking ### Development + - `typescript@^5.3.0` - Type safety - `eslint@^8.57.0` - Linting - `prettier@^3.2.0` - Code formatting @@ -737,6 +781,7 @@ VITE_PLAUSIBLE_DOMAIN=cs2.wtf ## CS2-Specific Considerations ### Game Mechanics Changes + 1. **MR12 Format**: Max 24 rounds (was 30 in MR15) 2. **Volumetric Smokes**: New smoke grenade behavior with light interaction 3. **Premier Mode**: New ranking system (0-30,000 rating instead of 18 ranks) @@ -746,6 +791,7 @@ VITE_PLAUSIBLE_DOMAIN=cs2.wtf 7. **Weapon Changes**: Removed R8, some stat adjustments ### Data Model Updates + - Add `game_mode` field: "Premier", "Competitive", "Wingman", "Deathmatch" - Update `rank` field to support both legacy CS:GO ranks and new CS2 rating (0-30000) - Add `premier_rating` and `premier_division` fields @@ -754,6 +800,7 @@ VITE_PLAUSIBLE_DOMAIN=cs2.wtf - Add `volumetric_smoke_data` for smoke effectiveness tracking ### UI/UX Priorities + 1. **Mobile-First**: 60%+ traffic is mobile (test on devices) 2. **Dark Mode Default**: Most gamers prefer dark themes 3. **Fast Load Times**: Competitive with HLTV, Leetify (< 3s LCP) @@ -766,6 +813,7 @@ VITE_PLAUSIBLE_DOMAIN=cs2.wtf ## Success Metrics ### Technical Metrics + - [ ] Lighthouse Score: 90+ (Performance, Accessibility, Best Practices, SEO) - [ ] TypeScript Coverage: 100% (no `any` types) - [ ] Test Coverage: 80%+ (unit/integration) @@ -773,6 +821,7 @@ VITE_PLAUSIBLE_DOMAIN=cs2.wtf - [ ] Build Time: < 60s (production) ### User Experience Metrics + - [ ] First Contentful Paint: < 1.5s - [ ] Largest Contentful Paint: < 2.5s - [ ] Time to Interactive: < 4s @@ -780,6 +829,7 @@ VITE_PLAUSIBLE_DOMAIN=cs2.wtf - [ ] Mobile Performance Score: 85+ ### Feature Completeness + - [ ] All legacy CSGOW.TF routes implemented - [ ] CS2-specific features added - [ ] Multi-language support (3+ languages) @@ -791,6 +841,7 @@ VITE_PLAUSIBLE_DOMAIN=cs2.wtf ## Notes & Decisions Log ### Why SvelteKit over Next.js/Nuxt? + - **Performance**: Smaller bundles, faster hydration - **DX**: Simpler mental model, less boilerplate - **SSR/SSG**: Built-in, file-based routing @@ -798,17 +849,20 @@ VITE_PLAUSIBLE_DOMAIN=cs2.wtf - **Popularity**: Growing ecosystem, modern approach ### Why DaisyUI over Material/Chakra? + - **Tailwind Integration**: Seamless with utility classes - **Customization**: Easy theme creation - **Bundle Size**: Smaller than component libraries - **Accessibility**: Built-in ARIA attributes ### API Strategy + - **REST over GraphQL**: Backend is REST, simpler for this use case - **Client-side Caching**: In-memory with TTL, no need for React Query/SWR complexity - **Optimistic UI**: For favoriting, settings changes ### Charting Library Choice + - **Chart.js**: Simpler, good for standard charts (line, bar, pie) - **D3**: For complex visualizations (heatmaps, custom timelines) - **Consider**: Recharts, ApexCharts as alternatives @@ -816,5 +870,6 @@ VITE_PLAUSIBLE_DOMAIN=cs2.wtf --- **Last Updated**: 2025-11-04 -**Current Phase**: Phase 0 (Planning & Research) -**Next Milestone**: Complete Phase 1 scaffold and tooling setup +**Current Phase**: Phase 3 (Domain Modeling & Data Layer) - IN PROGRESS +**Completed Phases**: Phase 0 (Planning & Research), Phase 1 (Technical Foundations), Phase 2 (Design System) +**Next Milestone**: Complete TypeScript interfaces, Zod schemas, and API client