# myitscloud-org/shiroscout architecture

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

- Interactive diagram: https://gitdiagram.com/myitscloud-org/shiroscout
- Repository: https://github.com/myitscloud-org/shiroscout

## Overview

1. **Overall shape**
   - ShiroScout is a **Tauri desktop application**: a **React + TypeScript frontend** runs in the WebView, while a **Rust backend** handles Windows/system operations and privileged work.
   - The app is oriented around **local or remote Windows support workflows** for L1/L2 technicians.

2. **Frontend shell and navigation**
   - `src/app` contains the application shell: router, layout, navbar, sidenav, terminal panel, and top-level routes.
   - The routes are mostly thin page entry points; they delegate real work to feature modules instead of embedding logic in the route layer.

3. **Feature-based UI modules**
   - `src/features/*` is the main UI domain boundary. Each folder represents a technician task area such as:
     - device/process/software inventory
     - event logs and security logs
     - disk, network, services, startup, scheduled tasks
     - remote tools, registry browser, SCCM, AD users, Windows Update
     - AI diagnostics, quick fixes, fix history, tickets, integrations
   - This is where the product’s functional surface area lives, and it maps closely to the pages in the router.

4. **Shared UI and cross-cutting client code**
   - `src/components` contains reusable UI primitives and common wrappers such as error boundaries, confirm dialogs, toast notifications, loading/empty states, and styled helpers.
   - `src/hooks`, `src/lib`, `src/config`, and `src/types` provide shared client-side behavior: keyboard shortcuts, idle timeout, Tauri command helpers, environment configuration, export utilities, and typed bridges to backend commands.

5. **Terminal and command-oriented UX**
   - The app includes a terminal/console experience (`src/features/terminal*`, `terminal-panel.tsx`, `terminal-context.tsx`) for operational workflows.
   - This is a distinct UX path from the normal form-based pages and is likely used for command execution, live output, or session tracking.

6. **Rust backend as the system boundary**
   - `src-tauri/src` is the execution and integration layer. It exposes commands and services that the frontend calls through Tauri IPC.
   - Key backend modules suggest a clear command boundary:
     - `commands.rs`, `cmd_catalog.rs`, `cmdlet_reference.rs` for the public command surface
     - `error.rs`, `config.rs`, `environment.rs` for backend wiring and failure handling
     - `rate_limiter.rs` for throttling sensitive operations, especially around AI or remote actions

7. **Windows/endpoint management subsystems**
   - Several Rust modules are dedicated to Windows support tasks:
     - `ps.rs` and `ps_audit.rs` for PowerShell execution and auditing
     - `system.rs`, `health_snapshot.rs`, `screenshot.rs`, `attestation.rs`
     - `ad.rs`, `gp.rs`, `sccm.rs`, `dpapi.rs`, `history.rs`
     - `audit.rs`, `triage.rs`, `rca.rs`, `network`-oriented and event-fix related logic
   - These modules are the core of the product: they gather machine state, run diagnostics, and support remediation.

8. **PowerShell and scripted operations**
   - The backend invokes repository scripts under `src-tauri/scripts` and top-level `scripts/` for tasks like health checks, remote-state capture, VM detection, teardown, backups, and maintenance.
   - This scripting layer is a major architectural boundary: the Rust app orchestrates Windows-native PowerShell behavior rather than reimplementing everything in Rust.

9. **AI-assisted diagnostics and external integrations**
   - AI support is first-class in the architecture: `src/features/ai-diagnostics`, `src-tauri/src/llm.rs`, and `src/features/settings/llm-providers.tsx` indicate pluggable LLM providers.
   - `custom-webhooks`, `tickets`, and `integrations` suggest outbound integration points for reporting, automation, or workflow handoff.
   - The backend’s rate limiting and audit-related modules indicate these external calls are treated as controlled, observable operations.

10. **Data, history, and reporting**
   - The app keeps operational context such as fix history, health snapshots, event-fix mappings, and audit artifacts.
   - UI modules like `fix-history`, `desktop-health`, and the report-oriented docs/files imply the product is not just for one-off actions; it also supports reviewability and post-incident traceability.

11. **Permissions and Tauri security model**
   - `src-tauri/capabilities` and generated schemas show the app uses Tauri’s capability system to constrain what the frontend can ask the backend to do.
   - That separation matters architecturally: the UI is not directly privileged; backend commands and allowed capabilities define the security boundary.

