# alexgird/admingate architecture

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

- Interactive diagram: https://gitdiagram.com/alexgird/admingate
- Repository: https://github.com/alexgird/admingate

## Overview

AdminGate is a server-side Textual administration console with an optional FastAPI adapter and an AI agent; both expose shared backend tools. A typical manual flow takes a user request through the TUI to the tool registry and AD/LAPS services, with results rendered in cards; agent requests add LLM planning and response generation. The graph also includes domain selection and Kerberos ticket management. Evidence is limited to the excerpts and README: unsampled capabilities are retained where documented, but uncertain internal links are omitted.

Main entry points: [`clients/textual/app.py`](https://github.com/alexgird/admingate/blob/main/clients/textual/app.py) (Textual console), [`tools/registry.py`](https://github.com/alexgird/admingate/blob/main/tools/registry.py) (Tool registry), [`core/session.py`](https://github.com/alexgird/admingate/blob/main/core/session.py) (Workspace session), [`services/ad_service.py`](https://github.com/alexgird/admingate/blob/main/services/ad_service.py) (Active Directory)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_tui["Textual console<br/>[app.py]"]
  node_domain_widget["Domain selector<br/>[domain_bar.py]"]
  node_kerberos_widget["Kerberos panel<br/>[kerberos_panel.py]"]
  node_user_card["User and groups<br/>[user_card.py]"]
  node_laps_card["LAPS card<br/>[laps_card.py]"]
  node_fastapi["FastAPI adapter<br/>[app.py]"]
  node_tools_route["Tool routes<br/>[tools.py]"]
  node_agent_route["Agent route<br/>[agent.py]"]
end

subgraph group_agent["AI agent"]
  node_agent_core["Agent planner<br/>[agent.py]"]
  node_llm["Ollama service"]
end

subgraph group_tools["Tool layer"]
  node_registry["Tool registry<br/>[registry.py]"]
  node_tool_model["Tool contracts<br/>[tool.py]"]
end

subgraph group_identity["Identity and domains"]
  node_workspace["Workspace session<br/>[session.py]"]
  node_domain_config["Domain definitions<br/>[domains.py]"]
  node_kerberos["Kerberos sessions"]
end

subgraph group_services["Directory services"]
  node_ad_service["Active Directory<br/>[ad_service.py]"]
  node_laps_service["Legacy LAPS<br/>[laps_service.py]"]
end

node_operator(("Administrator"))
node_directory[("Active Directory LDAP")]

node_operator -->|"uses"| node_tui
node_tui -->|"renders"| node_domain_widget
node_tui -->|"renders"| node_kerberos_widget
node_tui -->|"renders"| node_user_card
node_tui -->|"renders"| node_laps_card
node_tui -->|"runs tools"| node_registry
node_tui -->|"runs agent"| node_agent_core
node_user_card -->|"runs tools"| node_registry
node_domain_widget -->|"selects domain"| node_workspace
node_kerberos_widget -->|"manages tickets"| node_workspace
node_fastapi -->|"mounts"| node_tools_route
node_fastapi -->|"mounts"| node_agent_route
node_tools_route -->|"runs tools"| node_registry
node_agent_route -->|"delegates"| node_agent_core
node_agent_core -->|"requests plans"| node_llm
node_agent_core -->|"dispatches tool"| node_registry
node_registry -->|"defines tools"| node_tool_model
node_registry -->|"calls AD"| node_ad_service
node_registry -->|"calls LAPS"| node_laps_service
node_workspace -->|"uses definitions"| node_domain_config
node_workspace -->|"owns sessions"| node_kerberos
node_ad_service -->|"checks tickets"| node_workspace
node_ad_service -->|"resolves domain"| node_domain_config
node_ad_service -->|"queries and updates"| node_directory
node_laps_service -->|"checks tickets"| node_workspace
node_laps_service -->|"resolves domain"| node_domain_config
node_laps_service -->|"reads password"| node_directory
node_kerberos -->|"loads realm"| node_domain_config

click node_tui "https://github.com/alexgird/admingate/blob/main/clients/textual/app.py"
click node_domain_widget "https://github.com/alexgird/admingate/blob/main/clients/textual/widgets/domain_bar.py"
click node_kerberos_widget "https://github.com/alexgird/admingate/blob/main/clients/textual/widgets/kerberos_panel.py"
click node_user_card "https://github.com/alexgird/admingate/blob/main/clients/textual/widgets/user_card.py"
click node_laps_card "https://github.com/alexgird/admingate/blob/main/clients/textual/widgets/laps_card.py"
click node_fastapi "https://github.com/alexgird/admingate/blob/main/clients/fastapi/app.py"
click node_tools_route "https://github.com/alexgird/admingate/blob/main/clients/fastapi/routes/tools.py"
click node_agent_route "https://github.com/alexgird/admingate/blob/main/clients/fastapi/routes/agent.py"
click node_agent_core "https://github.com/alexgird/admingate/blob/main/core/agent.py"
click node_registry "https://github.com/alexgird/admingate/blob/main/tools/registry.py"
click node_tool_model "https://github.com/alexgird/admingate/blob/main/models/tool.py"
click node_workspace "https://github.com/alexgird/admingate/blob/main/core/session.py"
click node_domain_config "https://github.com/alexgird/admingate/blob/main/core/domains.py"
click node_kerberos "https://github.com/alexgird/admingate/blob/main/services/kerberos_service.py"
click node_ad_service "https://github.com/alexgird/admingate/blob/main/services/ad_service.py"
click node_laps_service "https://github.com/alexgird/admingate/blob/main/services/laps_service.py"

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_tui,node_domain_widget,node_kerberos_widget,node_user_card,node_laps_card,node_fastapi,node_tools_route,node_agent_route toneBlue
class node_agent_core,node_llm,node_directory toneAmber
class node_registry,node_tool_model toneMint
class node_workspace,node_domain_config,node_kerberos toneRose
class node_ad_service,node_laps_service,node_operator toneIndigo
```

## Components

### User interfaces

- [Textual console](https://github.com/alexgird/admingate/blob/main/clients/textual/app.py): `clients/textual/app.py`
- [Domain selector](https://github.com/alexgird/admingate/blob/main/clients/textual/widgets/domain_bar.py): `clients/textual/widgets/domain_bar.py`
- [Kerberos panel](https://github.com/alexgird/admingate/blob/main/clients/textual/widgets/kerberos_panel.py): `clients/textual/widgets/kerberos_panel.py`
- [User and groups](https://github.com/alexgird/admingate/blob/main/clients/textual/widgets/user_card.py): `clients/textual/widgets/user_card.py`
- [LAPS card](https://github.com/alexgird/admingate/blob/main/clients/textual/widgets/laps_card.py): `clients/textual/widgets/laps_card.py`
- [FastAPI adapter](https://github.com/alexgird/admingate/blob/main/clients/fastapi/app.py): `clients/fastapi/app.py`
- [Tool routes](https://github.com/alexgird/admingate/blob/main/clients/fastapi/routes/tools.py): `clients/fastapi/routes/tools.py`
- [Agent route](https://github.com/alexgird/admingate/blob/main/clients/fastapi/routes/agent.py): `clients/fastapi/routes/agent.py`

### AI agent

- [Agent planner](https://github.com/alexgird/admingate/blob/main/core/agent.py): `core/agent.py`
- **Ollama service**

### Tool layer

- [Tool registry](https://github.com/alexgird/admingate/blob/main/tools/registry.py): `tools/registry.py`
- [Tool contracts](https://github.com/alexgird/admingate/blob/main/models/tool.py): `models/tool.py`

### Identity and domains

- [Workspace session](https://github.com/alexgird/admingate/blob/main/core/session.py): `core/session.py`
- [Domain definitions](https://github.com/alexgird/admingate/blob/main/core/domains.py): `core/domains.py`
- [Kerberos sessions](https://github.com/alexgird/admingate/blob/main/services/kerberos_service.py): `services/kerberos_service.py`

### Directory services

- [Active Directory](https://github.com/alexgird/admingate/blob/main/services/ad_service.py): `services/ad_service.py`
- [Legacy LAPS](https://github.com/alexgird/admingate/blob/main/services/laps_service.py): `services/laps_service.py`

### Other components

- **Administrator**
- **Active Directory LDAP**

## Connections

- Administrator → Textual console: uses (evidence: `README.md`)
- Textual console → Domain selector: renders (evidence: `clients/textual/app.py`)
- Textual console → Kerberos panel: renders (evidence: `clients/textual/app.py`)
- Textual console → User and groups: renders (evidence: `clients/textual/app.py`)
- Textual console → LAPS card: renders (evidence: `clients/textual/app.py`)
- Textual console → Tool registry: runs tools (evidence: `clients/textual/app.py`)
- Textual console → Agent planner: runs agent (evidence: `clients/textual/app.py`)
- User and groups → Tool registry: runs tools (evidence: `clients/textual/widgets/user_card.py`)
- Domain selector → Workspace session: selects domain (evidence: `clients/textual/widgets/domain_bar.py`)
- Kerberos panel → Workspace session: manages tickets (evidence: `clients/textual/widgets/kerberos_panel.py`)
- FastAPI adapter → Tool routes: mounts (evidence: `clients/fastapi/app.py`)
- FastAPI adapter → Agent route: mounts (evidence: `clients/fastapi/app.py`)
- Tool routes → Tool registry: runs tools (evidence: `clients/fastapi/routes/tools.py`)
- Agent route → Agent planner: delegates (evidence: `clients/fastapi/routes/agent.py`)
- Agent planner → Ollama service: requests plans (evidence: `core/agent.py`)
- Agent planner → Tool registry: dispatches tool (evidence: `core/agent.py`)
- Tool registry → Tool contracts: defines tools (evidence: `tools/registry.py`)
- Tool registry → Active Directory: calls AD (evidence: `tools/registry.py`)
- Tool registry → Legacy LAPS: calls LAPS (evidence: `tools/registry.py`)
- Workspace session → Domain definitions: uses definitions (evidence: `core/session.py`)
- Workspace session → Kerberos sessions: owns sessions (evidence: `core/session.py`)
- Active Directory → Workspace session: checks tickets (evidence: `services/ad_service.py`)
- Active Directory → Domain definitions: resolves domain (evidence: `services/ad_service.py`)
- Active Directory → Active Directory LDAP: queries and updates (evidence: `services/ad_service.py`)
- Legacy LAPS → Workspace session: checks tickets (evidence: `services/laps_service.py`)
- Legacy LAPS → Domain definitions: resolves domain (evidence: `services/laps_service.py`)
- Legacy LAPS → Active Directory LDAP: reads password (evidence: `services/laps_service.py`)
- Kerberos sessions → Domain definitions: loads realm (evidence: `services/kerberos_service.py`)
