# arunavsameer/chess-v2 architecture

> Architecture diagram of the GitHub repository arunavsameer/chess-v2, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-02-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/arunavsameer/chess-v2
- Repository: https://github.com/arunavsameer/chess-v2

## Overview

##### Project type and purpose
- This is a small command‐line chess utility (“chessv2”) written in C++. It reads moves in a simple text format (e.g. “k2f3”), updates an internal board representation (parsed from FEN notation), optionally runs an auto‐move routine, and prints the updated board and captured pieces (“graveyard”).

##### File structure
- Top‐level C++ source files:
- chessv2.cpp / chess_v2.cpp – likely two variants of the main entry point for manual play.
- chessv2_auto.cpp – an alternate main that drives automated play (auto move generation).
- graveyard.cpp – manages captured-piece storage and display.
- tempCodeRunnerFile.cpp – scratch code, disposable.
- fen_to_board.hpp – header for parsing FEN strings into the board’s data structures.
- Compiled binaries: chessv2.exe, chessv2_auto.exe.
- No external directories (frontend/backend), no config or build scripts (likely a simple g++ or Visual Studio project).

##### README for additional insights
- Confirms CLI usage: you launch “chessv2.exe” and type moves in “piece+destination” format.
- No mention of a persistent database, network I/O, or GUI.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Nodes
    CLIInput["CLI Input Handler"]:::io
    MoveParser["Move Parser"]:::core
    FENParser["FEN Parser"]:::util
    BoardModel["Board Model"]:::data
    MoveValidator["Move Validator & Engine"]:::core
    Graveyard["Graveyard Manager"]:::data
    OutputRenderer["Output Renderer"]:::io
    AutoMove["Auto-Move Module"]:::core
    %% Placeholder extensions
    GUI["GUI Frontend (future)"]:::placeholder
    AIEngine["AI Engine (future)"]:::placeholder

    %% Initialization
    FENParser -->|"InitialBoardState"| BoardModel

    %% Main flow
    CLIInput -->|"rawInput"| MoveParser
    MoveParser -->|"ParsedMove"| MoveValidator
    MoveValidator -->|"BoardState"| BoardModel
    BoardModel -->|"BoardState"| MoveValidator
    MoveValidator -->|"CapturedPiece?"| Graveyard
    MoveValidator -->|"UpdatedBoardState"| BoardModel
    BoardModel -->|"BoardState"| OutputRenderer
    Graveyard -->|"CapturedPieceList"| OutputRenderer

    %% Auto-Move flow
    AutoMove -->|"AutoMoveTrigger"| MoveValidator

    %% Future extension arrows
    GUI -.->|"UserMove"| MoveParser
    MoveValidator -.->|"RenderState"| GUI
    AIEngine -.->|"SuggestedMove"| MoveParser

    %% Click events
    click CLIInput "https://github.com/arunavsameer/chess-v2/blob/main/chessv2.cpp"
    click MoveParser "https://github.com/arunavsameer/chess-v2/blob/main/chessv2.cpp"
    click FENParser "https://github.com/arunavsameer/chess-v2/blob/main/fen_to_board.hpp"
    click BoardModel "https://github.com/arunavsameer/chess-v2/blob/main/fen_to_board.hpp"
    click MoveValidator "https://github.com/arunavsameer/chess-v2/blob/main/chessv2.cpp"
    click Graveyard "https://github.com/arunavsameer/chess-v2/blob/main/graveyard.cpp"
    click OutputRenderer "https://github.com/arunavsameer/chess-v2/blob/main/chessv2.cpp"
    click AutoMove "https://github.com/arunavsameer/chess-v2/blob/main/chessv2_auto.cpp"

    %% Styles
    classDef io fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef core fill:#90EE90,stroke:#000,stroke-width:1px
    classDef data fill:#FFFFE0,stroke:#000,stroke-width:1px
    classDef util fill:#D3D3D3,stroke:#000,stroke-width:1px
    classDef placeholder fill:#f0f0f0,stroke:#666,stroke-dasharray: 5 5,stroke-width:1px
```
