# suzukikatsuma/finger-binary-dojo architecture

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

- Interactive diagram: https://gitdiagram.com/suzukikatsuma/finger-binary-dojo
- Repository: https://github.com/suzukikatsuma/finger-binary-dojo

## Overview

##### Project Type and Purpose
- This is a front-end web application built with Svelte. According to the README, its purpose is to help users learn and practice binary arithmetic (二進指数え法).
- The core functionality is delivered through a client-side interactive interface, making it essentially a single-page application (SPA).

##### Analyzing the File Structure
- Top-level directories like /src and /public indicate the separation of source code (logic and components) from static assets (HTML, CSS).
- The /src directory houses the main Svelte components:
- App.svelte – likely the main entry point.
- /components – containing constituent UI parts such as Header, Footer, MainBoard, Hand, ModeController, and NumController. These indicate a modular component-based architecture.
- /stores – contains state management files (e.g., decimalNumStores.ts and modeStores.ts) which suggest a design pattern that separates UI logic from application state.
- /styles – houses SCSS files for styling (e.g., _breakpoints.scss and _button.scss) to enforce a consistent design theme.
- The /public directory contains global assets:
- index.html – the entry HTML file,
- global.css and sitemap.xml – providing global styling and meta/data (sitemap) for the application.
- Configuration files like rollup.config.ts, tsconfig.json, and package.json show that the project uses Rollup for bundling and TypeScript for typing support.
- The presence of a .github directory with GitHub Actions (ci.yaml) emphasizes modern CI/CD practices.

##### Core Components
a. Frontend Application:
- "App.svelte" as the Application Shell.
b. Public/Static Assets:
- "public" folder which contains index.html, global.css, and sitemap.xml. Represent this as the static content delivery layer.
c. Build and Configuration Tools:
- Rollup (via rollup.config.ts) and TypeScript (tsconfig.json) as development/build tools. Although they aren’t running in production, they form the backbone of the build system.
d. Auxiliary Scripts:
- “bin” directory (bin/sitemap_update) to show that there is an auxiliary command/script to update or manage aspects (in this case, the sitemap).
e. CI/CD Integration:
- GitHub Actions workflow component (from .github/workflows/ci.yaml) to indicate automation practices.

##### Relationships and Data Flow
- Static assets (from /public) as supporting layers that the browser loads initially.
- Workflows where CI/CD triggers rebuilds and deployments (from workflows directory).

##### Architectural Patterns & Design Principles
- Component-based architecture (modularity, reusability, separation of concerns).
- Unidirectional data flow from central stores to components.
- Point out the use of modern build tooling (Rollup, TypeScript) to ensure maintainability and scalability.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Layer
    subgraph "Frontend Application"
        AppShell["Application Shell (App.svelte)"]:::frontend
        subgraph "UI Components"
            Header["Header Component"]:::frontend
            Footer["Footer Component"]:::frontend
            MainBoard["MainBoard Component"]:::frontend
            Hand["Hand Component"]:::frontend
            ModeController["ModeController Component"]:::frontend
            NumController["NumController Component"]:::frontend
        end
    end

    %% State Management
    subgraph "Stores"
        DecimalStore["Decimal Number Store"]:::store
        ModeStore["Mode Store"]:::store
    end

    %% Public/Static Assets
    subgraph "Public/Static Assets"
        IndexHTML["HTML Entry Point (index.html)"]:::public
        GlobalCSS["Global Styles (global.css)"]:::public
        Sitemap["Sitemap (sitemap.xml)"]:::public
    end

    %% Build and Configuration Tools
    subgraph "Build & Config Tools"
        RollupConfig["Rollup Config (rollup.config.ts)"]:::build
        TSConfig["TypeScript Config (tsconfig.json)"]:::build
        PackageConfig["Package Config (package.json)"]:::build
    end

    %% Auxiliary Scripts
    subgraph "Auxiliary Scripts"
        SitemapScript["Sitemap Update Script"]:::auxiliary
    end

    %% CI/CD Integration
    CIWorkflow["GitHub Actions Workflow (ci.yaml)"]:::ci

    %% Relationships between Frontend Components
    AppShell -->|"renders"| Header
    AppShell -->|"renders"| Footer
    AppShell -->|"renders"| MainBoard
    AppShell -->|"renders"| Hand
    AppShell -->|"renders"| ModeController
    AppShell -->|"renders"| NumController

    %% Data Flow from Stores to UI components
    DecimalStore -->|"updates"| NumController
    ModeStore -->|"updates"| ModeController

    %% Public Asset loading the App
    IndexHTML -->|"loads"| AppShell
    GlobalCSS -->|"styles"| AppShell

    %% Build process interactions
    CIWorkflow -->|"triggers"| RollupConfig
    RollupConfig -->|"bundles"| AppShell

    %% Auxiliary Script Updates
    SitemapScript -->|"updates"| Sitemap

    %% Classes / Styles
    classDef frontend fill:#a3d2ca,stroke:#000,stroke-width:2px,color:#000;
    classDef store fill:#fcbf49,stroke:#000,stroke-width:2px,color:#000;
    classDef public fill:#f7d794,stroke:#000,stroke-width:2px,color:#000;
    classDef build fill:#ffe066,stroke:#000,stroke-width:2px,color:#000;
    classDef auxiliary fill:#caffbf,stroke:#000,stroke-width:2px,color:#000;
    classDef ci fill:#ff6b6b,stroke:#000,stroke-width:2px,color:#000;

    %% Click Events for Component Mapping
    click AppShell "https://github.com/suzukikatsuma/finger-binary-dojo/blob/main/src/App.svelte"
    click Header "https://github.com/suzukikatsuma/finger-binary-dojo/blob/main/src/components/Header.svelte"
    click Footer "https://github.com/suzukikatsuma/finger-binary-dojo/blob/main/src/components/Footer.svelte"
    click MainBoard "https://github.com/suzukikatsuma/finger-binary-dojo/blob/main/src/components/MainBoard.svelte"
    click Hand "https://github.com/suzukikatsuma/finger-binary-dojo/blob/main/src/components/Hand.svelte"
    click ModeController "https://github.com/suzukikatsuma/finger-binary-dojo/blob/main/src/components/ModeController.svelte"
    click NumController "https://github.com/suzukikatsuma/finger-binary-dojo/blob/main/src/components/NumController.svelte"
    click DecimalStore "https://github.com/suzukikatsuma/finger-binary-dojo/blob/main/src/stores/decimalNumStores.ts"
    click ModeStore "https://github.com/suzukikatsuma/finger-binary-dojo/blob/main/src/stores/modeStores.ts"
    click IndexHTML "https://github.com/suzukikatsuma/finger-binary-dojo/blob/main/public/index.html"
    click GlobalCSS "https://github.com/suzukikatsuma/finger-binary-dojo/blob/main/public/global.css"
    click Sitemap "https://github.com/suzukikatsuma/finger-binary-dojo/blob/main/public/sitemap.xml"
    click RollupConfig "https://github.com/suzukikatsuma/finger-binary-dojo/blob/main/rollup.config.ts"
    click TSConfig "https://github.com/suzukikatsuma/finger-binary-dojo/blob/main/tsconfig.json"
    click PackageConfig "https://github.com/suzukikatsuma/finger-binary-dojo/blob/main/package.json"
    click SitemapScript "https://github.com/suzukikatsuma/finger-binary-dojo/tree/main/bin/sitemap_update"
    click CIWorkflow "https://github.com/suzukikatsuma/finger-binary-dojo/blob/main/.github/workflows/ci.yaml"
```
