# thesysdev/open-intelligent-ui architecture

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

- Interactive diagram: https://gitdiagram.com/thesysdev/open-intelligent-ui
- Repository: https://github.com/thesysdev/open-intelligent-ui

## Overview

Open Intelligent UI turns a user’s prompt into a streamed, interactive answer: the chat page sends the conversation to a server endpoint, which selects a model backend and returns OpenUI Lang for rendering through the app’s component library. Travel answers add editable itinerary state, photos and an interactive map; server routes provide cached Wikipedia and street-route data. The source excerpts establish the main wiring, while the README documents several integrations and behaviors whose implementation was not sampled.

Main entry points: [`src/lib/travel/map.tsx`](https://github.com/thesysdev/open-intelligent-ui/blob/main/src/lib/travel/map.tsx) (Interactive map), [`src/app/api/chat/route.ts`](https://github.com/thesysdev/open-intelligent-ui/blob/main/src/app/api/chat/route.ts) (Chat endpoint), [`src/app/page.tsx`](https://github.com/thesysdev/open-intelligent-ui/blob/main/src/app/page.tsx) (Chat page), [`src/lib/travel/components.tsx`](https://github.com/thesysdev/open-intelligent-ui/blob/main/src/lib/travel/components.tsx) (Travel components)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Chat application"]
  node_page["Chat page<br/>[page.tsx]"]
  node_chat["Chat endpoint<br/>[route.ts]"]
end

subgraph group_generation["Generation"]
  node_gateway["OpenUI Gateway"]
  node_ollama["Ollama model"]
  node_prompts["Prompt options<br/>[prompt-options.ts]"]
  node_library["Component library<br/>[library.ts]"]
end

subgraph group_travel["Travel answer"]
  node_routecard["Route response card<br/>[root.tsx]"]
  node_travelcomponents["Travel components<br/>[components.tsx]"]
  node_routestore["Route state<br/>[store.ts]"]
  node_map["Interactive map<br/>[map.tsx]"]
  node_maputils["Map utilities<br/>[map-utils.ts]"]
  node_dialog["Map dialog<br/>[use-dialog.ts]"]
  node_streetfetch["Street route hook"]
  node_basemap["Map basemap<br/>[vector-basemap.ts]"]
end

subgraph group_services["Data and theme"]
  node_wikiapi["Wikipedia route<br/>[route.ts]"]
  node_streetapi["Street route API<br/>[route.ts]"]
  node_theme["Response theme<br/>[response-theme.ts]"]
end

node_traveler(("User"))
node_wikipedia["Wikipedia"]
node_osrm["OSRM"]
node_maptiles["Map tile service"]

node_traveler -->|"starts chat"| node_page
node_page -->|"sends conversation"| node_chat
node_chat -->|"uses prompts"| node_prompts
node_chat -->|"requests generation"| node_gateway
node_chat -.->|"optionally requests"| node_ollama
node_chat -->|"streams response"| node_page
node_page -->|"renders with"| node_library
node_page -->|"configures theme"| node_theme
node_library -->|"registers root"| node_routecard
node_library -->|"registers components"| node_travelcomponents
node_routecard -->|"renders"| node_travelcomponents
node_routecard -->|"provides state"| node_routestore
node_travelcomponents -->|"reads and updates"| node_routestore
node_travelcomponents -->|"renders map"| node_map
node_map -->|"reads and updates"| node_routestore
node_map -->|"uses utilities"| node_maputils
node_map -->|"uses dialog hook"| node_dialog
node_map -->|"uses route hook"| node_streetfetch
node_map -->|"loads basemap"| node_basemap
node_routestore -->|"fetches place data"| node_wikiapi
node_wikiapi -->|"looks up places"| node_wikipedia
node_streetfetch -.->|"requests geometry"| node_streetapi
node_streetapi -->|"requests road route"| node_osrm
node_basemap -->|"loads map tiles"| node_maptiles

click node_page "https://github.com/thesysdev/open-intelligent-ui/blob/main/src/app/page.tsx"
click node_chat "https://github.com/thesysdev/open-intelligent-ui/blob/main/src/app/api/chat/route.ts"
click node_prompts "https://github.com/thesysdev/open-intelligent-ui/blob/main/src/lib/prompt-options.ts"
click node_library "https://github.com/thesysdev/open-intelligent-ui/blob/main/src/lib/library.ts"
click node_routecard "https://github.com/thesysdev/open-intelligent-ui/blob/main/src/lib/route/root.tsx"
click node_travelcomponents "https://github.com/thesysdev/open-intelligent-ui/blob/main/src/lib/travel/components.tsx"
click node_routestore "https://github.com/thesysdev/open-intelligent-ui/blob/main/src/lib/route/store.ts"
click node_map "https://github.com/thesysdev/open-intelligent-ui/blob/main/src/lib/travel/map.tsx"
click node_maputils "https://github.com/thesysdev/open-intelligent-ui/blob/main/src/lib/travel/map-utils.ts"
click node_dialog "https://github.com/thesysdev/open-intelligent-ui/blob/main/src/lib/travel/use-dialog.ts"
click node_streetfetch "https://github.com/thesysdev/open-intelligent-ui/blob/main/src/lib/travel/use-street-route.ts"
click node_basemap "https://github.com/thesysdev/open-intelligent-ui/blob/main/src/lib/travel/vector-basemap.ts"
click node_wikiapi "https://github.com/thesysdev/open-intelligent-ui/blob/main/src/app/api/wiki/route.ts"
click node_streetapi "https://github.com/thesysdev/open-intelligent-ui/blob/main/src/app/api/street-route/route.ts"
click node_theme "https://github.com/thesysdev/open-intelligent-ui/blob/main/src/lib/response-theme.ts"

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_page,node_chat,node_traveler toneBlue
class node_gateway,node_ollama,node_prompts,node_library toneAmber
class node_routecard,node_travelcomponents,node_routestore,node_map,node_maputils,node_dialog,node_streetfetch,node_basemap toneMint
class node_wikiapi,node_streetapi,node_theme toneRose
class node_wikipedia,node_osrm,node_maptiles toneIndigo
```

## Components

### Chat application

- [Chat page](https://github.com/thesysdev/open-intelligent-ui/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Chat endpoint](https://github.com/thesysdev/open-intelligent-ui/blob/main/src/app/api/chat/route.ts): `src/app/api/chat/route.ts`

### Generation

- **OpenUI Gateway**
- **Ollama model**
- [Prompt options](https://github.com/thesysdev/open-intelligent-ui/blob/main/src/lib/prompt-options.ts): `src/lib/prompt-options.ts`
- [Component library](https://github.com/thesysdev/open-intelligent-ui/blob/main/src/lib/library.ts): `src/lib/library.ts`

### Travel answer

- [Route response card](https://github.com/thesysdev/open-intelligent-ui/blob/main/src/lib/route/root.tsx): `src/lib/route/root.tsx`
- [Travel components](https://github.com/thesysdev/open-intelligent-ui/blob/main/src/lib/travel/components.tsx): `src/lib/travel/components.tsx`
- [Route state](https://github.com/thesysdev/open-intelligent-ui/blob/main/src/lib/route/store.ts): `src/lib/route/store.ts`
- [Interactive map](https://github.com/thesysdev/open-intelligent-ui/blob/main/src/lib/travel/map.tsx): `src/lib/travel/map.tsx`
- [Map utilities](https://github.com/thesysdev/open-intelligent-ui/blob/main/src/lib/travel/map-utils.ts): `src/lib/travel/map-utils.ts`
- [Map dialog](https://github.com/thesysdev/open-intelligent-ui/blob/main/src/lib/travel/use-dialog.ts): `src/lib/travel/use-dialog.ts`
- [Street route hook](https://github.com/thesysdev/open-intelligent-ui/blob/main/src/lib/travel/use-street-route.ts): `src/lib/travel/use-street-route.ts`
- [Map basemap](https://github.com/thesysdev/open-intelligent-ui/blob/main/src/lib/travel/vector-basemap.ts): `src/lib/travel/vector-basemap.ts`

### Data and theme

- [Wikipedia route](https://github.com/thesysdev/open-intelligent-ui/blob/main/src/app/api/wiki/route.ts): `src/app/api/wiki/route.ts`
- [Street route API](https://github.com/thesysdev/open-intelligent-ui/blob/main/src/app/api/street-route/route.ts): `src/app/api/street-route/route.ts`
- [Response theme](https://github.com/thesysdev/open-intelligent-ui/blob/main/src/lib/response-theme.ts): `src/lib/response-theme.ts`

### Other components

- **User**
- **Wikipedia**
- **OSRM**
- **Map tile service**

## Connections

- User → Chat page: starts chat (evidence: `README.md`)
- Chat page → Chat endpoint: sends conversation (evidence: `src/app/page.tsx`)
- Chat endpoint → Prompt options: uses prompts (evidence: `src/app/api/chat/route.ts`)
- Chat endpoint → OpenUI Gateway: requests generation (evidence: `src/app/api/chat/route.ts`)
- Chat endpoint → Ollama model: optionally requests (evidence: `src/app/api/chat/route.ts`)
- Chat endpoint → Chat page: streams response (evidence: `src/app/api/chat/route.ts`)
- Chat page → Component library: renders with (evidence: `src/app/page.tsx`)
- Chat page → Response theme: configures theme (evidence: `src/app/page.tsx`)
- Component library → Route response card: registers root (evidence: `src/lib/library.ts`)
- Component library → Travel components: registers components (evidence: `src/lib/library.ts`)
- Route response card → Travel components: renders (evidence: `src/lib/route/root.tsx`)
- Route response card → Route state: provides state (evidence: `src/lib/route/root.tsx`)
- Travel components → Route state: reads and updates (evidence: `src/lib/travel/components.tsx`)
- Travel components → Interactive map: renders map (evidence: `src/lib/travel/components.tsx`)
- Interactive map → Route state: reads and updates (evidence: `src/lib/travel/map.tsx`)
- Interactive map → Map utilities: uses utilities (evidence: `src/lib/travel/map.tsx`)
- Interactive map → Map dialog: uses dialog hook (evidence: `src/lib/travel/map.tsx`)
- Interactive map → Street route hook: uses route hook (evidence: `src/lib/travel/map.tsx`)
- Interactive map → Map basemap: loads basemap (evidence: `src/lib/travel/map.tsx`)
- Route state → Wikipedia route: fetches place data (evidence: `src/lib/route/store.ts`)
- Wikipedia route → Wikipedia: looks up places (evidence: `README.md`)
- Street route hook → Street route API: requests geometry (evidence: `README.md`)
- Street route API → OSRM: requests road route (evidence: `README.md`)
- Map basemap → Map tile service: loads map tiles (evidence: `src/lib/travel/vector-basemap.ts`)
