# goudham-b/bimmer-bot architecture

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

- Interactive diagram: https://gitdiagram.com/goudham-b/bimmer-bot
- Repository: https://github.com/goudham-b/bimmer-bot

## Overview

BimmerBot is a BMW-focused chat application with a separate Parts.csv analysis task. The main workflow runs from the browser chat over WebSocket to the FastAPI chat controller, which classifies the query and either streams an LLM reply or invokes parts analysis. Parts analysis detects the CSV separator with the LLM, validates the rows, loads valid data with pandas, and returns descriptive statistics. The README also documents a separator-detection endpoint. The graph follows shown calls and the README-described product; unsampled frontend components and deployment details are not expanded.

Main entry points: [`api/src/controllers/llm_controller.py`](https://github.com/goudham-b/bimmer-bot/blob/master/api/src/controllers/llm_controller.py) (Chat controller), [`webapp/src/App.jsx`](https://github.com/goudham-b/bimmer-bot/blob/master/webapp/src/App.jsx) (Chat UI), [`api/src/services/parts_service.py`](https://github.com/goudham-b/bimmer-bot/blob/master/api/src/services/parts_service.py) (Parts analysis), [`api/src/services/llm_service.py`](https://github.com/goudham-b/bimmer-bot/blob/master/api/src/services/llm_service.py) (LLM service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Chat interface"]
  node_chat_ui["Chat UI<br/>[App.jsx]"]
  node_app_mount["React entry<br/>[main.jsx]"]
end

subgraph group_api["API and routing"]
  node_fastapi["FastAPI app<br/>[main.py]"]
  node_chat_controller["Chat controller<br/>[llm_controller.py]"]
end

subgraph group_language["Language model"]
  node_llm_service["LLM service<br/>[llm_service.py]"]
end

subgraph group_parts["Parts analysis"]
  node_parts_service["Parts analysis<br/>[parts_service.py]"]
  node_parts_csv["Parts dataset<br/>[Parts.csv]"]
end

node_user(("Chat user"))

node_app_mount -->|"renders"| node_chat_ui
node_user -->|"submits query"| node_chat_ui
node_chat_ui -->|"sends WebSocket messages"| node_chat_controller
node_chat_controller -->|"streams responses"| node_chat_ui
node_fastapi -->|"mounts router"| node_chat_controller
node_chat_controller -->|"classifies and generates"| node_llm_service
node_chat_controller -->|"runs task analysis"| node_parts_service
node_parts_service -->|"reads dataset"| node_parts_csv
node_parts_service -->|"detects separator"| node_llm_service
node_chat_controller -->|"detects separator"| node_llm_service

click node_chat_ui "https://github.com/goudham-b/bimmer-bot/blob/master/webapp/src/App.jsx"
click node_app_mount "https://github.com/goudham-b/bimmer-bot/blob/master/webapp/src/main.jsx"
click node_fastapi "https://github.com/goudham-b/bimmer-bot/blob/master/api/src/main.py"
click node_chat_controller "https://github.com/goudham-b/bimmer-bot/blob/master/api/src/controllers/llm_controller.py"
click node_llm_service "https://github.com/goudham-b/bimmer-bot/blob/master/api/src/services/llm_service.py"
click node_parts_service "https://github.com/goudham-b/bimmer-bot/blob/master/api/src/services/parts_service.py"
click node_parts_csv "https://github.com/goudham-b/bimmer-bot/blob/master/api/src/datasets/Parts.csv"

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_chat_ui,node_app_mount,node_user toneBlue
class node_fastapi,node_chat_controller toneAmber
class node_llm_service toneMint
class node_parts_service,node_parts_csv toneRose
```

## Components

### Chat interface

- [Chat UI](https://github.com/goudham-b/bimmer-bot/blob/master/webapp/src/App.jsx): `webapp/src/App.jsx`
- [React entry](https://github.com/goudham-b/bimmer-bot/blob/master/webapp/src/main.jsx): `webapp/src/main.jsx`

### API and routing

- [FastAPI app](https://github.com/goudham-b/bimmer-bot/blob/master/api/src/main.py): `api/src/main.py`
- [Chat controller](https://github.com/goudham-b/bimmer-bot/blob/master/api/src/controllers/llm_controller.py): `api/src/controllers/llm_controller.py`

### Language model

- [LLM service](https://github.com/goudham-b/bimmer-bot/blob/master/api/src/services/llm_service.py): `api/src/services/llm_service.py`

### Parts analysis

- [Parts analysis](https://github.com/goudham-b/bimmer-bot/blob/master/api/src/services/parts_service.py): `api/src/services/parts_service.py`
- [Parts dataset](https://github.com/goudham-b/bimmer-bot/blob/master/api/src/datasets/Parts.csv): `api/src/datasets/Parts.csv`

### Other components

- **Chat user**

## Connections

- React entry → Chat UI: renders (evidence: `webapp/src/main.jsx`)
- Chat user → Chat UI: submits query (evidence: `webapp/src/App.jsx`)
- Chat UI → Chat controller: sends WebSocket messages (evidence: `webapp/src/App.jsx`)
- Chat controller → Chat UI: streams responses (evidence: `api/src/controllers/llm_controller.py`)
- FastAPI app → Chat controller: mounts router (evidence: `api/src/main.py`)
- Chat controller → LLM service: classifies and generates (evidence: `api/src/controllers/llm_controller.py`)
- Chat controller → Parts analysis: runs task analysis (evidence: `api/src/controllers/llm_controller.py`)
- Parts analysis → Parts dataset: reads dataset (evidence: `api/src/services/parts_service.py`)
- Parts analysis → LLM service: detects separator (evidence: `api/src/services/parts_service.py`)
- Chat controller → LLM service: detects separator (evidence: `api/src/controllers/llm_controller.py`)
