# xdankit/nexus-console architecture

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

- Interactive diagram: https://gitdiagram.com/xdankit/nexus-console
- Repository: https://github.com/xdankit/nexus-console

## Overview

Nexus Console is a local macOS/Tauri app for managing Homebrew and developer-machine workflows. The principal path is service discovery, reconciliation with the user's managed list and intent, then service controls that invoke native Homebrew operations; live status also feeds sessions and the menu-bar count. Other documented modules cover packages, ports, health checks, Claude chat archiving, and an interactive terminal. Edges use README claims and shown registration/call sites; unsampled module internals are represented at their source paths without assuming detailed wiring.

Main entry points: [`src-tauri/src/commands/services.rs`](https://github.com/xdankit/nexus-console/blob/main/src-tauri/src/commands/services.rs) (Brew commands), [`src/features/services/pages/ServicesPage/ServicesPage.tsx`](https://github.com/xdankit/nexus-console/blob/main/src/features/services/pages/ServicesPage/ServicesPage.tsx) (Services interface), [`src/shared/brew/useServices.ts`](https://github.com/xdankit/nexus-console/blob/main/src/shared/brew/useServices.ts) (Service discovery), [`src/features/services/useServiceControls.ts`](https://github.com/xdankit/nexus-console/blob/main/src/features/services/useServiceControls.ts) (Service controls)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["App and navigation"]
  node_app["App shell<br/>[App.tsx]"]
  node_modules["Module selection"]
  node_state["App state"]
  node_settings["Settings<br/>[SettingsPage.tsx]"]
end

subgraph group_brew["Homebrew management"]
  node_servicesui["Services interface<br/>[ServicesPage.tsx]"]
  node_discovery["Service discovery<br/>[useServices.ts]"]
  node_reconcile["Service reconciliation<br/>[reconcile.ts]"]
  node_controls["Service controls"]
  node_packages["Package manager<br/>[PackagesPage.tsx]"]
  node_sessions["Service sessions<br/>[SessionsPage.tsx]"]
end

subgraph group_tools["Developer tools"]
  node_ports["Port monitor<br/>[PortsPage.tsx]"]
  node_doctor["Health checks<br/>[DoctorPage.tsx]"]
  node_archiver["Claude chat archive<br/>[ArchiverPage.tsx]"]
  node_terminal["Integrated terminal<br/>[TerminalDrawer.tsx]"]
end

subgraph group_native["Tauri native core"]
  node_brewcommands["Brew commands<br/>[services.rs]"]
  node_brewrunner["Homebrew runner<br/>[brew.rs]"]
  node_pty["PTY management<br/>[pty.rs]"]
  node_doctorcore["Doctor probes<br/>[mod.rs]"]
  node_sessionscore["Session tracking<br/>[session.rs]"]
  node_context["Machine context<br/>[context.rs]"]
  node_tray["Menu bar<br/>[tray.rs]"]
end

node_user(("User"))
node_brew["Homebrew CLI"]

node_user -->|"uses"| node_app
node_app -->|"gates modules"| node_modules
node_user -->|"manages services"| node_servicesui
node_servicesui -.->|"shows live data"| node_discovery
node_discovery -.->|"queries services"| node_brewcommands
node_brewcommands -->|"runs Homebrew"| node_brewrunner
node_brewrunner -->|"invokes CLI"| node_brew
node_discovery -->|"supplies live list"| node_reconcile
node_reconcile -->|"reads managed intent"| node_state
node_servicesui -.->|"offers actions"| node_controls
node_controls -->|"records intent"| node_state
node_controls -.->|"starts or stops"| node_brewcommands
node_user -->|"manages packages"| node_packages
node_user -->|"reviews uptime"| node_sessions
node_user -->|"inspects ports"| node_ports
node_user -->|"runs health checks"| node_doctor
node_user -->|"archives chats"| node_archiver
node_user -->|"opens shell"| node_terminal
node_terminal -.->|"uses PTY"| node_pty
node_doctor -.->|"requests scans"| node_doctorcore
node_brewcommands -->|"records service intent"| node_sessionscore
node_user -->|"configures modules"| node_settings
node_context -.->|"provides brew path"| node_brewcommands
node_brewcommands -.->|"updates service count"| node_tray

click node_app "https://github.com/xdankit/nexus-console/blob/main/src/app/App.tsx"
click node_modules "https://github.com/xdankit/nexus-console/blob/main/src/shared/modules/useEnabledModules.ts"
click node_state "https://github.com/xdankit/nexus-console/blob/main/src/shared/state/serviceIntentSlice.ts"
click node_servicesui "https://github.com/xdankit/nexus-console/blob/main/src/features/services/pages/ServicesPage/ServicesPage.tsx"
click node_discovery "https://github.com/xdankit/nexus-console/blob/main/src/shared/brew/useServices.ts"
click node_reconcile "https://github.com/xdankit/nexus-console/blob/main/src/shared/brew/reconcile.ts"
click node_controls "https://github.com/xdankit/nexus-console/blob/main/src/features/services/useServiceControls.ts"
click node_brewcommands "https://github.com/xdankit/nexus-console/blob/main/src-tauri/src/commands/services.rs"
click node_brewrunner "https://github.com/xdankit/nexus-console/blob/main/src-tauri/src/brew.rs"
click node_packages "https://github.com/xdankit/nexus-console/blob/main/src/features/packages/pages/PackagesPage/PackagesPage.tsx"
click node_sessions "https://github.com/xdankit/nexus-console/blob/main/src/features/sessions/pages/SessionsPage/SessionsPage.tsx"
click node_ports "https://github.com/xdankit/nexus-console/blob/main/src/features/ports/pages/PortsPage/PortsPage.tsx"
click node_doctor "https://github.com/xdankit/nexus-console/blob/main/src/features/doctor/pages/DoctorPage/DoctorPage.tsx"
click node_archiver "https://github.com/xdankit/nexus-console/blob/main/src/features/archiver/pages/ArchiverPage/ArchiverPage.tsx"
click node_terminal "https://github.com/xdankit/nexus-console/blob/main/src/features/terminal/components/TerminalDrawer/TerminalDrawer.tsx"
click node_settings "https://github.com/xdankit/nexus-console/blob/main/src/features/settings/pages/SettingsPage/SettingsPage.tsx"
click node_pty "https://github.com/xdankit/nexus-console/blob/main/src-tauri/src/pty.rs"
click node_doctorcore "https://github.com/xdankit/nexus-console/blob/main/src-tauri/src/doctor/mod.rs"
click node_sessionscore "https://github.com/xdankit/nexus-console/blob/main/src-tauri/src/session.rs"
click node_context "https://github.com/xdankit/nexus-console/blob/main/src-tauri/src/context.rs"
click node_tray "https://github.com/xdankit/nexus-console/blob/main/src-tauri/src/tray.rs"

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_modules,node_state,node_settings,node_user toneBlue
class node_servicesui,node_discovery,node_reconcile,node_controls,node_packages,node_sessions toneAmber
class node_ports,node_doctor,node_archiver,node_terminal toneMint
class node_brewcommands,node_brewrunner,node_pty,node_doctorcore,node_sessionscore,node_context,node_tray toneRose
class node_brew toneIndigo
```

## Components

### App and navigation

- [App shell](https://github.com/xdankit/nexus-console/blob/main/src/app/App.tsx): `src/app/App.tsx`
- [Module selection](https://github.com/xdankit/nexus-console/blob/main/src/shared/modules/useEnabledModules.ts): `src/shared/modules/useEnabledModules.ts`
- [App state](https://github.com/xdankit/nexus-console/blob/main/src/shared/state/serviceIntentSlice.ts): `src/shared/state/serviceIntentSlice.ts`
- [Settings](https://github.com/xdankit/nexus-console/blob/main/src/features/settings/pages/SettingsPage/SettingsPage.tsx): `src/features/settings/pages/SettingsPage/SettingsPage.tsx`

### Homebrew management

- [Services interface](https://github.com/xdankit/nexus-console/blob/main/src/features/services/pages/ServicesPage/ServicesPage.tsx): `src/features/services/pages/ServicesPage/ServicesPage.tsx`
- [Service discovery](https://github.com/xdankit/nexus-console/blob/main/src/shared/brew/useServices.ts): `src/shared/brew/useServices.ts`
- [Service reconciliation](https://github.com/xdankit/nexus-console/blob/main/src/shared/brew/reconcile.ts): `src/shared/brew/reconcile.ts`
- [Service controls](https://github.com/xdankit/nexus-console/blob/main/src/features/services/useServiceControls.ts): `src/features/services/useServiceControls.ts`
- [Package manager](https://github.com/xdankit/nexus-console/blob/main/src/features/packages/pages/PackagesPage/PackagesPage.tsx): `src/features/packages/pages/PackagesPage/PackagesPage.tsx`
- [Service sessions](https://github.com/xdankit/nexus-console/blob/main/src/features/sessions/pages/SessionsPage/SessionsPage.tsx): `src/features/sessions/pages/SessionsPage/SessionsPage.tsx`

### Developer tools

- [Port monitor](https://github.com/xdankit/nexus-console/blob/main/src/features/ports/pages/PortsPage/PortsPage.tsx): `src/features/ports/pages/PortsPage/PortsPage.tsx`
- [Health checks](https://github.com/xdankit/nexus-console/blob/main/src/features/doctor/pages/DoctorPage/DoctorPage.tsx): `src/features/doctor/pages/DoctorPage/DoctorPage.tsx`
- [Claude chat archive](https://github.com/xdankit/nexus-console/blob/main/src/features/archiver/pages/ArchiverPage/ArchiverPage.tsx): `src/features/archiver/pages/ArchiverPage/ArchiverPage.tsx`
- [Integrated terminal](https://github.com/xdankit/nexus-console/blob/main/src/features/terminal/components/TerminalDrawer/TerminalDrawer.tsx): `src/features/terminal/components/TerminalDrawer/TerminalDrawer.tsx`

### Tauri native core

- [Brew commands](https://github.com/xdankit/nexus-console/blob/main/src-tauri/src/commands/services.rs): `src-tauri/src/commands/services.rs`
- [Homebrew runner](https://github.com/xdankit/nexus-console/blob/main/src-tauri/src/brew.rs): `src-tauri/src/brew.rs`
- [PTY management](https://github.com/xdankit/nexus-console/blob/main/src-tauri/src/pty.rs): `src-tauri/src/pty.rs`
- [Doctor probes](https://github.com/xdankit/nexus-console/blob/main/src-tauri/src/doctor/mod.rs): `src-tauri/src/doctor/mod.rs`
- [Session tracking](https://github.com/xdankit/nexus-console/blob/main/src-tauri/src/session.rs): `src-tauri/src/session.rs`
- [Machine context](https://github.com/xdankit/nexus-console/blob/main/src-tauri/src/context.rs): `src-tauri/src/context.rs`
- [Menu bar](https://github.com/xdankit/nexus-console/blob/main/src-tauri/src/tray.rs): `src-tauri/src/tray.rs`

### Other components

- **User**
- **Homebrew CLI**

## Connections

- User → App shell: uses
- App shell → Module selection: gates modules (evidence: `src/app/App.tsx`)
- User → Services interface: manages services
- Services interface → Service discovery: shows live data
- Service discovery → Brew commands: queries services
- Brew commands → Homebrew runner: runs Homebrew (evidence: `src-tauri/src/commands/services.rs`)
- Homebrew runner → Homebrew CLI: invokes CLI
- Service discovery → Service reconciliation: supplies live list (evidence: `src/shared/brew/useReconciledServices.ts`)
- Service reconciliation → App state: reads managed intent
- Services interface → Service controls: offers actions
- Service controls → App state: records intent (evidence: `src/features/services/useServiceControls.ts`)
- Service controls → Brew commands: starts or stops
- User → Package manager: manages packages
- User → Service sessions: reviews uptime
- User → Port monitor: inspects ports
- User → Health checks: runs health checks
- User → Claude chat archive: archives chats
- User → Integrated terminal: opens shell
- Integrated terminal → PTY management: uses PTY
- Health checks → Doctor probes: requests scans
- Brew commands → Session tracking: records service intent (evidence: `src-tauri/src/commands/services.rs`)
- User → Settings: configures modules
- Machine context → Brew commands: provides brew path (evidence: `src-tauri/src/commands/services.rs`)
- Brew commands → Menu bar: updates service count
