Skip to content

Add demo seed data and API fallback for portfolio mode#27

Merged
grovecj merged 1 commit intomainfrom
feature/demo-seed-data
Feb 8, 2026
Merged

Add demo seed data and API fallback for portfolio mode#27
grovecj merged 1 commit intomainfrom
feature/demo-seed-data

Conversation

@grovecj
Copy link
Owner

@grovecj grovecj commented Feb 8, 2026

Summary

  • Seed script (migrations/seed.sql): 5 demo players at varied skill levels (Elite→Casual), full lifetime stats with mode breakdowns, and 125 matches with realistic placements/K-D/gulag results
  • DB fallback (internal/service/player.go): SearchPlayer and GetPlayerStats now fall back to the database when the CoD API is unavailable, serving seeded data transparently
  • Demo banner (web/src/App.vue): Dismissible warning alert explaining data is generated (persists per session via sessionStorage)
  • Demo player links (web/src/views/HomeView.vue): Clickable buttons on the home page for all 5 demo players so visitors know what to search

Context

The Activision stats API (papi-client) was fully shut down in April 2024. This change converts the app into a portfolio-ready demo that showcases the full stack without requiring a live API.

Test plan

  • Run psql $DATABASE_URL -f migrations/seed.sql to seed the database
  • go build ./... and go vet ./... pass
  • cd web && npm run build-only && npm run type-check pass
  • Click any demo player on HomeView — verify redirect to PlayerView with stats
  • Verify stats cards, charts, and match history table populate correctly
  • Verify the demo banner appears and can be dismissed
  • Search for a non-existent player — verify "Player not found" error

🤖 Generated with Claude Code

The Activision stats API was shut down in April 2024. This adds:
- SQL seed script with 5 demo players at varied skill levels (125 matches)
- DB fallback in PlayerService when the CoD API is unavailable
- Dismissible "Demo Mode" banner in the frontend
- Demo Players section on HomeView with clickable sample players

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@grovecj grovecj merged commit 8dc5229 into main Feb 8, 2026
2 checks passed
@grovecj grovecj deleted the feature/demo-seed-data branch February 8, 2026 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant