# birdzee4-cmd/ado-auto-approve architecture

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

- Interactive diagram: https://gitdiagram.com/birdzee4-cmd/ado-auto-approve
- Repository: https://github.com/birdzee4-cmd/ado-auto-approve

## Overview

ADO Auto-Approve is a web dashboard and API for reviewing Azure DevOps pull requests, performing guarded approvals, and recording activity. Its broader capabilities include reporting, build diagnostics, merge lookup, an Operations Hub, and an App Service portal. The graph reflects documented workflows and source-index references; several feature implementations were not sampled, so uncertain internal connections are omitted.

Main entry points: [`api/shared/ado-client.js`](https://github.com/birdzee4-cmd/ado-auto-approve/blob/main/api/shared/ado-client.js) (ADO client), [`api/approve-pr/index.js`](https://github.com/birdzee4-cmd/ado-auto-approve/blob/main/api/approve-pr/index.js) (PR approval), [`api/shared/sharepoint-client.js`](https://github.com/birdzee4-cmd/ado-auto-approve/blob/main/api/shared/sharepoint-client.js) (SharePoint logs), [`api/list-prs/index.js`](https://github.com/birdzee4-cmd/ado-auto-approve/blob/main/api/list-prs/index.js) (PR queue)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Web interfaces"]
  node_dashboard["Dashboard<br/>[dashboard.js]"]
  node_core["Frontend core<br/>[core.js]"]
  node_opsui["Operations UI<br/>[App.tsx]"]
  node_portalui["App Service portal<br/>[portal.js]"]
end

subgraph group_pr["PR workflow"]
  node_queue["PR queue<br/>[index.js]"]
  node_approval["PR approval<br/>[index.js]"]
  node_release["Release approval<br/>[index.js]"]
  node_merge["Merge lookup<br/>[index.js]"]
end

subgraph group_reports["Reporting and diagnostics"]
  node_report["Reports<br/>[index.js]"]
  node_diagnostics["Build diagnostics"]
  node_summaries["Daily/monthly summaries<br/>[index.js]"]
end

subgraph group_ops["Operations and portal"]
  node_opsapi["Operations API<br/>[index.js]"]
  node_opsui_views["Operations views<br/>[Incidents.tsx]"]
  node_portalapi["Portal API<br/>[index.js]"]
end

subgraph group_shared["Shared services"]
  node_ado["ADO client<br/>[ado-client.js]"]
  node_auth["Role authorization<br/>[auth.js]"]
  node_user_token["Delegated ADO tokens<br/>[ado-user-token.js]"]
  node_sp[("SharePoint logs")]
  node_teams["Teams notifications<br/>[teams-notifier.js]"]
end

node_user(("User"))
node_logic(("Logic Apps"))
node_ado_service["Azure DevOps"]
node_sharepoint_incidents[("SharePoint incident store")]
node_power_automate["Power Automate"]
node_appservice["Azure App Services"]

node_user -->|"reviews queue"| node_dashboard
node_dashboard -.->|"uses"| node_core
node_dashboard -->|"loads PRs"| node_queue
node_queue -->|"queries PRs"| node_ado
node_queue -->|"uses delegated token"| node_user_token
node_user -->|"requests approval"| node_approval
node_approval -->|"checks role"| node_auth
node_approval -->|"uses delegated token"| node_user_token
node_approval -->|"votes and configures"| node_ado
node_approval -->|"records action"| node_sp
node_user -->|"approves release"| node_release
node_release -->|"checks approval"| node_ado
node_release -->|"records action"| node_sp
node_user -->|"looks up pipeline"| node_merge
node_merge -->|"queries pipeline"| node_ado
node_user -->|"views summaries"| node_report
node_report -->|"reads logs"| node_sp
node_user -->|"investigates builds"| node_diagnostics
node_diagnostics -->|"analyzes build data"| node_ado
node_logic -->|"triggers scheduled"| node_summaries
node_summaries -->|"reads PR data"| node_ado
node_summaries -->|"reads send history"| node_sp
node_summaries -->|"sends summaries"| node_teams
node_user -->|"uses hub"| node_opsui
node_opsui -->|"renders views"| node_opsui_views
node_opsui -->|"requests hub data"| node_opsapi
node_power_automate -->|"stores incidents"| node_sharepoint_incidents
node_opsapi -->|"reads incidents"| node_sharepoint_incidents
node_opsapi -->|"reads work item status"| node_ado
node_user -->|"manages services"| node_portalui
node_portalui -->|"requests portal actions"| node_portalapi
node_portalapi -->|"reads and restarts"| node_appservice
node_queue -->|"reads activity"| node_sp

click node_dashboard "https://github.com/birdzee4-cmd/ado-auto-approve/blob/main/public/dashboard.js"
click node_core "https://github.com/birdzee4-cmd/ado-auto-approve/blob/main/public/core.js"
click node_opsui "https://github.com/birdzee4-cmd/ado-auto-approve/blob/main/operations-ui/src/App.tsx"
click node_portalui "https://github.com/birdzee4-cmd/ado-auto-approve/blob/main/public/portal.js"
click node_queue "https://github.com/birdzee4-cmd/ado-auto-approve/blob/main/api/list-prs/index.js"
click node_approval "https://github.com/birdzee4-cmd/ado-auto-approve/blob/main/api/approve-pr/index.js"
click node_release "https://github.com/birdzee4-cmd/ado-auto-approve/blob/main/api/approve-release/index.js"
click node_merge "https://github.com/birdzee4-cmd/ado-auto-approve/blob/main/api/merge-lookup/index.js"
click node_report "https://github.com/birdzee4-cmd/ado-auto-approve/blob/main/api/report-summary/index.js"
click node_diagnostics "https://github.com/birdzee4-cmd/ado-auto-approve/blob/main/api/shared/build-diagnostics-service.js"
click node_summaries "https://github.com/birdzee4-cmd/ado-auto-approve/blob/main/api/daily-summary/index.js"
click node_opsapi "https://github.com/birdzee4-cmd/ado-auto-approve/blob/main/api/operations/index.js"
click node_opsui_views "https://github.com/birdzee4-cmd/ado-auto-approve/blob/main/operations-ui/src/modules/Incidents.tsx"
click node_portalapi "https://github.com/birdzee4-cmd/ado-auto-approve/blob/main/appservice-api/appservices/index.js"
click node_ado "https://github.com/birdzee4-cmd/ado-auto-approve/blob/main/api/shared/ado-client.js"
click node_auth "https://github.com/birdzee4-cmd/ado-auto-approve/blob/main/api/shared/auth.js"
click node_user_token "https://github.com/birdzee4-cmd/ado-auto-approve/blob/main/api/shared/ado-user-token.js"
click node_sp "https://github.com/birdzee4-cmd/ado-auto-approve/blob/main/api/shared/sharepoint-client.js"
click node_teams "https://github.com/birdzee4-cmd/ado-auto-approve/blob/main/api/shared/teams-notifier.js"

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_dashboard,node_core,node_opsui,node_portalui,node_user toneBlue
class node_queue,node_approval,node_release,node_merge,node_sharepoint_incidents toneAmber
class node_report,node_diagnostics,node_summaries toneMint
class node_opsapi,node_opsui_views,node_portalapi toneRose
class node_ado,node_auth,node_user_token,node_sp,node_teams,node_logic,node_ado_service,node_power_automate,node_appservice toneIndigo
```

## Components

### Web interfaces

- [Dashboard](https://github.com/birdzee4-cmd/ado-auto-approve/blob/main/public/dashboard.js): `public/dashboard.js`
- [Frontend core](https://github.com/birdzee4-cmd/ado-auto-approve/blob/main/public/core.js): `public/core.js`
- [Operations UI](https://github.com/birdzee4-cmd/ado-auto-approve/blob/main/operations-ui/src/App.tsx): `operations-ui/src/App.tsx`
- [App Service portal](https://github.com/birdzee4-cmd/ado-auto-approve/blob/main/public/portal.js): `public/portal.js`

### PR workflow

- [PR queue](https://github.com/birdzee4-cmd/ado-auto-approve/blob/main/api/list-prs/index.js): `api/list-prs/index.js`
- [PR approval](https://github.com/birdzee4-cmd/ado-auto-approve/blob/main/api/approve-pr/index.js): `api/approve-pr/index.js`
- [Release approval](https://github.com/birdzee4-cmd/ado-auto-approve/blob/main/api/approve-release/index.js): `api/approve-release/index.js`
- [Merge lookup](https://github.com/birdzee4-cmd/ado-auto-approve/blob/main/api/merge-lookup/index.js): `api/merge-lookup/index.js`

### Reporting and diagnostics

- [Reports](https://github.com/birdzee4-cmd/ado-auto-approve/blob/main/api/report-summary/index.js): `api/report-summary/index.js`
- [Build diagnostics](https://github.com/birdzee4-cmd/ado-auto-approve/blob/main/api/shared/build-diagnostics-service.js): `api/shared/build-diagnostics-service.js`
- [Daily/monthly summaries](https://github.com/birdzee4-cmd/ado-auto-approve/blob/main/api/daily-summary/index.js): `api/daily-summary/index.js`

### Operations and portal

- [Operations API](https://github.com/birdzee4-cmd/ado-auto-approve/blob/main/api/operations/index.js): `api/operations/index.js`
- [Operations views](https://github.com/birdzee4-cmd/ado-auto-approve/blob/main/operations-ui/src/modules/Incidents.tsx): `operations-ui/src/modules/Incidents.tsx`
- [Portal API](https://github.com/birdzee4-cmd/ado-auto-approve/blob/main/appservice-api/appservices/index.js): `appservice-api/appservices/index.js`

### Shared services

- [ADO client](https://github.com/birdzee4-cmd/ado-auto-approve/blob/main/api/shared/ado-client.js): `api/shared/ado-client.js`
- [Role authorization](https://github.com/birdzee4-cmd/ado-auto-approve/blob/main/api/shared/auth.js): `api/shared/auth.js`
- [Delegated ADO tokens](https://github.com/birdzee4-cmd/ado-auto-approve/blob/main/api/shared/ado-user-token.js): `api/shared/ado-user-token.js`
- [SharePoint logs](https://github.com/birdzee4-cmd/ado-auto-approve/blob/main/api/shared/sharepoint-client.js): `api/shared/sharepoint-client.js`
- [Teams notifications](https://github.com/birdzee4-cmd/ado-auto-approve/blob/main/api/shared/teams-notifier.js): `api/shared/teams-notifier.js`

### Other components

- **User**
- **Logic Apps**
- **Azure DevOps**
- **SharePoint incident store**
- **Power Automate**
- **Azure App Services**

## Connections

- User → Dashboard: reviews queue (evidence: `README.md`)
- Dashboard → Frontend core: uses
- Dashboard → PR queue: loads PRs (evidence: `README.md`)
- PR queue → ADO client: queries PRs (evidence: `api/list-prs/index.js`)
- PR queue → Delegated ADO tokens: uses delegated token (evidence: `api/list-prs/index.js`)
- User → PR approval: requests approval (evidence: `README.md`)
- PR approval → Role authorization: checks role (evidence: `api/approve-pr/index.js`)
- PR approval → Delegated ADO tokens: uses delegated token (evidence: `api/approve-pr/index.js`)
- PR approval → ADO client: votes and configures (evidence: `api/approve-pr/index.js`)
- PR approval → SharePoint logs: records action (evidence: `api/approve-pr/index.js`)
- User → Release approval: approves release (evidence: `README.md`)
- Release approval → ADO client: checks approval (evidence: `api/approve-release/index.js`)
- Release approval → SharePoint logs: records action (evidence: `api/approve-release/index.js`)
- User → Merge lookup: looks up pipeline (evidence: `README.md`)
- Merge lookup → ADO client: queries pipeline (evidence: `api/merge-lookup/index.js`)
- User → Reports: views summaries (evidence: `README.md`)
- Reports → SharePoint logs: reads logs (evidence: `api/report-summary/index.js`)
- User → Build diagnostics: investigates builds (evidence: `README.md`)
- Build diagnostics → ADO client: analyzes build data (evidence: `api/build-diagnostics/index.js`)
- Logic Apps → Daily/monthly summaries: triggers scheduled (evidence: `README.md`)
- Daily/monthly summaries → ADO client: reads PR data (evidence: `api/daily-summary/index.js`)
- Daily/monthly summaries → SharePoint logs: reads send history (evidence: `api/daily-summary/index.js`)
- Daily/monthly summaries → Teams notifications: sends summaries (evidence: `api/daily-summary/index.js`)
- User → Operations UI: uses hub (evidence: `README.md`)
- Operations UI → Operations views: renders views (evidence: `operations-ui/src/App.tsx`)
- Operations UI → Operations API: requests hub data (evidence: `README.md`)
- Power Automate → SharePoint incident store: stores incidents (evidence: `README.md`)
- Operations API → SharePoint incident store: reads incidents (evidence: `api/operations/index.js`)
- Operations API → ADO client: reads work item status
- User → App Service portal: manages services (evidence: `README.md`)
- App Service portal → Portal API: requests portal actions (evidence: `README.md`)
- Portal API → Azure App Services: reads and restarts (evidence: `README.md`)
- PR queue → SharePoint logs: reads activity (evidence: `api/list-prs/index.js`)
