# kazuyaaaadesu/furinaaiproject architecture

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

- Interactive diagram: https://gitdiagram.com/kazuyaaaadesu/furinaaiproject
- Repository: https://github.com/kazuyaaaadesu/furinaaiproject

## Overview

Fufuu is a local desktop companion with a chat interface and switchable Live2D/VRM avatars. The main user workflow runs through the React app: it sends chat requests to a local Ollama service and loads/saves conversation history through a local storage server. Electron starts the desktop windows and local services. The sampled code also confirms avatar rendering and display-mode synchronization. Screenshot/vision handling and several other App capabilities are only partially excerpted, so their connections are omitted where the caller is not visible.

Main entry points: [`electron/main.cjs`](https://github.com/kazuyaaaadesu/furinaaiproject/blob/main/electron/main.cjs) (Electron main), [`src/App.tsx`](https://github.com/kazuyaaaadesu/furinaaiproject/blob/main/src/App.tsx) (Chat app), [`server/server.js`](https://github.com/kazuyaaaadesu/furinaaiproject/blob/main/server/server.js) (Storage API), [`src/Avatar.tsx`](https://github.com/kazuyaaaadesu/furinaaiproject/blob/main/src/Avatar.tsx) (Avatar selector)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Chat interface"]
  node_app["Chat app<br/>[App.tsx]"]
  node_entry["React entry<br/>[main.tsx]"]
end

subgraph group_avatar["Avatar display"]
  node_avatar["Avatar selector<br/>[Avatar.tsx]"]
  node_live2d["Live2D renderer<br/>[Live2DViewer.tsx]"]
  node_liveasset["Live2D model<br/>[Furina.model3.json]"]
  node_vrm["VRM renderer<br/>[VRMViewer.tsx]"]
  node_vrmasset["VRM model<br/>[furina.vrm]"]
end

subgraph group_local["Local services"]
  node_storage["Storage API<br/>[server.js]"]
  node_conversations[("Conversations<br/>[conversations.json]")]
  node_memory[("Memory file<br/>[memory.json]")]
end

subgraph group_desktop["Desktop shell"]
  node_electron["Electron main<br/>[main.cjs]"]
  node_preload["Desktop bridge<br/>[preload.cjs]"]
end

node_user(("User"))
node_ollama["Ollama"]
node_desktopuser(("Desktop user"))

node_user -->|"chats with"| node_app
node_entry -->|"renders"| node_app
node_entry -->|"renders"| node_avatar
node_app -->|"requests response"| node_ollama
node_app -->|"reads and saves"| node_storage
node_storage -->|"reads and writes"| node_conversations
node_storage -->|"initializes"| node_memory
node_avatar -->|"selects 2D"| node_live2d
node_avatar -->|"selects 3D"| node_vrm
node_live2d -->|"loads model"| node_liveasset
node_vrm -->|"loads model"| node_vrmasset
node_electron -->|"starts service"| node_storage
node_electron -->|"opens app URL"| node_entry
node_electron -->|"configures bridge"| node_preload
node_preload -->|"sends IPC"| node_electron
node_desktopuser -.->|"uses desktop app"| node_electron

click node_app "https://github.com/kazuyaaaadesu/furinaaiproject/blob/main/src/App.tsx"
click node_entry "https://github.com/kazuyaaaadesu/furinaaiproject/blob/main/src/main.tsx"
click node_storage "https://github.com/kazuyaaaadesu/furinaaiproject/blob/main/server/server.js"
click node_conversations "https://github.com/kazuyaaaadesu/furinaaiproject/blob/main/data/conversations.json"
click node_memory "https://github.com/kazuyaaaadesu/furinaaiproject/blob/main/data/memory.json"
click node_avatar "https://github.com/kazuyaaaadesu/furinaaiproject/blob/main/src/Avatar.tsx"
click node_live2d "https://github.com/kazuyaaaadesu/furinaaiproject/blob/main/src/Live2DViewer.tsx"
click node_liveasset "https://github.com/kazuyaaaadesu/furinaaiproject/blob/main/public/models/furina-live2d/Furina.model3.json"
click node_vrm "https://github.com/kazuyaaaadesu/furinaaiproject/blob/main/src/VRMViewer.tsx"
click node_vrmasset "https://github.com/kazuyaaaadesu/furinaaiproject/blob/main/public/models/furina.vrm"
click node_electron "https://github.com/kazuyaaaadesu/furinaaiproject/blob/main/electron/main.cjs"
click node_preload "https://github.com/kazuyaaaadesu/furinaaiproject/blob/main/electron/preload.cjs"

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_app,node_entry,node_user,node_desktopuser toneBlue
class node_avatar,node_live2d,node_liveasset,node_vrm,node_vrmasset toneAmber
class node_storage,node_conversations,node_memory toneMint
class node_electron,node_preload toneRose
class node_ollama toneIndigo
```

## Components

### Chat interface

- [Chat app](https://github.com/kazuyaaaadesu/furinaaiproject/blob/main/src/App.tsx): `src/App.tsx`
- [React entry](https://github.com/kazuyaaaadesu/furinaaiproject/blob/main/src/main.tsx): `src/main.tsx`

### Avatar display

- [Avatar selector](https://github.com/kazuyaaaadesu/furinaaiproject/blob/main/src/Avatar.tsx): `src/Avatar.tsx`
- [Live2D renderer](https://github.com/kazuyaaaadesu/furinaaiproject/blob/main/src/Live2DViewer.tsx): `src/Live2DViewer.tsx`
- [Live2D model](https://github.com/kazuyaaaadesu/furinaaiproject/blob/main/public/models/furina-live2d/Furina.model3.json): `public/models/furina-live2d/Furina.model3.json`
- [VRM renderer](https://github.com/kazuyaaaadesu/furinaaiproject/blob/main/src/VRMViewer.tsx): `src/VRMViewer.tsx`
- [VRM model](https://github.com/kazuyaaaadesu/furinaaiproject/blob/main/public/models/furina.vrm): `public/models/furina.vrm`

### Local services

- [Storage API](https://github.com/kazuyaaaadesu/furinaaiproject/blob/main/server/server.js): `server/server.js`
- [Conversations](https://github.com/kazuyaaaadesu/furinaaiproject/blob/main/data/conversations.json): `data/conversations.json`
- [Memory file](https://github.com/kazuyaaaadesu/furinaaiproject/blob/main/data/memory.json): `data/memory.json`

### Desktop shell

- [Electron main](https://github.com/kazuyaaaadesu/furinaaiproject/blob/main/electron/main.cjs): `electron/main.cjs`
- [Desktop bridge](https://github.com/kazuyaaaadesu/furinaaiproject/blob/main/electron/preload.cjs): `electron/preload.cjs`

### Other components

- **User**
- **Ollama**
- **Desktop user**

## Connections

- User → Chat app: chats with (evidence: `src/App.tsx`)
- React entry → Chat app: renders (evidence: `src/main.tsx`)
- React entry → Avatar selector: renders (evidence: `src/main.tsx`)
- Chat app → Ollama: requests response (evidence: `src/App.tsx`)
- Chat app → Storage API: reads and saves (evidence: `src/App.tsx`)
- Storage API → Conversations: reads and writes (evidence: `server/server.js`)
- Storage API → Memory file: initializes (evidence: `server/server.js`)
- Avatar selector → Live2D renderer: selects 2D (evidence: `src/Avatar.tsx`)
- Avatar selector → VRM renderer: selects 3D (evidence: `src/Avatar.tsx`)
- Live2D renderer → Live2D model: loads model (evidence: `src/Live2DViewer.tsx`)
- VRM renderer → VRM model: loads model (evidence: `src/VRMViewer.tsx`)
- Electron main → Storage API: starts service (evidence: `electron/main.cjs`)
- Electron main → React entry: opens app URL (evidence: `electron/main.cjs`)
- Electron main → Desktop bridge: configures bridge (evidence: `electron/main.cjs`)
- Desktop bridge → Electron main: sends IPC (evidence: `electron/preload.cjs`)
- Desktop user → Electron main: uses desktop app
