Skip to content

Commit 308d7fc

Browse files
authored
Merge pull request #151 from Pyronewbic/dev
deps: bump 6 packages, fix protobufjs/qs vulns; docs for v1.5.0
2 parents 46ff2d4 + fb1539d commit 308d7fc

7 files changed

Lines changed: 130 additions & 108 deletions

File tree

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Changelog
22

3+
## 1.5.0 (2026-05-25)
4+
5+
- Admin panel: tabbed layout (Keys / Analytics / Errors / Funnel)
6+
- Analytics dashboard: daily volume chart, by-tier/by-path bars, top queries, avg latency
7+
- Error monitoring: type filter dropdown, 30-day TTL on error-logs, process-level handlers (unhandledRejection, uncaughtException)
8+
- User funnel tracking: signup/firstSearch/firstGrade/firstPortfolioAdd milestones, GET /api/funnel
9+
- Set browser: language filter (?lang=en|jp), 353 sets (up from 238)
10+
- Card database: on-demand sync (POST /api/card-database/sync), no more TTL-based refresh on cold start
11+
- PokeWallet integration: JP card rarity enrichment (SAR/IR/UR/HR/SR/RR/AR/ACE/CR)
12+
- Card ID normalization: deduplicate EN/JA zero-padded IDs for older sets (neo, base)
13+
- Cold start fix: card DB + set metadata fully loaded before accepting connections
14+
- 488 tests (313 unit, 104 API, 71 smoke)
15+
316
## 1.4.0 (2026-05-20)
417

518
- SBOM attestation: Syft SPDX generated from built container image, cosign-attested to digest

README.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# <img src="logos/casecomp-logo.svg" width="32" height="32" alt="Casecomp logo" /> Casecomp
22

