# danielballardp/project-assistant architecture

> Architecture diagram of the GitHub repository danielballardp/project-assistant, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/danielballardp/project-assistant
- Repository: https://github.com/danielballardp/project-assistant

## Overview

Project Assistant is a small web-based German project Q&A chat backed by an OpenAI-compatible model server. The main workflow is a user message sent by the browser to FastAPI, where a system prompt and user message are passed to the chat client; responses can be streamed back as server-sent events. The package also implements an embedding client, but the sampled runtime shows no retrieval or document-store integration. The README is empty, so no additional documented product capabilities can be confirmed.

Main entry points: [`src/project_assistant/main.py`](https://github.com/danielballardp/project-assistant/blob/main/src/project_assistant/main.py) (HTTP API), [`src/project_assistant/llm.py`](https://github.com/danielballardp/project-assistant/blob/main/src/project_assistant/llm.py) (Chat client), [`src/project_assistant/static/app.js`](https://github.com/danielballardp/project-assistant/blob/main/src/project_assistant/static/app.js) (Chat UI), [`src/project_assistant/config.py`](https://github.com/danielballardp/project-assistant/blob/main/src/project_assistant/config.py) (Settings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Chat interaction"]
  node_browser["Chat UI<br/>[app.js]"]
  node_api["HTTP API<br/>[main.py]"]
  node_prompt["System prompt<br/>[prompts.py]"]
end

subgraph group_inference["Model clients"]
  node_chat_client["Chat client<br/>[llm.py]"]
  node_embedding_client["Embedding client<br/>[llm.py]"]
end

subgraph group_configuration["Configuration"]
  node_settings["Settings<br/>[config.py]"]
end

node_user(("Project user"))
node_model_server{{"OpenAI-compatible server"}}

node_user -->|"enters message"| node_browser
node_browser -->|"posts stream request"| node_api
node_api -->|"uses prompt"| node_prompt
node_api -->|"requests chat stream"| node_chat_client
node_chat_client -->|"sends chat and receives tokens"| node_model_server
node_api -->|"streams events"| node_browser
node_chat_client -->|"reads model settings"| node_settings
node_embedding_client -->|"requests embeddings"| node_model_server
node_embedding_client -->|"reads embedding settings"| node_settings
node_api -->|"reads app settings"| node_settings

click node_browser "https://github.com/danielballardp/project-assistant/blob/main/src/project_assistant/static/app.js"
click node_api "https://github.com/danielballardp/project-assistant/blob/main/src/project_assistant/main.py"
click node_prompt "https://github.com/danielballardp/project-assistant/blob/main/src/project_assistant/prompts.py"
click node_chat_client "https://github.com/danielballardp/project-assistant/blob/main/src/project_assistant/llm.py"
click node_embedding_client "https://github.com/danielballardp/project-assistant/blob/main/src/project_assistant/llm.py"
click node_settings "https://github.com/danielballardp/project-assistant/blob/main/src/project_assistant/config.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_browser,node_api,node_prompt,node_user toneBlue
class node_chat_client,node_embedding_client toneAmber
class node_settings,node_model_server toneMint
```

## Components

### Chat interaction

- [Chat UI](https://github.com/danielballardp/project-assistant/blob/main/src/project_assistant/static/app.js): `src/project_assistant/static/app.js`
- [HTTP API](https://github.com/danielballardp/project-assistant/blob/main/src/project_assistant/main.py): `src/project_assistant/main.py`
- [System prompt](https://github.com/danielballardp/project-assistant/blob/main/src/project_assistant/prompts.py): `src/project_assistant/prompts.py`

### Model clients

- [Chat client](https://github.com/danielballardp/project-assistant/blob/main/src/project_assistant/llm.py): `src/project_assistant/llm.py`
- [Embedding client](https://github.com/danielballardp/project-assistant/blob/main/src/project_assistant/llm.py): `src/project_assistant/llm.py`

### Configuration

- [Settings](https://github.com/danielballardp/project-assistant/blob/main/src/project_assistant/config.py): `src/project_assistant/config.py`

### Other components

- **Project user**
- **OpenAI-compatible server**

## Connections

- Project user → Chat UI: enters message (evidence: `src/project_assistant/static/app.js`)
- Chat UI → HTTP API: posts stream request (evidence: `src/project_assistant/static/app.js`)
- HTTP API → System prompt: uses prompt (evidence: `src/project_assistant/main.py`)
- HTTP API → Chat client: requests chat stream (evidence: `src/project_assistant/main.py`)
- Chat client → OpenAI-compatible server: sends chat and receives tokens (evidence: `src/project_assistant/llm.py`)
- HTTP API → Chat UI: streams events (evidence: `src/project_assistant/main.py`)
- Chat client → Settings: reads model settings (evidence: `src/project_assistant/llm.py`)
- Embedding client → OpenAI-compatible server: requests embeddings (evidence: `src/project_assistant/llm.py`)
- Embedding client → Settings: reads embedding settings (evidence: `src/project_assistant/llm.py`)
- HTTP API → Settings: reads app settings (evidence: `src/project_assistant/main.py`)
