# keshav-writes-code/neuralnetbuilder architecture

> Architecture diagram of the GitHub repository keshav-writes-code/neuralnetbuilder, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/keshav-writes-code/neuralnetbuilder
- Repository: https://github.com/keshav-writes-code/neuralnetbuilder

## Overview

##### Main Components Organization

a) Frontend Layer (Primary Focus)
- Divide it into these key sections:
- UI Components (Astro-based)
- Neural Network Core (Svelte-based)
- State Management
- Visualization Layer

##### Component Breakdown

a) UI Components Section:
- Header
- Footer
- Hero Image
- Splash Screen
- Starfield Animation
- GitHub Corner

b) Neural Network Core Section:
- NN_classes (Core NN logic)
- NN_function (Neural network computations)
- NN_layers (Layer visualization)
- NN_parameters (Parameter controls)
- NN_specs (Network specifications)
- NN_IOgraph (Input/Output visualization)

c) State Management:
- A "Store" component (based on store.ts)
- Data flow connections to NN components

##### Data Flow Representation

- User input → NN Parameters
- Parameters → NN Function
- NN Function → IO Graph
- Store → Components relationships

##### Technical Stack Indicators

A "Technology Stack" section showing:
- Astro Framework
- Svelte Components
- TypeScript
- UnoCSS
- Bun (Package Manager)

##### Deployment Flow

A small section showing:
- GitHub Actions workflow
- GitHub Pages deployment

Key Considerations:

##### Planned features (from TODO list) in a "Future Extensions" section

Special Notes:
- Keep the focus on the neural network visualization and interaction flow
- How user interactions propagate through the system
- Where the planned features (dataset loading, weight import/export) would fit

- Notes about the single input/single output nature of the neural network
- Document the real-time update flow of the graph visualization

Level of Detail:
- Neural Network Component Interaction
- State Management Flow
- Visualization Pipeline

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Frontend
        subgraph UI
            HC["Home Components"]
            Header["Header"]:::astro
            Footer["Footer"]:::astro
            Hero["Hero Image"]:::astro
            Splash["Splash Screen"]:::astro
            Star["Starfield Animation"]:::astro
            Git["GitHub Corner"]:::astro
            
            HC --> Header
            HC --> Footer
            HC --> Hero
            HC --> Splash
            HC --> Star
            HC --> Git
        end

        subgraph NNCore["Neural Network Core"]
            Classes["NN Classes"]:::core
            Function["NN Function"]:::core
            Layers["NN Layers"]:::svelte
            Params["NN Parameters"]:::svelte
            Specs["NN Specifications"]:::svelte
            IOGraph["NN IO Graph"]:::svelte
            
            Function --> Classes
            Params --> Function
            Function --> IOGraph
            Layers --> Function
            Specs --> Function
        end

        subgraph State
            Store["Store"]:::state
        end

        subgraph Pages
            Home["Home Page"]:::astro
            Index["Index Page"]:::astro
        end

        subgraph Tech["Technology Stack"]
            Astro["Astro Framework"]
            Svelte["Svelte"]
            TS["TypeScript"]
            Uno["UnoCSS"]
            Bun["Bun"]
        end

        Store --> NNCore
        UI --> Pages
        NNCore --> Pages
    end

    subgraph Deploy["Deployment"]
        Actions["GitHub Actions"]
        Pages["GitHub Pages"]
        
        Actions --> Pages
    end

    %% Click events for component mapping
    click HC "https://github.com/Keshav-writes-code/NeuralNetBuilder/tree/master/src/components/home_comps/"
    click Header "https://github.com/Keshav-writes-code/NeuralNetBuilder/blob/master/src/components/home_comps/header.astro"
    click Footer "https://github.com/Keshav-writes-code/NeuralNetBuilder/blob/master/src/components/home_comps/footer.astro"
    click Hero "https://github.com/Keshav-writes-code/NeuralNetBuilder/blob/master/src/components/home_comps/hero-image.astro"
    click Splash "https://github.com/Keshav-writes-code/NeuralNetBuilder/blob/master/src/components/home_comps/splash.astro"
    click Star "https://github.com/Keshav-writes-code/NeuralNetBuilder/blob/master/src/components/home_comps/starfield.astro"
    click Git "https://github.com/Keshav-writes-code/NeuralNetBuilder/blob/master/src/components/home_comps/github-corner.astro"
    
    click Classes "https://github.com/Keshav-writes-code/NeuralNetBuilder/blob/master/src/components/NN_comps/NN_classes.ts"
    click Function "https://github.com/Keshav-writes-code/NeuralNetBuilder/blob/master/src/components/NN_comps/NN_function.ts"
    click Layers "https://github.com/Keshav-writes-code/NeuralNetBuilder/blob/master/src/components/NN_comps/NN_layers.svelte"
    click Params "https://github.com/Keshav-writes-code/NeuralNetBuilder/blob/master/src/components/NN_comps/NN_parameters.svelte"
    click Specs "https://github.com/Keshav-writes-code/NeuralNetBuilder/blob/master/src/components/NN_comps/NN_specs.svelte"
    click IOGraph "https://github.com/Keshav-writes-code/NeuralNetBuilder/blob/master/src/components/NN_comps/NN_IOgraph.svelte"
    
    click Store "https://github.com/Keshav-writes-code/NeuralNetBuilder/blob/master/src/components/store.ts"
    click Home "https://github.com/Keshav-writes-code/NeuralNetBuilder/blob/master/src/pages/home.astro"
    click Index "https://github.com/Keshav-writes-code/NeuralNetBuilder/blob/master/src/pages/index.astro"
    click Actions "https://github.com/Keshav-writes-code/NeuralNetBuilder/blob/master/.github/workflows/deploy.yml"
    
    %% Styling
    classDef astro fill:#4F6BFF,color:white
    classDef svelte fill:#FF3E00,color:white
    classDef core fill:#FFA500,color:white
    classDef state fill:#9F00FF,color:white
    
    %% Legend
    subgraph Legend
        L1["Astro Component"]:::astro
        L2["Svelte Component"]:::svelte
        L3["Core NN Logic"]:::core
        L4["State Management"]:::state
    end
```
