Commit 8dc5229
Add demo seed data and API fallback for portfolio mode (#27)
## 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](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 5f3a12e commit 8dc5229
4 files changed
Lines changed: 481 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
42 | | - | |
| 43 | + | |
| 44 | + | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
| |||
64 | 66 | | |
65 | 67 | | |
66 | 68 | | |
| 69 | + | |
67 | 70 | | |
68 | 71 | | |
69 | 72 | | |
| |||
74 | 77 | | |
75 | 78 | | |
76 | 79 | | |
77 | | - | |
| 80 | + | |
| 81 | + | |
78 | 82 | | |
79 | 83 | | |
80 | 84 | | |
| |||
92 | 96 | | |
93 | 97 | | |
94 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
0 commit comments