# graysonhuey/binary-bingo architecture

> Architecture diagram of the GitHub repository graysonhuey/binary-bingo, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/graysonhuey/binary-bingo
- Repository: https://github.com/graysonhuey/binary-bingo

## Overview

##### Project type and purpose
- This is a client-side single-page application (SPA) built with React.
- Purpose: A “Binary Bingo” game where the app randomly generates binary numbers (1–75), converts them to base-10, and lets users mark them on a bingo card. It teaches binary conversion in a playful way.

##### File structure
- Top-level:
- package.json / package-lock.json – project dependencies and scripts
- README.md, LICENSE – documentation
- public/ – static assets (index.html, manifest.json, robots.txt)
- src/ – all React source code
- src/ contains:
- index.js + index.css – application entry point
- App.js + App.css – root component and global styles
- LocalStorageContext.js – React Context provider to persist and share “called numbers” using browser localStorage
- BingoComponent/ – the bingo card UI and marking logic
- NumberHistoryComponent/ – displays list of called numbers
- TimerComponent/ – handles the “Generate” timer or countdown (if used)
- reportWebVitals.js – performance measuring (optional)

##### README for additional insights
- No separate backend or external API; game logic and state live entirely in the client.
- Use cases: generate binary numbers, convert to decimal, record history, reset history.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Browser Environment"
        direction TB
        User["User"]:::user
        HTML["public/index.html"]:::entry
        subgraph "React App"
            direction TB
            Entry["src/index.js"]:::entry
            App["src/App.js"]:::component
            subgraph "Styles"
                direction TB
                AppCSS["src/App.css"]:::styles
                IndexCSS["src/index.css"]:::styles
            end
            Context["src/LocalStorageContext.js"]:::context
            subgraph "UI Components"
                direction TB
                subgraph "BingoComponent"
                    direction TB
                    BingoJS["src/BingoComponent/BingoComponent.js"]:::component
                    BingoCSS["src/BingoComponent/BingoComponent.css"]:::styles
                end
                subgraph "NumberHistoryComponent"
                    direction TB
                    HistoryJS["src/NumberHistoryComponent/NumberHistoryComponent.js"]:::component
                    HistoryCSS["src/NumberHistoryComponent/NumberHistoryComponent.css"]:::styles
                end
                subgraph "TimerComponent"
                    direction TB
                    TimerJS["src/TimerComponent/TimerComponent.js"]:::component
                    TimerCSS["src/TimerComponent/TimerComponent.css"]:::styles
                end
            end
            Metrics["src/reportWebVitals.js"]:::component
        end
        Storage["localStorage"]:::storage
    end

    User -->|interacts with| TimerJS
    User -->|marks cells on| BingoJS
    User -->|views history on| HistoryJS

    HTML -->|bootstraps app| Entry
    Entry -->|renders| App
    App -->|applies styles| AppCSS
    App -->|applies styles| IndexCSS
    App -->|wraps in provider| Context
    Context -->|provides state to| BingoJS
    Context -->|provides state to| HistoryJS
    TimerJS -->|triggers update| Context
    Context -->|reads/writes| Storage
    App -->|optional metrics| Metrics

    click HTML "https://github.com/graysonhuey/binary-bingo/blob/master/public/index.html"
    click Entry "https://github.com/graysonhuey/binary-bingo/blob/master/src/index.js"
    click App "https://github.com/graysonhuey/binary-bingo/blob/master/src/App.js"
    click AppCSS "https://github.com/graysonhuey/binary-bingo/blob/master/src/App.css"
    click IndexCSS "https://github.com/graysonhuey/binary-bingo/blob/master/src/index.css"
    click Context "https://github.com/graysonhuey/binary-bingo/blob/master/src/LocalStorageContext.js"
    click BingoJS "https://github.com/graysonhuey/binary-bingo/blob/master/src/BingoComponent/BingoComponent.js"
    click BingoCSS "https://github.com/graysonhuey/binary-bingo/blob/master/src/BingoComponent/BingoComponent.css"
    click HistoryJS "https://github.com/graysonhuey/binary-bingo/blob/master/src/NumberHistoryComponent/NumberHistoryComponent.js"
    click HistoryCSS "https://github.com/graysonhuey/binary-bingo/blob/master/src/NumberHistoryComponent/NumberHistoryComponent.css"
    click TimerJS "https://github.com/graysonhuey/binary-bingo/blob/master/src/TimerComponent/TimerComponent.js"
    click TimerCSS "https://github.com/graysonhuey/binary-bingo/blob/master/src/TimerComponent/TimerComponent.css"
    click Metrics "https://github.com/graysonhuey/binary-bingo/blob/master/src/reportWebVitals.js"

    classDef user fill:#ffefa0,stroke:#e2b007
    classDef entry fill:#e0f7fa,stroke:#0288d1
    classDef component fill:#e8f5e9,stroke:#2e7d32
    classDef context fill:#f3e5f5,stroke:#6a1b9a
    classDef storage fill:#fff3e0,stroke:#ef6c00,stroke-dasharray: 5 5
    classDef styles fill:#f1f8e9,stroke:#558b2f
```
