# devamsolanki009/autosim-2 architecture

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

- Interactive diagram: https://gitdiagram.com/devamsolanki009/autosim-2
- Repository: https://github.com/devamsolanki009/autosim-2

## Overview

AutoSim is a web-based differential-equation solving platform: users enter an equation or natural-language problem, configure a run, receive computed and optionally verified results, and inspect plots, derivations, explanations, and run history. The graph follows the documented browser-to-API workflow and preserves the solver, verification, and LLM capabilities listed in the README. Some backend calls are supported by the SOURCE INDEX rather than complete excerpts; unsampled connections are omitted where ownership is unclear.

Main entry points: [`api/main.py`](https://github.com/devamsolanki009/autosim-2/blob/main/api/main.py) (FastAPI endpoints), [`autosim-frontend/app/page.tsx`](https://github.com/devamsolanki009/autosim-2/blob/main/autosim-frontend/app/page.tsx) (App orchestrator), [`llm_integration/enhanced_solver.py`](https://github.com/devamsolanki009/autosim-2/blob/main/llm_integration/enhanced_solver.py) (Enhanced solver), [`autosim-frontend/app/components/SolverWorkspace.tsx`](https://github.com/devamsolanki009/autosim-2/blob/main/autosim-frontend/app/components/SolverWorkspace.tsx) (Solver workspace)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web interface"]
  node_workspace["Solver workspace"]
  node_page["App orchestrator<br/>[page.tsx]"]
  node_plots["Interactive plots<br/>[PlotlyPanel.tsx]"]
  node_plot_view["Plot interactions"]
  node_results["Result tabs<br/>[ResultTabs.tsx]"]
end

subgraph group_backend["API workflow"]
  node_api["FastAPI endpoints<br/>[main.py]"]
  node_verification["Solution verification<br/>[verifier.py]"]
  node_solver_engine["Solver generation<br/>[solver_engine.py]"]
end

subgraph group_solvers["Equation solving"]
  node_parser["Equation parser<br/>[parser.py]"]
  node_router["Solver router<br/>[router.py]"]
  node_euler["Euler solver<br/>[euler.py]"]
  node_numerical["Numerical solver<br/>[numerical.py]"]
  node_symbolic["Symbolic solver<br/>[symbolic.py]"]
  node_laplace["Laplace solver<br/>[laplace.py]"]
end

subgraph group_llm["Language assistance"]
  node_enhanced["Enhanced solver<br/>[enhanced_solver.py]"]
  node_nl_parser["Natural-language parser<br/>[nl_pde_parser.py]"]
  node_deepseek["LLM interface"]
end

node_user(("User"))
node_ollama{{"Ollama service"}}

node_user -->|"enters problem"| node_workspace
node_page -->|"renders"| node_workspace
node_workspace -->|"submits inputs"| node_page
node_page -->|"POST solve"| node_api
node_api -->|"parses equation"| node_parser
node_api -->|"routes solver"| node_router
node_api -->|"dispatches"| node_euler
node_api -->|"dispatches"| node_numerical
node_api -->|"dispatches"| node_symbolic
node_api -->|"dispatches"| node_laplace
node_api -->|"verifies solution"| node_verification
node_api -->|"generates solver"| node_solver_engine
node_api -->|"returns results"| node_page
node_page -->|"renders plots"| node_plots
node_page -->|"renders results"| node_results
node_plots -->|"uses interactions"| node_plot_view
node_enhanced -->|"parses descriptions"| node_nl_parser
node_enhanced -->|"requests explanations"| node_deepseek
node_deepseek -->|"sends requests"| node_ollama
node_enhanced -.->|"optional integration"| node_api

click node_workspace "https://github.com/devamsolanki009/autosim-2/blob/main/autosim-frontend/app/components/SolverWorkspace.tsx"
click node_page "https://github.com/devamsolanki009/autosim-2/blob/main/autosim-frontend/app/page.tsx"
click node_plots "https://github.com/devamsolanki009/autosim-2/blob/main/autosim-frontend/app/components/PlotlyPanel.tsx"
click node_plot_view "https://github.com/devamsolanki009/autosim-2/blob/main/autosim-frontend/app/components/InteractivePlot.tsx"
click node_results "https://github.com/devamsolanki009/autosim-2/blob/main/autosim-frontend/app/components/ResultTabs.tsx"
click node_api "https://github.com/devamsolanki009/autosim-2/blob/main/api/main.py"
click node_parser "https://github.com/devamsolanki009/autosim-2/blob/main/core/parser.py"
click node_router "https://github.com/devamsolanki009/autosim-2/blob/main/core/router.py"
click node_euler "https://github.com/devamsolanki009/autosim-2/blob/main/solvers/euler.py"
click node_numerical "https://github.com/devamsolanki009/autosim-2/blob/main/solvers/numerical.py"
click node_symbolic "https://github.com/devamsolanki009/autosim-2/blob/main/solvers/symbolic.py"
click node_laplace "https://github.com/devamsolanki009/autosim-2/blob/main/solvers/laplace.py"
click node_verification "https://github.com/devamsolanki009/autosim-2/blob/main/utils/verifier.py"
click node_solver_engine "https://github.com/devamsolanki009/autosim-2/blob/main/utils/solver_engine.py"
click node_enhanced "https://github.com/devamsolanki009/autosim-2/blob/main/llm_integration/enhanced_solver.py"
click node_nl_parser "https://github.com/devamsolanki009/autosim-2/blob/main/llm_integration/nl_pde_parser.py"
click node_deepseek "https://github.com/devamsolanki009/autosim-2/blob/main/llm_integration/deepseek_interface.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_workspace,node_page,node_plots,node_plot_view,node_results,node_user toneBlue
class node_api,node_verification,node_solver_engine toneAmber
class node_parser,node_router,node_euler,node_numerical,node_symbolic,node_laplace toneMint
class node_enhanced,node_nl_parser,node_deepseek toneRose
class node_ollama toneIndigo
```

## Components

### Web interface

- [Solver workspace](https://github.com/devamsolanki009/autosim-2/blob/main/autosim-frontend/app/components/SolverWorkspace.tsx): `autosim-frontend/app/components/SolverWorkspace.tsx`
- [App orchestrator](https://github.com/devamsolanki009/autosim-2/blob/main/autosim-frontend/app/page.tsx): `autosim-frontend/app/page.tsx`
- [Interactive plots](https://github.com/devamsolanki009/autosim-2/blob/main/autosim-frontend/app/components/PlotlyPanel.tsx): `autosim-frontend/app/components/PlotlyPanel.tsx`
- [Plot interactions](https://github.com/devamsolanki009/autosim-2/blob/main/autosim-frontend/app/components/InteractivePlot.tsx): `autosim-frontend/app/components/InteractivePlot.tsx`
- [Result tabs](https://github.com/devamsolanki009/autosim-2/blob/main/autosim-frontend/app/components/ResultTabs.tsx): `autosim-frontend/app/components/ResultTabs.tsx`

### API workflow

- [FastAPI endpoints](https://github.com/devamsolanki009/autosim-2/blob/main/api/main.py): `api/main.py`
- [Solution verification](https://github.com/devamsolanki009/autosim-2/blob/main/utils/verifier.py): `utils/verifier.py`
- [Solver generation](https://github.com/devamsolanki009/autosim-2/blob/main/utils/solver_engine.py): `utils/solver_engine.py`

### Equation solving

- [Equation parser](https://github.com/devamsolanki009/autosim-2/blob/main/core/parser.py): `core/parser.py`
- [Solver router](https://github.com/devamsolanki009/autosim-2/blob/main/core/router.py): `core/router.py`
- [Euler solver](https://github.com/devamsolanki009/autosim-2/blob/main/solvers/euler.py): `solvers/euler.py`
- [Numerical solver](https://github.com/devamsolanki009/autosim-2/blob/main/solvers/numerical.py): `solvers/numerical.py`
- [Symbolic solver](https://github.com/devamsolanki009/autosim-2/blob/main/solvers/symbolic.py): `solvers/symbolic.py`
- [Laplace solver](https://github.com/devamsolanki009/autosim-2/blob/main/solvers/laplace.py): `solvers/laplace.py`

### Language assistance

- [Enhanced solver](https://github.com/devamsolanki009/autosim-2/blob/main/llm_integration/enhanced_solver.py): `llm_integration/enhanced_solver.py`
- [Natural-language parser](https://github.com/devamsolanki009/autosim-2/blob/main/llm_integration/nl_pde_parser.py): `llm_integration/nl_pde_parser.py`
- [LLM interface](https://github.com/devamsolanki009/autosim-2/blob/main/llm_integration/deepseek_interface.py): `llm_integration/deepseek_interface.py`

### Other components

- **User**
- **Ollama service**

## Connections

- User → Solver workspace: enters problem (evidence: `README.md`)
- App orchestrator → Solver workspace: renders (evidence: `autosim-frontend/app/page.tsx`)
- Solver workspace → App orchestrator: submits inputs (evidence: `autosim-frontend/app/page.tsx`)
- App orchestrator → FastAPI endpoints: POST solve (evidence: `autosim-frontend/app/page.tsx`)
- FastAPI endpoints → Equation parser: parses equation (evidence: `api/main.py`)
- FastAPI endpoints → Solver router: routes solver (evidence: `api/main.py`)
- FastAPI endpoints → Euler solver: dispatches (evidence: `api/main.py`)
- FastAPI endpoints → Numerical solver: dispatches (evidence: `api/main.py`)
- FastAPI endpoints → Symbolic solver: dispatches (evidence: `api/main.py`)
- FastAPI endpoints → Laplace solver: dispatches (evidence: `api/main.py`)
- FastAPI endpoints → Solution verification: verifies solution (evidence: `api/main.py`)
- FastAPI endpoints → Solver generation: generates solver (evidence: `api/main.py`)
- FastAPI endpoints → App orchestrator: returns results (evidence: `README.md`)
- App orchestrator → Interactive plots: renders plots (evidence: `autosim-frontend/app/page.tsx`)
- App orchestrator → Result tabs: renders results (evidence: `autosim-frontend/app/page.tsx`)
- Interactive plots → Plot interactions: uses interactions (evidence: `autosim-frontend/app/components/PlotlyPanel.tsx`)
- Enhanced solver → Natural-language parser: parses descriptions (evidence: `llm_integration/enhanced_solver.py`)
- Enhanced solver → LLM interface: requests explanations (evidence: `llm_integration/enhanced_solver.py`)
- LLM interface → Ollama service: sends requests (evidence: `llm_integration/deepseek_interface.py`)
- Enhanced solver → FastAPI endpoints: optional integration
