# valentave/miscrits-calculator architecture

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

- Interactive diagram: https://gitdiagram.com/valentave/miscrits-calculator
- Repository: https://github.com/valentave/miscrits-calculator

## Overview

##### Project Type and Purpose
- This is a single-page web application built using React.
- The static assets (images and CSS) and JSON data (for miscrits lists and relics) help power the simulation.

##### File Structure to Identify Main Components
- The root contains configuration files (e.g., package.json, vite.config.js, .eslintrc.cjs) used in building and maintaining the app.
- The public folder holds static assets organized by type (full pictures, profile pics, relics, etc.) that are served directly.
- The src folder is the core of the application:
- App.jsx – the main container component that likely provides the overall layout.
- main.jsx – the entry point for bootstrapping the React app.
- Components – a set of modular React components (such as EditBonusWindow, HelpWindow, MiscritMain, MiscritsFilter, MiscritsList, Options, RelicWindow, Stats) that manage various aspects of the simulation.
- Data – JSON files (miscritsList.json, relics.json) which provide the simulation's input data.
- Styles – CSS files specific to each component for styling purposes.
- The index.html file acts as the shell that loads the bundled React application.

- A note to reference the underlying technologies (React, Vite) where applicable.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Client (Browser)"
        indexHTML["index.html"]:::browser
        publicAssets["Public Assets"]:::browser
        srcAssets["Src Assets"]:::browser
    end

    subgraph "Build Process"
        viteConfig["vite.config.js"]:::build
        pkg["package.json"]:::build
    end

    subgraph "React App"
        mainJS["main.jsx (Entry Point)"]:::entry
        AppJS["App Component (App.jsx)"]:::app
        MiscritMain["MiscritMain Component"]:::component
        EditBonus["EditBonusWindow Component"]:::component
        HelpWindow["HelpWindow Component"]:::component
        MiscritFilter["MiscritsFilter Component"]:::component
        MiscritList["MiscritsList Component"]:::component
        Options["Options Component"]:::component
        Stats["Stats Component"]:::component
        RelicWindow["RelicWindow Component"]:::component
    end

    subgraph "Data Source"
        MiscritJSON["miscritsList.json"]:::data
        RelicsJSON["relics.json"]:::data
    end

    Styles["Styles (CSS)"]:::styles

    %% Flow connections
    indexHTML -->|"loads"| viteConfig
    viteConfig -->|"configures"| pkg
    pkg -->|"builds"| mainJS
    mainJS -->|"boots"| AppJS
    AppJS -->|"renders"| MiscritMain
    AppJS -->|"renders"| EditBonus
    AppJS -->|"renders"| HelpWindow
    AppJS -->|"renders"| MiscritFilter
    AppJS -->|"renders"| MiscritList
    AppJS -->|"renders"| Options
    AppJS -->|"renders"| Stats
    AppJS -->|"renders"| RelicWindow
    publicAssets -->|"provides"| AppJS
    srcAssets -->|"provides"| AppJS
    Styles -->|"styles"| AppJS
    MiscritJSON -->|"feeds"| AppJS
    RelicsJSON -->|"feeds"| AppJS
    MiscritFilter -->|"filters"| MiscritMain
    Options -->|"updates"| Stats

    %% Click Events
    click indexHTML "https://github.com/valentave/miscrits-calculator/blob/main/index.html"
    click publicAssets "https://github.com/valentave/miscrits-calculator/tree/main/public/assets"
    click srcAssets "https://github.com/valentave/miscrits-calculator/tree/main/src/assets"
    click viteConfig "https://github.com/valentave/miscrits-calculator/blob/main/vite.config.js"
    click pkg "https://github.com/valentave/miscrits-calculator/blob/main/package.json"
    click mainJS "https://github.com/valentave/miscrits-calculator/blob/main/src/main.jsx"
    click AppJS "https://github.com/valentave/miscrits-calculator/blob/main/src/App.jsx"
    click MiscritMain "https://github.com/valentave/miscrits-calculator/blob/main/src/components/MiscritMain.jsx"
    click EditBonus "https://github.com/valentave/miscrits-calculator/blob/main/src/components/EditBonusWindow.jsx"
    click HelpWindow "https://github.com/valentave/miscrits-calculator/blob/main/src/components/HelpWindow.jsx"
    click MiscritFilter "https://github.com/valentave/miscrits-calculator/blob/main/src/components/MiscritsFilter.jsx"
    click MiscritList "https://github.com/valentave/miscrits-calculator/blob/main/src/components/MiscritsList.jsx"
    click Options "https://github.com/valentave/miscrits-calculator/blob/main/src/components/Options.jsx"
    click Stats "https://github.com/valentave/miscrits-calculator/blob/main/src/components/Stats.jsx"
    click RelicWindow "https://github.com/valentave/miscrits-calculator/blob/main/src/components/RelicWindow.jsx"
    click MiscritJSON "https://github.com/valentave/miscrits-calculator/blob/main/src/data/miscritsList.json"
    click RelicsJSON "https://github.com/valentave/miscrits-calculator/blob/main/src/data/relics.json"
    click Styles "https://github.com/valentave/miscrits-calculator/tree/main/src/styles"

    %% Styles
    classDef browser fill:#e3f2fd,stroke:#333,stroke-width:2px;
    classDef build fill:#fff3e0,stroke:#333,stroke-width:2px;
    classDef entry fill:#e8f5e9,stroke:#333,stroke-width:2px;
    classDef app fill:#fce4ec,stroke:#333,stroke-width:2px;
    classDef component fill:#dcedc8,stroke:#333,stroke-width:2px;
    classDef data fill:#fff9c4,stroke:#333,stroke-width:2px;
    classDef styles fill:#e1bee7,stroke:#333,stroke-width:2px;
```
