# anishlearnstocode/state-diagram-generator architecture

> Architecture diagram of the GitHub repository anishlearnstocode/state-diagram-generator, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-09-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/anishlearnstocode/state-diagram-generator
- Repository: https://github.com/anishlearnstocode/state-diagram-generator

## Overview

##### Project type and purpose
- This is a single-page front-end web application built with Angular and TypeScript.

##### File structure
- Top-level Angular config files: angular.json, tsconfig*.json, tslint.json, package.json, karma.conf.js, protractor.conf.js.
- No “backend” directory—this is purely client-side.
- src/app contains:
- app.module.ts, app-routing.module.ts – root module and router setup
- Components: DashboardComponent (main UI), DynamicMessageComponent (alerts/messages), AppComponent (shell)
- src/assets, src/environments – static assets and environment configs (dev/prod)
- e2e & spec files – end-to-end and unit tests
- firebase.json & .firebaserc – configuration for Firebase Hosting

##### README for additional insights
- Confirms it’s a Theory of Computation learning tool.
- Mentions demo via GitHub Pages / Firebase.
- No separate API server—entire automaton construction runs in the client.

##### Detail
- Every logical layer: Presentation, Domain, Build, Deployment.
- Don’t over-complicate—represent all components you identified in the file tree.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Presentation Layer
    subgraph "Presentation Layer"
        Browser["User Browser"]:::external
        Router["App Routing\n(src/app/app-routing.module.ts)"]:::service
        AppShell["AppComponent (Shell)"]:::ui
        Dashboard["DashboardComponent"]:::ui
        DynamicMsg["DynamicMessageComponent"]:::ui
    end

    %% Domain Layer
    subgraph "Domain & Business Logic"
        SvgService["SvgRendererService"]:::service
        Automata["automata.ts"]:::model
        FSM["finite-state-machine.ts"]:::model
        Transition["transition.ts"]:::model
        Transitions["transitions.ts"]:::model
        StateDiagram["transition-state-diagram.ts"]:::model
    end

    %% Build & Toolchain
    subgraph "Build & Toolchain"
        NodeNpm["Node.js / npm"]:::toolchain
        AngularCLI["Angular CLI"]:::toolchain
        TSC["TypeScript Compiler"]:::toolchain
        Bundler["Webpack Bundler"]:::toolchain
        IndexBundle["index.html + main.js"]:::toolchain
    end

    %% Deployment
    subgraph "Deployment"
        GitPush["git push"]:::deployment
        FirebaseCLI["Firebase CLI"]:::deployment
        Hosted["Hosted Site\n(Firebase Hosting)"]:::deployment
    end

    %% Connections
    Browser --> Router
    Router --> AppShell
    AppShell --> Dashboard
    AppShell --> DynamicMsg

    Dashboard -->|"uses service"| SvgService
    SvgService -->|"returns SVG"| Dashboard
    Dashboard -->|"bind SVG to DOM"| Browser

    Dashboard -->|"create/mutate"| Automata
    Dashboard --> FSM
    Dashboard --> Transition
    Dashboard --> Transitions
    Dashboard --> StateDiagram

    NodeNpm --> AngularCLI --> TSC --> Bundler --> IndexBundle --> Browser

    GitPush --> FirebaseCLI --> Hosted

    %% Click Events
    click Router "https://github.com/anishlearnstocode/state-diagram-generator/blob/master/src/app/app-routing.module.ts"
    click AppShell "https://github.com/anishlearnstocode/state-diagram-generator/blob/master/src/app/app.component.ts"
    click Dashboard "https://github.com/anishlearnstocode/state-diagram-generator/blob/master/src/app/dashboard/dashboard.component.ts"
    click DynamicMsg "https://github.com/anishlearnstocode/state-diagram-generator/blob/master/src/app/dynamic-message/dynamic-message.component.ts"
    click SvgService "https://github.com/anishlearnstocode/state-diagram-generator/blob/master/src/app/svg-renderer.service.ts"
    click Automata "https://github.com/anishlearnstocode/state-diagram-generator/blob/master/src/app/models/automata.ts"
    click FSM "https://github.com/anishlearnstocode/state-diagram-generator/blob/master/src/app/models/finite-state-machine.ts"
    click Transition "https://github.com/anishlearnstocode/state-diagram-generator/blob/master/src/app/models/transition.ts"
    click Transitions "https://github.com/anishlearnstocode/state-diagram-generator/blob/master/src/app/models/transitions.ts"
    click StateDiagram "https://github.com/anishlearnstocode/state-diagram-generator/blob/master/src/app/models/transition-state-diagram.ts"

    %% Styles
    classDef ui fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef service fill:#90EE90,stroke:#000,stroke-width:1px
    classDef model fill:#98FB98,stroke:#000,stroke-width:1px
    classDef toolchain fill:#FFA500,stroke:#000,stroke-width:1px
    classDef deployment fill:#D3D3D3,stroke:#000,stroke-width:1px
    classDef external fill:#EEEEEE,stroke:#000,stroke-width:1px
```
