# jacqueson1/nimo architecture

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

- Interactive diagram: https://gitdiagram.com/jacqueson1/nimo
- Repository: https://github.com/jacqueson1/nimo

## Overview

NIMO is a local desktop chatbot: the user submits a message in the Tauri-hosted chat UI, the frontend streams a reply from FastAPI, and FastAPI streams tokens from local Ollama. The frontend parses the reply’s mood tag and updates the Live2D avatar’s expression and talking state. The README also documents responsive avatar behavior and a separate terminal chat client. The graph reflects the shown frontend, backend, and avatar code; unsampled Tauri configuration and model internals are not inferred.

Main entry points: [`app/src/main.js`](https://github.com/jacqueson1/nimo/blob/main/app/src/main.js) (Chat and mood client), [`backend/main.py`](https://github.com/jacqueson1/nimo/blob/main/backend/main.py) (Chat API), [`app/src/index.html`](https://github.com/jacqueson1/nimo/blob/main/app/src/index.html) (Chat layout), [`app/src-tauri/src/lib.rs`](https://github.com/jacqueson1/nimo/blob/main/app/src-tauri/src/lib.rs) (Tauri shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop app"]
  node_desktop_entry["Tauri launcher<br/>[main.rs]"]
  node_desktop_shell["Tauri shell<br/>[lib.rs]"]
end

subgraph group_chat["Chat workflow"]
  node_chat_layout["Chat layout<br/>[index.html]"]
  node_chat_client["Chat and mood client<br/>[main.js]"]
  node_backend_api["Chat API<br/>[main.py]"]
  node_terminal_chat["Terminal chat<br/>[chat_cli.py]"]
end

subgraph group_avatar["Avatar experience"]
  node_avatar_runtime["Live2D avatar runtime<br/>[avatar.js]"]
  node_mao_assets["Mao model assets"]
end

subgraph group_local_ai["Local AI"]
  node_ollama["Ollama model"]
end

node_user(("User"))

node_user -->|"uses"| node_chat_layout
node_desktop_entry -->|"starts"| node_desktop_shell
node_desktop_shell -->|"hosts"| node_chat_layout
node_chat_layout -->|"runs"| node_chat_client
node_chat_client -->|"streams request"| node_backend_api
node_backend_api -->|"streams chat"| node_ollama
node_ollama -->|"returns tokens"| node_backend_api
node_backend_api -->|"streams tokens"| node_chat_client
node_chat_client -->|"sets mood and talking"| node_avatar_runtime
node_avatar_runtime -->|"loads model"| node_mao_assets
node_terminal_chat -->|"streams chat"| node_ollama

click node_desktop_entry "https://github.com/jacqueson1/nimo/blob/main/app/src-tauri/src/main.rs"
click node_desktop_shell "https://github.com/jacqueson1/nimo/blob/main/app/src-tauri/src/lib.rs"
click node_chat_layout "https://github.com/jacqueson1/nimo/blob/main/app/src/index.html"
click node_chat_client "https://github.com/jacqueson1/nimo/blob/main/app/src/main.js"
click node_backend_api "https://github.com/jacqueson1/nimo/blob/main/backend/main.py"
click node_terminal_chat "https://github.com/jacqueson1/nimo/blob/main/backend/chat_cli.py"
click node_avatar_runtime "https://github.com/jacqueson1/nimo/blob/main/app/src/avatar.js"
click node_mao_assets "https://github.com/jacqueson1/nimo/tree/main/app/src/models/mao"

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_desktop_entry,node_desktop_shell,node_user toneBlue
class node_chat_layout,node_chat_client,node_backend_api,node_terminal_chat toneAmber
class node_avatar_runtime,node_mao_assets toneMint
class node_ollama toneRose
```

## Components

### Desktop app

- [Tauri launcher](https://github.com/jacqueson1/nimo/blob/main/app/src-tauri/src/main.rs): `app/src-tauri/src/main.rs`
- [Tauri shell](https://github.com/jacqueson1/nimo/blob/main/app/src-tauri/src/lib.rs): `app/src-tauri/src/lib.rs`

### Chat workflow

- [Chat layout](https://github.com/jacqueson1/nimo/blob/main/app/src/index.html): `app/src/index.html`
- [Chat and mood client](https://github.com/jacqueson1/nimo/blob/main/app/src/main.js): `app/src/main.js`
- [Chat API](https://github.com/jacqueson1/nimo/blob/main/backend/main.py): `backend/main.py`
- [Terminal chat](https://github.com/jacqueson1/nimo/blob/main/backend/chat_cli.py): `backend/chat_cli.py`

### Avatar experience

- [Live2D avatar runtime](https://github.com/jacqueson1/nimo/blob/main/app/src/avatar.js): `app/src/avatar.js`
- [Mao model assets](https://github.com/jacqueson1/nimo/tree/main/app/src/models/mao): `app/src/models/mao`

### Local AI

- **Ollama model**

### Other components

- **User**

## Connections

- User → Chat layout: uses (evidence: `README.md`)
- Tauri launcher → Tauri shell: starts (evidence: `app/src-tauri/src/main.rs`)
- Tauri shell → Chat layout: hosts (evidence: `README.md`)
- Chat layout → Chat and mood client: runs (evidence: `README.md`)
- Chat and mood client → Chat API: streams request (evidence: `app/src/main.js`)
- Chat API → Ollama model: streams chat (evidence: `backend/main.py`)
- Ollama model → Chat API: returns tokens (evidence: `backend/main.py`)
- Chat API → Chat and mood client: streams tokens (evidence: `README.md`)
- Chat and mood client → Live2D avatar runtime: sets mood and talking (evidence: `app/src/main.js`)
- Live2D avatar runtime → Mao model assets: loads model (evidence: `app/src/avatar.js`)
- Terminal chat → Ollama model: streams chat (evidence: `backend/chat_cli.py`)
