Blockchain Bets Dashboard - Codebase Analysis

Project Description: A data-driven analytics platform designed to aggregate and visualize betting handle distribution across multiple markets for each game and team, similar to a Bloomberg Terminal for sports investing.

Tech Stack & Architecture

Repository #1: dashboard-frontend

Main Application Layout:

Key Pages/Sections:

  1. Plays - Main betting data dashboard
  2. ROI Matrix - Return on investment analysis
  3. Data - Raw data visualization
  4. Systems - Betting system management
  5. Settings - User profile and preferences
  6. Admin Panel - User management, invites, credits

Core Betting Data Features

Data Aggregation & Display:

Real-time Data Management:

Data Visualization Components:

Key Data Structures

Game/Match Object:

{ eventId: number, leagueId: number, startDateTime: string, awayTeamName: string, homeTeamName: string, odds: { currentAwayValue: string, currentHomeValue: string, // Historical odds data }, consensus: { totalCash: number, totalCashHomePercentage: number, totalCashAwayPercentage: number, // Handle distribution data }, roi: number, // Team-specific archive data }

Market Categories Supported:

Advanced Features

Money Flow Analysis:

ROI Matrix System:

User Management:

API Integration

Key Endpoints:

Real-time Features:

Responsive Design

Data Source Integration

Primary Data Source: BettingData.com

Data Types Extracted:

Repository #2: dashboard-json-fetcher

Purpose: Pure JSON Data Extraction Service

JSON Data Structure Retrieved:

{ Leagues: [...], // NFL, NBA, CBB, etc. Groups: [...], // Game groupings by date/league Events: [...], // Individual games with team info Scores: [...], // Live scores and game status Odds: [...], // Current betting lines Consensus: [...] // Betting handle distribution }

Repository #3: dashboard-streamer

Purpose: Real-time Data Processing and API Server

Key Service Components:

Complete Data Flow Process

Step 1: Data Extraction (json-fetcher)

  1. Puppeteer navigates to BettingData.com game center
  2. Intercepts API calls to bootstrap endpoint
  3. Extracts raw JSON data containing all games, odds, consensus
  4. Stores in MongoDB with timestamp for intelligent caching

Step 2: Data Processing (streamer)

  1. Retrieves cached JSON data from json-fetcher
  2. Scrapes additional DOM data for real-time updates
  3. Merges JSON and DOM data sources intelligently
  4. Calculates consensus percentages and ROI values
  5. Categorizes games by status (upcoming, live, final)
  6. Extracts comprehensive historical money movement data
  7. Serves processed data via REST API and WebSocket connections

Step 3: Real-time Updates (streamer)

  1. Continuously monitors BettingData.com for live changes
  2. Detects updates in odds, scores, betting percentages
  3. Pushes real-time changes via Socket.io to frontend
  4. Sends Slack notifications for significant market movements

Step 4: Visualization (frontend)

  1. Receives initial data payload via /stream endpoint
  2. Establishes WebSocket connection for real-time updates
  3. Displays betting handle distribution and percentages
  4. Renders money movement history and ROI analysis

Data Processing Details

Technical Implementation Details:

  1. Data Sources: Two specialized repos handle data ingestion - a JSON fetcher and real-time streamer for comprehensive sportsbook API coverage
  2. Update Frequency: Variable based on betting activity - multiple times per minute during high activity, every few minutes or longer during low betting volume hours
  3. Handle Calculation: Raw betting amounts from all sources are aggregated with no weighting or normalization applied - pure sum totals
  4. Money Classification: System tracks total betting amounts only - data source doesn't differentiate between sharp vs public money or provide individual bettor information
  5. Caching Strategy: 20-minute cache expiration for JSON data with real-time DOM updates for immediate changes

Key Tracked Data Points

For Each Game:

Market Categories:

System Architecture Summary:

This sophisticated sports betting analytics platform aggregates and visualizes betting market data in real-time, functioning as a Bloomberg Terminal equivalent for sports betting. The three-tier architecture features:

The system provides comprehensive market analysis tools, real-time streaming capabilities, and responsive design optimized for professional betting analysis and market inefficiency detection.

Technical Specifications

Performance & Reliability:

Complete Dependencies Overview

Frontend Dependencies (dashboard-frontend):

"dependencies": { "@emotion/react": "^11.10.5", "@emotion/styled": "^11.10.5", "@mui/material": "^5.11.8", "@mui/x-date-pickers": "^6.18.6", "apexcharts": "^3.37.0", "axios": "^1.3.3", "dayjs": "^1.11.7", "react": "^18.2.0", "react-apexcharts": "^1.4.0", "react-router-dom": "^6.8.1", "socket.io-client": "^4.6.1", "uuid": "^9.0.0" }

Backend Dependencies (streamer & json-fetcher):

"dependencies": { "@slack/bolt": "^3.17.1", "axios": "^1.3.4", "express": "^4.18.2", "mongodb": "^6.5.0", "mongoose": "^8.3.2", "puppeteer": "^20.2.0", "socket.io-client": "^4.6.1", "node-cron": "^3.0.3", "fast-xml-parser": "^4.4.1", "ioredis": "^5.3.2" }