12. **Build, test, and delivery pipeline**
   - The frontend uses **Vite**, **TypeScript**, **Biome**, and tests in `src/components` and `src/lib`.
   - The backend uses **Rust/Cargo**, with Tauri configuration in `src-tauri/tauri.conf.json`.
   - GitHub Actions CI is present, and the repo also includes many operational docs/scripts for release, auditing, and maintenance.

Main entry points: [`src/app/routes`](https://github.com/myitscloud-org/shiroscout/tree/main/src/app/routes) (Feature pages), [`src-tauri/src/commands.rs`](https://github.com/myitscloud-org/shiroscout/blob/main/src-tauri/src/commands.rs) (Backend API), [`src/app`](https://github.com/myitscloud-org/shiroscout/tree/main/src/app) (App shell), [`src/features/event-viewer`](https://github.com/myitscloud-org/shiroscout/tree/main/src/features/event-viewer) (Diagnostics ops)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend"]
  node_app_shell["App shell<br/>router/layout"]
  node_feature_pages["Feature pages<br/>ui domains"]
  node_shell_ui["Shell UI<br/>layout/theme"]
  node_terminal_ux["Terminal UX<br/>console/session"]
  node_inventory_ops["Inventory ops<br/>device/status"]
  node_diagnostics_ops["Diagnostics ops<br/>logs/triage"]
  node_remediation_ops["Remediation ops<br/>fix/remediate"]
  node_remote_ops["Remote ops<br/>remote/admin"]
  node_enterprise_ops["Enterprise ops<br/>directory/sccm"]
  node_ai_support["AI support<br/>llm/diagnostics"]
  node_shared_ui["Shared UI<br/>components"]
  node_shared_client["Client shared<br/>hooks/lib/config"]
end

subgraph group_backend["Backend"]
  node_backend_api["Backend API<br/>commands/config<br/>[commands.rs]"]
  node_windows_ops["Windows ops<br/>endpoint services<br/>[system.rs]"]
  node_llm_backend["LLM backend<br/>llm service<br/>[llm.rs]"]
end

subgraph group_scripts["Scripts"]
  node_ps_scripts["PS scripts<br/>powershell orchestration"]
  node_repo_scripts["Repo scripts<br/>automation"]
end

subgraph group_meta["Meta"]
  node_tauri_commands["Tauri commands<br/>ipc bridge<br/>[tauri-types.ts]"]
  node_capabilities["Capabilities<br/>security policy"]
end

node_app_shell -->|"routes"| node_feature_pages
node_app_shell -->|"wraps"| node_shell_ui
node_app_shell -->|"hosts"| node_terminal_ux
node_feature_pages -->|"includes"| node_inventory_ops
node_feature_pages -->|"includes"| node_diagnostics_ops
node_feature_pages -->|"includes"| node_remediation_ops
node_feature_pages -->|"includes"| node_remote_ops
node_feature_pages -->|"includes"| node_enterprise_ops
node_feature_pages -->|"includes"| node_ai_support
node_feature_pages -->|"uses"| node_terminal_ux
node_diagnostics_ops -->|"uses"| node_shared_ui
node_remediation_ops -->|"uses"| node_shared_client
node_terminal_ux -->|"uses"| node_shared_client
node_shared_client -->|"calls"| node_tauri_commands
node_tauri_commands -->|"bridges"| node_backend_api
node_backend_api -->|"orchestrates"| node_windows_ops
node_backend_api -->|"routes"| node_llm_backend
node_backend_api -->|"constrained by"| node_capabilities
node_windows_ops -->|"invokes"| node_ps_scripts
node_ps_scripts -.->|"supported by"| node_repo_scripts
node_ai_support -->|"consumes"| node_llm_backend
node_enterprise_ops -->|"depends on"| node_backend_api
node_diagnostics_ops -->|"depends on"| node_backend_api

click node_app_shell "https://github.com/myitscloud-org/shiroscout/tree/main/src/app"
click node_feature_pages "https://github.com/myitscloud-org/shiroscout/tree/main/src/app/routes"
click node_shell_ui "https://github.com/myitscloud-org/shiroscout/tree/main/src/features/shell"
click node_terminal_ux "https://github.com/myitscloud-org/shiroscout/tree/main/src/features/terminal"
click node_inventory_ops "https://github.com/myitscloud-org/shiroscout/tree/main/src/features/system-info"
click node_diagnostics_ops "https://github.com/myitscloud-org/shiroscout/tree/main/src/features/event-viewer"
click node_remediation_ops "https://github.com/myitscloud-org/shiroscout/tree/main/src/features/quick-fixes"
click node_remote_ops "https://github.com/myitscloud-org/shiroscout/tree/main/src/features/remote-tools"
click node_enterprise_ops "https://github.com/myitscloud-org/shiroscout/tree/main/src/features/ad-users"
click node_ai_support "https://github.com/myitscloud-org/shiroscout/tree/main/src/features/ai-diagnostics"
click node_shared_ui "https://github.com/myitscloud-org/shiroscout/tree/main/src/components"
click node_shared_client "https://github.com/myitscloud-org/shiroscout/tree/main/src/lib"
click node_tauri_commands "https://github.com/myitscloud-org/shiroscout/blob/main/src/types/tauri-types.ts"
click node_backend_api "https://github.com/myitscloud-org/shiroscout/blob/main/src-tauri/src/commands.rs"
click node_windows_ops "https://github.com/myitscloud-org/shiroscout/blob/main/src-tauri/src/system.rs"
click node_llm_backend "https://github.com/myitscloud-org/shiroscout/blob/main/src-tauri/src/llm.rs"
click node_capabilities "https://github.com/myitscloud-org/shiroscout/tree/main/src-tauri/capabilities"
click node_ps_scripts "https://github.com/myitscloud-org/shiroscout/tree/main/src-tauri/scripts"
click node_repo_scripts "https://github.com/myitscloud-org/shiroscout/tree/main/scripts"

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_shell,node_feature_pages,node_shell_ui,node_terminal_ux,node_inventory_ops,node_diagnostics_ops,node_remediation_ops,node_remote_ops,node_enterprise_ops,node_ai_support,node_shared_ui,node_shared_client toneBlue
class node_backend_api,node_windows_ops,node_llm_backend toneAmber
class node_ps_scripts,node_repo_scripts toneMint
class node_tauri_commands,node_capabilities toneRose
```

## Components

### Frontend

React + TypeScript desktop UI in the Tauri WebView

- [App shell](https://github.com/myitscloud-org/shiroscout/tree/main/src/app): router/layout · Top-level React router, layout, navigation, and terminal panel · `src/app`
- [Feature pages](https://github.com/myitscloud-org/shiroscout/tree/main/src/app/routes): ui domains · Route entry points for technician workflows and support tasks · `src/app/routes`
- [Shell UI](https://github.com/myitscloud-org/shiroscout/tree/main/src/features/shell): layout/theme · App-wide shell, idle lock, theme, and page chrome · `src/features/shell`
- [Terminal UX](https://github.com/myitscloud-org/shiroscout/tree/main/src/features/terminal): console/session · Terminal panel and terminal context for command-oriented workflows · `src/features/terminal`
- [Inventory ops](https://github.com/myitscloud-org/shiroscout/tree/main/src/features/system-info): device/status · Device, system, process, software, and performance views · `src/features/system-info`
- [Diagnostics ops](https://github.com/myitscloud-org/shiroscout/tree/main/src/features/event-viewer): logs/triage · Event logs, security logs, desktop health, and fix history · `src/features/event-viewer`
- [Remediation ops](https://github.com/myitscloud-org/shiroscout/tree/main/src/features/quick-fixes): fix/remediate · Quick fixes, services, startup, scheduled tasks, disk, and file exploration · `src/features/quick-fixes`
- [Remote ops](https://github.com/myitscloud-org/shiroscout/tree/main/src/features/remote-tools): remote/admin · Remote registry, remote service manager, RDM, and remote tools · `src/features/remote-tools`
- [Enterprise ops](https://github.com/myitscloud-org/shiroscout/tree/main/src/features/ad-users): directory/sccm · AD users, group policy, SCCM, tickets, integrations, and custom webhooks · `src/features/ad-users`
- [AI support](https://github.com/myitscloud-org/shiroscout/tree/main/src/features/ai-diagnostics): llm/diagnostics · AI diagnostics and provider settings for assisted triage · `src/features/ai-diagnostics`
- [Shared UI](https://github.com/myitscloud-org/shiroscout/tree/main/src/components): components · Reusable dialogs, boundaries, toasts, loading states, and UI primitives · `src/components`
- [Client shared](https://github.com/myitscloud-org/shiroscout/tree/main/src/lib): hooks/lib/config · Hooks, env helpers, export utilities, typed Tauri bridges, and fix catalog data · `src/lib`

### Backend

Rust/Tauri integration and Windows execution layer

- [Backend API](https://github.com/myitscloud-org/shiroscout/blob/main/src-tauri/src/commands.rs): commands/config · Public Rust command catalog, config, errors, environment, and rate limiting · `src-tauri/src/commands.rs`
- [Windows ops](https://github.com/myitscloud-org/shiroscout/blob/main/src-tauri/src/system.rs): endpoint services · PowerShell execution, auditing, triage, system state, screenshot, attestation, AD, GP, SCCM, DPAPI, history, and RCA · `src-tauri/src/system.rs`
- [LLM backend](https://github.com/myitscloud-org/shiroscout/blob/main/src-tauri/src/llm.rs): llm service · Backend LLM provider integration and controlled AI access · `src-tauri/src/llm.rs`

### Scripts

PowerShell orchestration and maintenance automation

- [PS scripts](https://github.com/myitscloud-org/shiroscout/tree/main/src-tauri/scripts): powershell orchestration · Bundled PowerShell workflows for health checks, VM detection, snapshotting, and teardown · `src-tauri/scripts`
- [Repo scripts](https://github.com/myitscloud-org/shiroscout/tree/main/scripts): automation · Top-level PowerShell and utility scripts for maintenance, scaffolding, backups, and test harnessing · `scripts`

### Meta

Build, security, and repository coordination

- [Tauri commands](https://github.com/myitscloud-org/shiroscout/blob/main/src/types/tauri-types.ts): ipc bridge · Typed frontend command surface and generated Tauri bindings · `src/types/tauri-types.ts`
- [Capabilities](https://github.com/myitscloud-org/shiroscout/tree/main/src-tauri/capabilities): security policy · Tauri capability and schema boundary constraining privileged actions · `src-tauri/capabilities`

## Connections

- App shell → Feature pages: routes · App shell renders and navigates between task pages
- App shell → Shell UI: wraps · Shell UI provides global layout, theme, and idle protection
- App shell → Terminal UX: hosts · Terminal experience is surfaced in the main application frame
- Feature pages → Inventory ops: includes · Routes expose inventory and system-state workflows
- Feature pages → Diagnostics ops: includes · Routes expose logs, health, and history workflows
- Feature pages → Remediation ops: includes · Routes expose repair and maintenance workflows
- Feature pages → Remote ops: includes · Routes expose remote administration workflows
- Feature pages → Enterprise ops: includes · Routes expose directory, SCCM, tickets, and integrations workflows
- Feature pages → AI support: includes · Routes expose assisted diagnostics and provider settings
- Feature pages → Terminal UX: uses · Some workflows are command-driven and stream output in the terminal panel
- Diagnostics ops → Shared UI: uses · Pages share dialogs, boundaries, and notification primitives
- Remediation ops → Client shared: uses · Fix flows rely on shared hooks, utilities, and command helpers
- Terminal UX → Client shared: uses · Terminal features use shared client-side helpers and state
- Client shared → Tauri commands: calls · Frontend helpers invoke typed backend commands through Tauri IPC
- Tauri commands → Backend API: bridges · Generated bindings connect the UI to Rust command handlers
- Backend API → Windows ops: orchestrates · Command layer delegates privileged Windows and endpoint operations
- Backend API → LLM backend: routes · Backend mediates AI provider access and diagnostics
- Backend API → Capabilities: constrained by · Privilege is limited by Tauri capabilities and generated schemas
- Windows ops → PS scripts: invokes · Rust services execute bundled PowerShell workflows for endpoint tasks
- PS scripts → Repo scripts: supported by · Repository automation complements the Tauri-bundled scripts
- AI support → LLM backend: consumes · AI diagnostics UI depends on backend LLM integration
- Enterprise ops → Backend API: depends on · Directory, SCCM, and integration features rely on backend commands
- Diagnostics ops → Backend API: depends on · Logs and health views query backend triage and snapshot commands
