How akhanal222/nba-non-betting-app works
This is an NBA statistics and analysis application: users browse games, teams, players, standings, and leaderboards, then inspect player trends, matchups, comparisons, and prop projections with AI explanations. The React frontend calls a Spring REST backend; documented backend layers persist data in PostgreSQL and ingest NBA data from Balldontlie. The graph preserves those product branches and the documented nightly defense-versus-position refresh. Some subsystem links are based on the README and module names because their implementation was not sampled.
Main entry points: main.jsx Page routing · api.js API client · repository JPA repositories · AiExplanationController.java AI explanation endpoint
Components 29
Web experience
- Page routing
frontend/src/main.jsx - Home and search
frontend/src/App.jsx - API client
frontend/src/api.js - Matchup dashboard
frontend/src/pages/MatchupsDashboard.jsx - Predictions page
frontend/src/pages/PlayersPredictions.jsx - Player detail
frontend/src/pages/PlayerDetailPage.jsx - Team players
frontend/src/pages/TeamPlayersPage.jsx - Game lineups
frontend/src/pages/Gamelineuppage.jsx - Top players
frontend/src/pages/TopPlayers.jsx - Team standings
frontend/src/pages/TeamsStanding.jsx
REST API
- REST controllers
src/main/java/com/nba/nbanonbettingapp/controller - Balldontlie endpoints
src/main/java/com/nba/nbanonbettingapp/controller/BalldontlieController.java - Matchup endpoint
src/main/java/com/nba/nbanonbettingapp/controller/HeadToHeadController.java - AI explanation endpoint
src/main/java/com/nba/nbanonbettingapp/controller/AiExplanationController.java
Analysis services
- Analysis services
src/main/java/com/nba/nbanonbettingapp/service - Head-to-head analysis
src/main/java/com/nba/nbanonbettingapp/service/HeadToHeadService.java - Prop projections
src/main/java/com/nba/nbanonbettingapp/service/PropProjectionService.java - Player comparisons
src/main/java/com/nba/nbanonbettingapp/service/PlayerComparisonService.java - Defense by position
src/main/java/com/nba/nbanonbettingapp/service/DvPIngestionService.java - Advanced stats and EWMA
src/main/java/com/nba/nbanonbettingapp/service/AdvancedStatsIngestionService.java - AI explanations
src/main/java/com/nba/nbanonbettingapp/service/GeminiService.java
Data and integrations
- Balldontlie integration
src/main/java/com/nba/nbanonbettingapp/service/BalldontlieService.java - Player search and upsert
src/main/java/com/nba/nbanonbettingapp/service/PlayerSearchService.java - JPA repositories
src/main/java/com/nba/nbanonbettingapp/repository - Advanced stats repository
src/main/java/com/nba/nbanonbettingapp/repository/PlayerAdvancedStatsRepository.java - Neon PostgreSQL
Other components
- NBA fan
- Balldontlie API
- Gemini API
Connections 38
- NBA fan → Page routing: browses
- Page routing → Home and search: renders
- Page routing → Matchup dashboard: routes to
- Page routing → Predictions page: routes to
- Page routing → Player detail: routes to
- Page routing → Team players: routes to
- Page routing → Game lineups: routes to
- Page routing → Top players: routes to
- Page routing → Team standings: routes to
- Home and search → API client: requests data
- Matchup dashboard → API client: requests data
- Predictions page → API client: requests data
- Player detail → API client: requests data
- Team players → API client: requests data
- Game lineups → API client: requests data
- Top players → API client: requests data
- Team standings → API client: requests data
- API client → REST controllers: calls REST
- REST controllers → Analysis services: delegates requests
- Balldontlie endpoints → Balldontlie integration: calls
- Matchup endpoint → Head-to-head analysis: calls
- AI explanation endpoint → Prop projections: requests prediction
- AI explanation endpoint → Head-to-head analysis: requests matchup
- AI explanation endpoint → Player comparisons: requests comparison
- AI explanation endpoint → AI explanations: requests explanation
- Head-to-head analysis → JPA repositories: reads stats
- Prop projections → JPA repositories: reads stats
- Player comparisons → JPA repositories: reads player data
- Player search and upsert → JPA repositories: searches and saves
- Balldontlie integration → Balldontlie API: fetches NBA data
- Player search and upsert → Balldontlie integration: searches fallback
- Advanced stats and EWMA → Balldontlie integration: fetches advanced stats
- Advanced stats and EWMA → Advanced stats repository: upserts rows
- Defense by position → JPA repositories: reads and saves
- AI explanations → Gemini API: generates text
- AI explanations → JPA repositories: reads and caches
- JPA repositories → Neon PostgreSQL: reads and writes
- Advanced stats repository → Neon PostgreSQL: reads and writes