# pixelpow/findmyblock-pool architecture

> Architecture diagram of the GitHub repository pixelpow/findmyblock-pool, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-10-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pixelpow/findmyblock-pool
- Repository: https://github.com/pixelpow/findmyblock-pool

## Overview

##### Project Type & Purpose
- This is a single-page web interface (React + Tailwind CSS) for an anonymous Bitcoin solo mining pool.
- It does not contain its own mining backend; instead it relies on the external “public-pool” service for all mining protocol, pool management, and blockchain interactions.
- The front-end visualizes real-time stats, device monitoring, mining challenges, and handles user stratum connections.

##### File Structure Analysis
– Top-level files (package.json, postcss.config.js, tailwind.config.js) configure the build system and CSS pipeline.
– src/ folder holds all React source code:
- components/ – hundreds of presentational and container components (charts, dashboards, modals, panels).
- data/ – static data (e.g., challenges definitions).
- hooks/ – custom React hooks (e.g., useFearGreed).
- index.js + App.js – application entry point.
– No backend or API server code, confirming this is purely a front-end codebase.

##### README Insights
- Tech stack: React 19, Tailwind CSS, Framer Motion, Recharts.
- Architecture call-out: Miners → public-pool backend → FindMyBlock interface → Browser
- Backend requirement: public-pool server on port 23334 (hosts Stratum/WebSocket & REST API).

##### Main Components
a. External Bitcoin Miners (hardware, e.g., BitAxe, AvalonNano3)
b. public-pool Backend Service (Stratum/WebSocket server + REST API)
c. FindMyBlock React SPA (running in the user’s browser)
d. Third-party services (optional): Blockchain explorer APIs if used for difficulty & hashrate data
e. Static Hosting/CDN (serves the built SPA)

##### Interactions & Data Flows
- Miners ↔ public-pool (Stratum protocol over TCP/WebSocket for job assignment, share submission).
- React SPA ↔ public-pool (WebSocket or HTTP polling for real-time pool stats, network stats, difficulty).
- React SPA ↔ public-pool (REST API calls for user/device registration, challenge data).
- React SPA internal data flow:
– Custom hooks (e.g., useFearGreed) pull data from API endpoints.
– Components subscribe to hook state to render charts (Recharts), animations (Framer Motion), UI (Tailwind CSS).

##### Architectural Patterns & Design Principles
– Single-Page Application (SPA) with client-side routing/state.
– Component-based UI (presentational vs. container components).
– Unidirectional data flow (hooks → component props → render).
– Separation of concerns: styling (Tailwind), animation (Framer Motion), charting (Recharts), data fetching (hooks/API).
– Externalized backend allows front-end to remain stateless and anonymous.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Hardware Layer
    Miners[(Bitcoin Miners)]:::hardware

    %% Backend Layer
    Backend[(public-pool Backend<br/>Stratum/WebSocket & REST API<br/>port 23334)]:::backend

    %% Infrastructure Layer
    CDN[(Static Hosting / CDN)]:::infra
    ExtAPI[(Blockchain Explorer API)]:::infra

    %% Browser / SPA
    Browser[(Browser)]:::frontend

    %% React SPA Subgraph
    subgraph "React SPA (React 19, Tailwind CSS)" 
        direction TB
        Index["src/index.js"]:::frontend
        Appjs["src/App.js"]:::frontend
        subgraph "Presentation Layer (UI Components)"
            UIComponents["UI Components"]:::frontend
        end
        subgraph "Data Layer (Hooks & API Client)"
            Hooks["useFearGreed & API Hooks"]:::frontend
        end
        subgraph "Styles & Animation"
            Styles["Tailwind CSS & Framer Motion"]:::frontend
        end
    end

    %% Connections
    Miners <-->|Stratum/WebSocket| Backend
    Browser <-->|WebSocket| Backend
    Browser <-->|REST API| Backend
    CDN -->|Serves SPA| Browser
    ExtAPI -->|Provides stats| Browser

    %% Click Events
    click Index "https://github.com/pixelpow/findmyblock-pool/blob/main/src/index.js"
    click Appjs "https://github.com/pixelpow/findmyblock-pool/blob/main/src/App.js"
    click UIComponents "https://github.com/pixelpow/findmyblock-pool/tree/main/src/components/"
    click Hooks "https://github.com/pixelpow/findmyblock-pool/blob/main/src/hooks/useFearGreed.js"
    click Styles "https://github.com/pixelpow/findmyblock-pool/blob/main/tailwind.config.js"

    %% Styles
    classDef frontend fill:#a8f0c6,stroke:#0a5c3d,color:#0a5c3d;
    classDef backend fill:#c6e2ff,stroke:#034694,color:#034694;
    classDef hardware fill:#ffc58f,stroke:#b35e00,color:#b35e00;
    classDef infra fill:#e0e0e0,stroke:#636363,color:#636363;
```