3-
[![Version](https://img.shields.io/badge/version-1.4.0-d9b676)](CHANGELOG.md)
3+
[![Version](https://img.shields.io/badge/version-1.5.0-d9b676)](CHANGELOG.md)
44
[![CI](https://github.com/Pyronewbic/casecomp/actions/workflows/ci.yml/badge.svg)](https://github.com/Pyronewbic/casecomp/actions/workflows/ci.yml)
55
[![Deploy](https://github.com/Pyronewbic/casecomp/actions/workflows/deploy.yml/badge.svg)](https://github.com/Pyronewbic/casecomp/actions/workflows/deploy.yml)
66
[![License](https://img.shields.io/badge/license-MIT-blue)](LICENSE)
@@ -26,8 +26,8 @@ Search any Pokemon card across four marketplaces in one query. Get live prices,
2626
- **PSA grading signals** - population data, difficulty, gem 10%, recommended submission tier
2727
- **Slab comparison** - compare PSA 10 / BGS 9.5 / TAG 10 prices across sources
2828
- **Portfolio** - track cards, ROI, value over time, grading opportunities
29-
- **Admin** - API key management, stats KPIs, error log at `/admin`
30-
- **Set browser** - browse 238 sets with logos, rarity filters, collection tracking (owned/missing)
29+
- **Admin** - API key management, analytics dashboard, error monitoring with type filters, user funnel tracking at `/admin`
30+
- **Set browser** - browse 353 sets with logos, rarity filters, language filter (EN/JP), collection tracking (owned/missing)
3131
- **REST API** - authenticated endpoints with rate limiting, per-key caching, OpenAPI spec
3232
- **Claude Code skill** - `/casecomp` for plain-English card search
3333
- **Chrome extension** - queue auto-join for Pokemon Center, Walmart, Costco, Target drops
@@ -84,7 +84,8 @@ Full reference: [api.casecomp.xyz/docs](https://api.casecomp.xyz/docs)
8484

8585
```bash
8686
# ── Public (no key) ──────────────────────────────────────────
87-
curl "https://api.casecomp.xyz/api/sets" # browse 238 sets
87+
curl "https://api.casecomp.xyz/api/sets" # browse 353 sets
88+
curl "https://api.casecomp.xyz/api/sets?lang=en" # EN sets only
8889
curl "https://api.casecomp.xyz/api/sets/sv06" # cards in a set
8990
curl "https://api.casecomp.xyz/api/autocomplete?q=umbreon" # card search (29K cards)
9091
curl "https://api.casecomp.xyz/api/health" # service status
@@ -117,7 +118,7 @@ curl -X POST -H "Authorization: Bearer $CASECOMP_KEY" \
117118

118119
### Public endpoints (no key)
119120

120-
`GET /api/health` | `GET /api/demo` | `GET /api/sitemap` | `GET /api/autocomplete` | `GET /api/sets` | `GET /api/sets/:setCode` | `GET /docs` | `GET /docs/spec.json` | `?demo=true` (sample data) on search/sold/arbitrage/price-history
121+
`GET /api/health` | `GET /api/demo` | `GET /api/sitemap` | `GET /api/autocomplete` | `GET /api/sets` | `GET /api/sets/:setCode` | `GET /api/funnel` | `GET /docs` | `GET /docs/spec.json` | `?demo=true` (sample data) on search/sold/arbitrage/price-history
121122

122123
## Security
123124

@@ -199,7 +200,9 @@ All caches use Firestore (shared across Cloud Run instances, persists across dep
199200
| `cache-ebay-sold` | 24 hours | eBay sold comp results |
200201
| `price-history` | permanent | Sold comp prices over time |
201202
| `api-keys` | permanent | Developer API keys (hashed) |
202-
| `error-logs` | permanent | API errors with request IDs |
203+
| `error-logs` | 30 days (TTL) | API errors with request IDs |
204+
| `card-database-cache` | permanent (on-demand sync) | TCGdex card index (~29K cards) |
205+
| `user-milestones` | permanent | User funnel milestones (signup, first search, etc.) |
203206

204207
## Infrastructure
205208

@@ -213,12 +216,12 @@ Load unpacked from `extension/` in `chrome://extensions`.
213216

214217
## Tests
215218

216-
486 tests across three layers. CI required checks: unit + codeql. Smoke is non-blocking.
219+
488 tests across three layers. CI required checks: unit + codeql. Smoke is non-blocking.
217220

218221
| Suite | Count | Command | Covers |
219222
|-------|------:|---------|--------|
220-
| **Unit** | 312 | `yarn test:unit` | Filters, grading, query builder, card identity, condition detection, image preprocessing, email alerts, portfolio ROI, CSV export, autocomplete, JWT auth, price trends, RASP detection |
221-
| **API** | 103 | `yarn test:api` | Search, sold, PSA, grade, auth, admin keys, arbitrage, price history, alerts, share pages, portfolio CRUD, card view, upload-url, analytics, collection tracking |
223+
| **Unit** | 313 | `yarn test:unit` | Filters, grading, query builder, card identity, condition detection, image preprocessing, email alerts, portfolio ROI, CSV export, autocomplete, JWT auth, price trends, RASP detection |
224+
| **API** | 104 | `yarn test:api` | Search, sold, PSA, grade, auth, admin keys, arbitrage, price history, alerts, share pages, portfolio CRUD, card view, upload-url, analytics, collection tracking, lang filter, card-database sync |
222225
| **Smoke** | 71 | `yarn test:smoke` | API root page, detail panel, tabs, PSA stats, arbitrage, mobile viewport, portfolio, autocomplete, search filters |
223226

224227
## Contributing

docs/env-vars.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ Copy **`.env.example`** to **`.env`** and fill in the required values.
5656
| `GOOGLE_OAUTH_CLIENT_ID` | *(none)* | Google OAuth client ID for sign-in (popup flow) |
5757
| `TOGETHER_API_KEY` | *(none)* | Together AI key for card detection (GLM-4.6V, falls back to Claude Sonnet) |
5858
| `RASP_MODE` | `monitor` | RASP enforcement mode: `monitor` (log only) or `block` (reject malicious requests) |
59+
| `POKEWALLET_API_KEY` | *(none)* | PokeWallet API key for JP card rarity data (free tier: 100 req/hr, 1K/day) |
5960

6061
## Email notifications
6162

docs/internals.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ lib/
2323
auth.js Google OAuth token verification, JWT (HS256)
2424
api-keys.js Developer key management
2525
cards/
26-
card-database.js TCGdex card DB (29K EN+JP cards), set browser, rarity
26+
card-database.js TCGdex card DB (29K EN+JP cards), set browser, rarity, PokeWallet JP enrichment
2727
card-identity.js Canonical IDs, set resolution, SET_TOTAL_MAP
2828
demo.js Sample data (3 multi-source cards)
2929
grading-dataset.js ML slab image collection from sold listings (eBay, magi, search)
@@ -50,8 +50,8 @@ public/admin/ Admin panel (keys, stats, errors)
5050
extension/ Chrome extension: queue auto-join, drop intel
5151
terraform/ GCP infra (Cloud Run, Firestore, LB, CDN, Scheduler)
5252
test/
53-
unit-test.js 312 unit tests
54-
api-test.js 103 API integration tests
53+
unit-test.js 313 unit tests
54+
api-test.js 104 API integration tests
5555
smoke-test.js 71 Playwright UI smoke tests
5656
```
5757

@@ -66,7 +66,7 @@ test/
6666
- **Dashboard**: static files from `public/` served at `/` and `/admin`.
6767
- **Docs**: Swagger UI at `/docs`, spec at `/docs/spec.json`.
6868

69-
On startup: eBay OAuth token pre-fetched, TCGdex card database loaded from Firestore cache (24h TTL), set names + logos loaded in parallel.
69+
On startup: eBay OAuth token pre-fetched, TCGdex card database loaded from Firestore cache (no TTL, on-demand sync via `POST /api/card-database/sync`), set metadata (names + logos) loaded in parallel. Server waits for card DB and set metadata before accepting connections.
7070

7171
## Multi-region deployment
7272

@@ -98,8 +98,10 @@ All caches use Firestore (shared across Cloud Run instances, single region). No
9898
| `cache-ebay-sold` | 24 hours | eBay sold comp results |
9999
| `price-history` | permanent | Sold comp prices over time |
100100
| `api-keys` | permanent | Developer API keys (hashed) |
101-
| `error-logs` | permanent | API errors with request IDs |
102-
| `api-analytics` | 30 days | Request analytics (tier, path, latency) |
101+
| `error-logs` | 30 days (TTL) | API errors with request IDs, type filter |
102+
| `api-analytics` | 30 days | Request analytics (tier, path, latency, daily/byStatus) |
103+
| `card-database-cache` | permanent | TCGdex card index (~29K cards), synced on-demand |
104+
| `user-milestones` | permanent | User funnel milestones (signup → search → grade → portfolio) |
103105
| `grading-dataset` | permanent | ML training data: slab images + parsed grades |
104106

105107
Stale-while-revalidate on active listings for owner key. File-based cache (`.json` files) still used by the CLI.
@@ -152,6 +154,8 @@ Use `--refresh` to delete all cache files before a run.
152154
| `grade-logs` | source + createdAt desc | Filter grades by source |
153155
| `api-analytics` | userId + ts desc | Per-user analytics |
154156
| `price-history` | cardKey + recordedAt desc | Card price history |
157+
| `price-history` | cardId + recordedAt desc | Card price history (by canonical ID) |
158+
| `error-logs` | type + createdAt desc | Error filtering by type |
155159

156160
**ML dataset pipeline**: graded slab images (PSA/BGS/CGC/TAG) are passively collected into `grading-dataset` Firestore collection from multiple sources: eBay sold (via `track-prices` and `/api/sold`), magi sold (via `track-prices`), and any search with sold results (`/api/search`). Grade is parsed from listing title or grade label. `GET /api/grading-dataset/stats` monitors collection progress.
157161

@@ -163,7 +167,7 @@ Three workflows: `ci.yml` (all checks), `deploy.yml` (build + sign + deploy), `t
163167

164168
| Job | What | Required? |
165169
|-----|------|-----------|
166-
| unit | 312 unit tests | Yes |
170+
| unit | 313 unit tests | Yes |
167171
| smoke | 71 Playwright smoke tests | No (continue-on-error) |
168172
| codeql | SAST for JavaScript/TypeScript | Yes |
169173
| scan | SBOM (Syft) + Grype vulnerability scan | No |

0 commit comments

Comments
 (0)