3da1b4242c
Feature 1.2: Python FastAPI microservice wrapping nba_api - GET /stats/season-avg, /stats/last-n, /stats/splits, /players/search - Redis caching (24hr/1hr/6hr/7day), 0.6s rate limiting, PRA derived stat - 27 Python tests passing Feature 1.4: Complete Supabase database schema - 6 tables: users, picks, scan_sessions, bets, outcomes, performance - RLS enabled on all tables with auth.uid() policies - 3 triggers: auto-create user, updated_at, scan count reset - 37 schema validation tests passing - Migration SQL ready, pending manual apply (WSL2 DNS blocker) Total: 92 tests (65 Node.js + 27 Python), all passing Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
72 lines
3.1 KiB
Markdown
Executable File
72 lines
3.1 KiB
Markdown
Executable File
# BetonBLK — Build State
|
|
|
|
## Last Updated
|
|
2026-03-21
|
|
|
|
## Current Phase
|
|
Phase 1 — Foundation
|
|
|
|
## What Has Shipped
|
|
|
|
### Feature 1.1 — Odds API Integration (COMPLETE)
|
|
- GET /api/odds/nba — live NBA player props from DraftKings, FanDuel, BetMGM
|
|
- GET /api/odds/ncaab — NCAAB props (with off-season detection)
|
|
- Normalizer: pairs Over/Under outcomes, maps 8 market types, filters to 3 books
|
|
- Redis cache: 15-min TTL, stale fallback on API failure
|
|
- Quota tracking via response headers, 429 when exhausted
|
|
- Query filters: stat_type, player (partial match), book
|
|
- 28 tests passing (18 unit, 10 integration)
|
|
- Known limitation: player-to-team assignment deferred to Feature 1.2
|
|
|
|
### Feature 1.2 — NBA_API Stats Wrapper (COMPLETE)
|
|
- FastAPI microservice in nba-service/ on port 8000
|
|
- GET /stats/season-avg — season averages (24hr cache)
|
|
- GET /stats/last-n — last N game averages (1hr cache)
|
|
- GET /stats/splits — home/away, B2B/rest days, vs-team (6hr cache)
|
|
- GET /players/search — partial name to player ID (7-day cache)
|
|
- PRA computed as derived stat
|
|
- 0.6s rate limiting between nba_api calls with retry
|
|
- 27 tests passing (16 unit, 11 integration)
|
|
- Startup script: scripts/start.sh runs both Node + Python services
|
|
|
|
### Feature 1.4 — Database Schema (CODE COMPLETE — pending Supabase apply)
|
|
- Migration SQL: supabase/migrations/001_initial_schema.sql
|
|
- 6 tables: users, picks, scan_sessions, bets, outcomes, performance
|
|
- RLS enabled on all tables with auth.uid() policies
|
|
- 3 triggers: auto-create user, updated_at, scan count reset
|
|
- All constraints, indexes, and FKs defined
|
|
- 37 schema validation tests passing
|
|
- BLOCKED: WSL2 cannot resolve *.supabase.co — needs manual apply via SQL Editor
|
|
|
|
## What's Next
|
|
- Apply Feature 1.4 migration to Supabase (manual via SQL Editor)
|
|
- Run verify-schema.js to confirm tables exist
|
|
- Feature 1.3 — Prop Analysis Engine (depends: 1.1 + 1.2)
|
|
|
|
## Active Blockers
|
|
- BLOCKER-003: WSL2 DNS cannot resolve *.supabase.co (see BLOCKERS.md)
|
|
|
|
## Session Log
|
|
|
|
### Session 1 — 2026-03-21
|
|
- Made live Odds API test call, documented raw response format in DECISIONS.md
|
|
- Built: oddsNormalizer.js, oddsService.js, routes/odds.js, teamMap.js, redis.js, app.js
|
|
- Wrote 28 tests (unit + integration), all passing
|
|
- Logged DECISION-001 (API response format) and DECISION-002 (credit conservation)
|
|
- Spec updated: home_team/away_team replaces team/opponent (API limitation)
|
|
- Credits used: 2 of 500 (498 remaining)
|
|
|
|
### Session 2 — 2026-03-21
|
|
- Built Feature 1.2: FastAPI microservice wrapping nba_api
|
|
- stats.py, player_map.py, cache.py, main.py, config.py
|
|
- 27 Python tests, all passing
|
|
- Built Feature 1.4: Full database schema SQL
|
|
- 6 tables, RLS, triggers, indexes, constraints
|
|
- 37 schema validation tests, all passing
|
|
- Could not apply to Supabase (DNS blocker)
|
|
- Logged DECISION-003 (Python microservice) and DECISION-004 (Supabase Auth)
|
|
- Created startup script (scripts/start.sh) for both services
|
|
- Created Supabase client module (src/utils/supabase.js)
|
|
- Created schema verification script (scripts/verify-schema.js)
|
|
- Total tests: 92 (65 Node.js + 27 Python), all passing
|