# techniumlabs/adotui architecture

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

- Interactive diagram: https://gitdiagram.com/techniumlabs/adotui
- Repository: https://github.com/techniumlabs/adotui

## Overview

adotui is a keyboard-first terminal application for monitoring and acting on pull requests across Azure DevOps organizations and projects. Users configure organizations, load or discover repositories and PRs, browse a grouped PR list, then inspect details, diffs, comments, and pipeline runs or perform review and merge actions. The runtime separates Ink presentation and interaction, app state/data coordination, and Azure REST/authentication. README documents mock mode and setup; some UI and data modules were not sampled, so documented capabilities are represented without asserting unsampled call paths.

Main entry points: [`src/data/azureRest.ts`](https://github.com/techniumlabs/adotui/blob/main/src/data/azureRest.ts) (Azure REST operations), [`src/app/App.tsx`](https://github.com/techniumlabs/adotui/blob/main/src/app/App.tsx) (Terminal app), [`src/app/dataController.ts`](https://github.com/techniumlabs/adotui/blob/main/src/app/dataController.ts) (Data controller), [`src/app/components/PrTabs.tsx`](https://github.com/techniumlabs/adotui/blob/main/src/app/components/PrTabs.tsx) (PR detail tabs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Terminal experience"]
  node_app["Terminal app<br/>[App.tsx]"]
  node_tree["Org and PR tree"]
  node_details["PR detail tabs<br/>[PrTabs.tsx]"]
  node_diff["Diff view<br/>[DiffBody.tsx]"]
  node_comments["Comments view<br/>[CommentsView.tsx]"]
  node_pipelines["Pipeline runs"]
  node_create["Create PR<br/>[CreatePrForm.tsx]"]
  node_keyboard["Keyboard interaction<br/>[useAppKeyboard.ts]"]
end

subgraph group_coord["App coordination"]
  node_state["App state<br/>[useAppState.ts]"]
  node_actions["PR actions<br/>[confirmActions.ts]"]
  node_controller["Data controller<br/>[dataController.ts]"]
end

subgraph group_azure["Azure data services"]
  node_azureload["PR discovery and loading<br/>[azureLoad.ts]"]
  node_detailsdata["PR detail data<br/>[azurePrDetails.ts]"]
  node_rest["Azure REST operations<br/>[azureRest.ts]"]
  node_diffdata["Diff retrieval<br/>[azureDiff.ts]"]
  node_commentsdata["Comment operations<br/>[usePrComments.ts]"]
  node_auth["Authentication<br/>[azureAuth.ts]"]
end

subgraph group_setup["Configuration"]
  node_config["Config and wizard<br/>[config.ts]"]
  node_cache[("App and view cache<br/>[cache.ts]")]
end

node_user(("User"))
node_ado{{"Azure DevOps"}}
node_azcli{{"Azure CLI"}}
node_git{{"Git diff"}}

node_user -->|"navigates"| node_app
node_app -->|"registers input"| node_keyboard
node_app -->|"reads state"| node_state
node_app -->|"renders"| node_tree
node_app -->|"renders"| node_details
node_app -->|"renders"| node_create
node_user -->|"configures projects"| node_config
node_controller -->|"loads config"| node_config
node_controller -->|"reads and writes"| node_cache
node_controller -->|"loads PR data"| node_azureload
node_tree -.->|"displays loaded data"| node_controller
node_state -.->|"coordinates loading"| node_controller
node_details -.->|"loads PR details"| node_detailsdata
node_details -->|"selects diff tab"| node_diff
node_diff -.->|"requests diffs"| node_diffdata
node_git -.->|"computes file diffs"| node_diffdata
node_details -->|"selects comments tab"| node_comments
node_comments -.->|"loads and edits"| node_commentsdata
node_pipelines -->|"fetches runs"| node_rest
node_create -.->|"submits PR"| node_actions
node_actions -.->|"performs PR actions"| node_rest
node_azureload -.->|"uses REST"| node_rest
node_detailsdata -.->|"uses REST"| node_rest
node_diffdata -.->|"uses REST"| node_rest
node_commentsdata -->|"uses REST"| node_rest
node_rest -->|"sends requests"| node_ado
node_rest -->|"gets credentials"| node_auth
node_auth -->|"gets access token"| node_azcli

click node_app "https://github.com/techniumlabs/adotui/blob/main/src/app/App.tsx"
click node_tree "https://github.com/techniumlabs/adotui/blob/main/src/app/components/OrganizationTree.tsx"
click node_details "https://github.com/techniumlabs/adotui/blob/main/src/app/components/PrTabs.tsx"
click node_diff "https://github.com/techniumlabs/adotui/blob/main/src/app/components/diff/DiffBody.tsx"
click node_comments "https://github.com/techniumlabs/adotui/blob/main/src/app/components/CommentsView.tsx"
click node_pipelines "https://github.com/techniumlabs/adotui/blob/main/src/app/components/PipelineRunsView.tsx"
click node_create "https://github.com/techniumlabs/adotui/blob/main/src/app/components/CreatePrForm.tsx"
click node_keyboard "https://github.com/techniumlabs/adotui/blob/main/src/app/hooks/useAppKeyboard.ts"
click node_state "https://github.com/techniumlabs/adotui/blob/main/src/app/hooks/useAppState.ts"
click node_actions "https://github.com/techniumlabs/adotui/blob/main/src/app/actions/confirmActions.ts"
click node_controller "https://github.com/techniumlabs/adotui/blob/main/src/app/dataController.ts"
click node_config "https://github.com/techniumlabs/adotui/blob/main/src/data/config.ts"
click node_cache "https://github.com/techniumlabs/adotui/blob/main/src/data/cache.ts"
click node_azureload "https://github.com/techniumlabs/adotui/blob/main/src/data/azureLoad.ts"
click node_detailsdata "https://github.com/techniumlabs/adotui/blob/main/src/data/azurePrDetails.ts"
click node_rest "https://github.com/techniumlabs/adotui/blob/main/src/data/azureRest.ts"
click node_diffdata "https://github.com/techniumlabs/adotui/blob/main/src/data/azureDiff.ts"
click node_commentsdata "https://github.com/techniumlabs/adotui/blob/main/src/app/hooks/usePrComments.ts"
click node_auth "https://github.com/techniumlabs/adotui/blob/main/src/data/azureAuth.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_app,node_tree,node_details,node_diff,node_comments,node_pipelines,node_create,node_keyboard,node_user toneBlue
class node_state,node_actions,node_controller toneAmber
class node_azureload,node_detailsdata,node_rest,node_diffdata,node_commentsdata,node_auth toneMint
class node_config,node_cache toneRose
class node_ado,node_azcli,node_git toneIndigo
```

## Components

### Terminal experience

- [Terminal app](https://github.com/techniumlabs/adotui/blob/main/src/app/App.tsx): `src/app/App.tsx`
- [Org and PR tree](https://github.com/techniumlabs/adotui/blob/main/src/app/components/OrganizationTree.tsx): `src/app/components/OrganizationTree.tsx`
- [PR detail tabs](https://github.com/techniumlabs/adotui/blob/main/src/app/components/PrTabs.tsx): `src/app/components/PrTabs.tsx`
- [Diff view](https://github.com/techniumlabs/adotui/blob/main/src/app/components/diff/DiffBody.tsx): `src/app/components/diff/DiffBody.tsx`
- [Comments view](https://github.com/techniumlabs/adotui/blob/main/src/app/components/CommentsView.tsx): `src/app/components/CommentsView.tsx`
- [Pipeline runs](https://github.com/techniumlabs/adotui/blob/main/src/app/components/PipelineRunsView.tsx): `src/app/components/PipelineRunsView.tsx`
- [Create PR](https://github.com/techniumlabs/adotui/blob/main/src/app/components/CreatePrForm.tsx): `src/app/components/CreatePrForm.tsx`
- [Keyboard interaction](https://github.com/techniumlabs/adotui/blob/main/src/app/hooks/useAppKeyboard.ts): `src/app/hooks/useAppKeyboard.ts`

### App coordination

- [App state](https://github.com/techniumlabs/adotui/blob/main/src/app/hooks/useAppState.ts): `src/app/hooks/useAppState.ts`
- [PR actions](https://github.com/techniumlabs/adotui/blob/main/src/app/actions/confirmActions.ts): `src/app/actions/confirmActions.ts`
- [Data controller](https://github.com/techniumlabs/adotui/blob/main/src/app/dataController.ts): `src/app/dataController.ts`

### Azure data services

- [PR discovery and loading](https://github.com/techniumlabs/adotui/blob/main/src/data/azureLoad.ts): `src/data/azureLoad.ts`
- [PR detail data](https://github.com/techniumlabs/adotui/blob/main/src/data/azurePrDetails.ts): `src/data/azurePrDetails.ts`
- [Azure REST operations](https://github.com/techniumlabs/adotui/blob/main/src/data/azureRest.ts): `src/data/azureRest.ts`
- [Diff retrieval](https://github.com/techniumlabs/adotui/blob/main/src/data/azureDiff.ts): `src/data/azureDiff.ts`
- [Comment operations](https://github.com/techniumlabs/adotui/blob/main/src/app/hooks/usePrComments.ts): `src/app/hooks/usePrComments.ts`
- [Authentication](https://github.com/techniumlabs/adotui/blob/main/src/data/azureAuth.ts): `src/data/azureAuth.ts`

### Configuration

- [Config and wizard](https://github.com/techniumlabs/adotui/blob/main/src/data/config.ts): `src/data/config.ts`
- [App and view cache](https://github.com/techniumlabs/adotui/blob/main/src/data/cache.ts): `src/data/cache.ts`

### Other components

- **User**
- **Azure DevOps**
- **Azure CLI**
- **Git diff**

## Connections

- User → Terminal app: navigates (evidence: `README.md`)
- Terminal app → Keyboard interaction: registers input (evidence: `src/app/App.tsx`)
- Terminal app → App state: reads state (evidence: `src/app/App.tsx`)
- Terminal app → Org and PR tree: renders (evidence: `src/app/App.tsx`)
- Terminal app → PR detail tabs: renders (evidence: `src/app/App.tsx`)
- Terminal app → Create PR: renders (evidence: `src/app/App.tsx`)
- User → Config and wizard: configures projects (evidence: `README.md`)
- Data controller → Config and wizard: loads config (evidence: `src/app/dataController.ts`)
- Data controller → App and view cache: reads and writes (evidence: `src/app/dataController.ts`)
- Data controller → PR discovery and loading: loads PR data (evidence: `src/app/dataController.ts`)
- Org and PR tree → Data controller: displays loaded data
- App state → Data controller: coordinates loading
- PR detail tabs → PR detail data: loads PR details (evidence: `README.md`)
- PR detail tabs → Diff view: selects diff tab (evidence: `README.md`)
- Diff view → Diff retrieval: requests diffs (evidence: `README.md`)
- Git diff → Diff retrieval: computes file diffs (evidence: `README.md`)
- PR detail tabs → Comments view: selects comments tab (evidence: `README.md`)
- Comments view → Comment operations: loads and edits (evidence: `README.md`)
- Pipeline runs → Azure REST operations: fetches runs
- Create PR → PR actions: submits PR (evidence: `README.md`)
- PR actions → Azure REST operations: performs PR actions (evidence: `README.md`)
- PR discovery and loading → Azure REST operations: uses REST (evidence: `README.md`)
- PR detail data → Azure REST operations: uses REST (evidence: `README.md`)
- Diff retrieval → Azure REST operations: uses REST (evidence: `README.md`)
- Comment operations → Azure REST operations: uses REST (evidence: `src/app/hooks/usePrComments.ts`)
- Azure REST operations → Azure DevOps: sends requests (evidence: `README.md`)
- Azure REST operations → Authentication: gets credentials
- Authentication → Azure CLI: gets access token (evidence: `src/data/azureAuth.ts`)
