# sayedarshad2003/lgsm architecture

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

- Interactive diagram: https://gitdiagram.com/sayedarshad2003/lgsm
- Repository: https://github.com/sayedarshad2003/lgsm

## Overview

LGMS is a local-first Git management suite with WPF desktop and ASP.NET MVC web frontends sharing a .NET Core engine. The main workflow discovers repositories in a workspace, presents repository status and changes, then supports diff inspection, staging, commits, and synchronization. Branches, history, stashes, remotes, a Git console, and settings are additional product capabilities. Edges reflect sampled calls, registrations, or README descriptions; unsampled view/controller wiring is not inferred.

Main entry points: [`Controllers`](https://github.com/sayedarshad2003/lgsm/tree/main/Controllers) (Web controllers), [`LGMS.Core/Services/GitService.cs`](https://github.com/sayedarshad2003/lgsm/blob/main/LGMS.Core/Services/GitService.cs) (Git service), [`LGMS.Desktop/ViewModels/MainViewModel.cs`](https://github.com/sayedarshad2003/lgsm/blob/main/LGMS.Desktop/ViewModels/MainViewModel.cs) (Desktop workspace), [`LGMS.Core/Services/RepositoryScanner.cs`](https://github.com/sayedarshad2003/lgsm/blob/main/LGMS.Core/Services/RepositoryScanner.cs) (Repository scanner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontends["User interfaces"]
  node_web["Web application<br/>[Program.cs]"]
  node_webcontrollers["Web controllers"]
  node_webviews["Web views"]
  node_desktopvm["Desktop workspace<br/>[MainViewModel.cs]"]
  node_desktopview["Desktop window<br/>[MainWindow.xaml]"]
  node_websettings["Settings interface"]
end

subgraph group_discovery["Workspace discovery"]
  node_scanner["Repository scanner"]
  node_repository["Repository details<br/>[Repository.cs]"]
end

subgraph group_gitops["Git operations"]
  node_gitservice["Git service<br/>[GitService.cs]"]
  node_gitstatus["Status and changes<br/>[GitStatus.cs]"]
  node_gitmodels["Git domain models<br/>[Models]"]
  node_history["History and patches"]
  node_branches["Branch management"]
  node_changes["Changes and diffs<br/>[GitController.cs]"]
  node_stashremotes["Stashes and remotes<br/>[GitController.cs]"]
  node_console["Git console"]
end

subgraph group_runtime["Execution and settings"]
  node_settings["Workspace settings"]
  node_settingsservice["Desktop settings persistence<br/>[SettingsService.cs]"]
  node_processservice["Process service<br/>[ProcessService.cs]"]
end

node_developer(("Developer"))
node_gitcli["Local Git CLI"]
node_worktree[("Local repositories")]
node_externalgit(("Git upstreams"))

node_developer -->|"uses"| node_web
node_developer -->|"uses"| node_desktopvm
node_web -->|"routes requests"| node_webcontrollers
node_webcontrollers -.->|"renders"| node_webviews
node_web -->|"registers"| node_scanner
node_web -->|"registers"| node_gitservice
node_desktopvm -->|"scans workspace"| node_scanner
node_desktopvm -->|"manages repositories"| node_gitservice
node_desktopvm -->|"runs Git checks"| node_processservice
node_desktopview -->|"binds to"| node_desktopvm
node_scanner -->|"builds details"| node_repository
node_scanner -->|"queries Git"| node_processservice
node_scanner -->|"discovers"| node_worktree
node_gitservice -->|"executes commands"| node_processservice
node_processservice -->|"invokes"| node_gitcli
node_gitcli -.->|"reads and updates"| node_worktree
node_gitservice -->|"parses status"| node_gitstatus
node_gitservice -->|"returns Git data"| node_gitmodels
node_webcontrollers -->|"resolves repositories"| node_scanner
node_webcontrollers -->|"requests Git actions"| node_gitservice
node_webcontrollers -->|"routes history"| node_history
node_webcontrollers -->|"routes branch actions"| node_branches
node_webcontrollers -->|"routes change actions"| node_changes
node_webcontrollers -->|"routes stash and remote actions"| node_stashremotes
node_webcontrollers -->|"routes commands"| node_console
node_webcontrollers -->|"routes settings"| node_websettings
node_desktopvm -.->|"persists preferences"| node_settingsservice
node_settingsservice -->|"loads and saves"| node_settings
node_gitservice -.->|"syncs with remotes"| node_externalgit

click node_web "https://github.com/sayedarshad2003/lgsm/blob/main/Program.cs"
click node_webcontrollers "https://github.com/sayedarshad2003/lgsm/tree/main/Controllers"
click node_webviews "https://github.com/sayedarshad2003/lgsm/tree/main/Views"
click node_desktopvm "https://github.com/sayedarshad2003/lgsm/blob/main/LGMS.Desktop/ViewModels/MainViewModel.cs"
click node_desktopview "https://github.com/sayedarshad2003/lgsm/blob/main/LGMS.Desktop/MainWindow.xaml"
click node_scanner "https://github.com/sayedarshad2003/lgsm/blob/main/LGMS.Core/Services/RepositoryScanner.cs"
click node_repository "https://github.com/sayedarshad2003/lgsm/blob/main/LGMS.Core/Models/Repository.cs"
click node_settings "https://github.com/sayedarshad2003/lgsm/blob/main/LGMS.Core/Models/WorkspaceSettings.cs"
click node_settingsservice "https://github.com/sayedarshad2003/lgsm/blob/main/LGMS.Desktop/Services/SettingsService.cs"
click node_gitservice "https://github.com/sayedarshad2003/lgsm/blob/main/LGMS.Core/Services/GitService.cs"
click node_gitstatus "https://github.com/sayedarshad2003/lgsm/blob/main/LGMS.Core/Models/GitStatus.cs"
click node_gitmodels "https://github.com/sayedarshad2003/lgsm/tree/main/LGMS.Core/Models"
click node_processservice "https://github.com/sayedarshad2003/lgsm/blob/main/LGMS.Core/Services/ProcessService.cs"
click node_history "https://github.com/sayedarshad2003/lgsm/blob/main/Controllers/CommitController.cs"
click node_branches "https://github.com/sayedarshad2003/lgsm/blob/main/Controllers/BranchController.cs"
click node_changes "https://github.com/sayedarshad2003/lgsm/blob/main/Controllers/GitController.cs"
click node_stashremotes "https://github.com/sayedarshad2003/lgsm/blob/main/Controllers/GitController.cs"
click node_console "https://github.com/sayedarshad2003/lgsm/blob/main/Controllers/TerminalController.cs"
click node_websettings "https://github.com/sayedarshad2003/lgsm/blob/main/Controllers/SettingsController.cs"

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_web,node_webcontrollers,node_webviews,node_desktopvm,node_desktopview,node_websettings toneBlue
class node_scanner,node_repository,node_worktree toneAmber
class node_gitservice,node_gitstatus,node_gitmodels,node_history,node_branches,node_changes,node_stashremotes,node_console toneMint
class node_settings,node_settingsservice,node_processservice toneRose
class node_developer,node_gitcli,node_externalgit toneIndigo
```

## Components

### User interfaces

- [Web application](https://github.com/sayedarshad2003/lgsm/blob/main/Program.cs): `Program.cs`
- [Web controllers](https://github.com/sayedarshad2003/lgsm/tree/main/Controllers): `Controllers`
- [Web views](https://github.com/sayedarshad2003/lgsm/tree/main/Views): `Views`
- [Desktop workspace](https://github.com/sayedarshad2003/lgsm/blob/main/LGMS.Desktop/ViewModels/MainViewModel.cs): `LGMS.Desktop/ViewModels/MainViewModel.cs`
- [Desktop window](https://github.com/sayedarshad2003/lgsm/blob/main/LGMS.Desktop/MainWindow.xaml): `LGMS.Desktop/MainWindow.xaml`
- [Settings interface](https://github.com/sayedarshad2003/lgsm/blob/main/Controllers/SettingsController.cs): `Controllers/SettingsController.cs`

### Workspace discovery

- [Repository scanner](https://github.com/sayedarshad2003/lgsm/blob/main/LGMS.Core/Services/RepositoryScanner.cs): `LGMS.Core/Services/RepositoryScanner.cs`
- [Repository details](https://github.com/sayedarshad2003/lgsm/blob/main/LGMS.Core/Models/Repository.cs): `LGMS.Core/Models/Repository.cs`

### Git operations

- [Git service](https://github.com/sayedarshad2003/lgsm/blob/main/LGMS.Core/Services/GitService.cs): `LGMS.Core/Services/GitService.cs`
- [Status and changes](https://github.com/sayedarshad2003/lgsm/blob/main/LGMS.Core/Models/GitStatus.cs): `LGMS.Core/Models/GitStatus.cs`
- [Git domain models](https://github.com/sayedarshad2003/lgsm/tree/main/LGMS.Core/Models): `LGMS.Core/Models`
- [History and patches](https://github.com/sayedarshad2003/lgsm/blob/main/Controllers/CommitController.cs): `Controllers/CommitController.cs`
- [Branch management](https://github.com/sayedarshad2003/lgsm/blob/main/Controllers/BranchController.cs): `Controllers/BranchController.cs`
- [Changes and diffs](https://github.com/sayedarshad2003/lgsm/blob/main/Controllers/GitController.cs): `Controllers/GitController.cs`
- [Stashes and remotes](https://github.com/sayedarshad2003/lgsm/blob/main/Controllers/GitController.cs): `Controllers/GitController.cs`
- [Git console](https://github.com/sayedarshad2003/lgsm/blob/main/Controllers/TerminalController.cs): `Controllers/TerminalController.cs`

### Execution and settings

- [Workspace settings](https://github.com/sayedarshad2003/lgsm/blob/main/LGMS.Core/Models/WorkspaceSettings.cs): `LGMS.Core/Models/WorkspaceSettings.cs`
- [Desktop settings persistence](https://github.com/sayedarshad2003/lgsm/blob/main/LGMS.Desktop/Services/SettingsService.cs): `LGMS.Desktop/Services/SettingsService.cs`
- [Process service](https://github.com/sayedarshad2003/lgsm/blob/main/LGMS.Core/Services/ProcessService.cs): `LGMS.Core/Services/ProcessService.cs`

### Other components

- **Developer**
- **Local Git CLI**
- **Local repositories**
- **Git upstreams**

## Connections

- Developer → Web application: uses (evidence: `README.md`)
- Developer → Desktop workspace: uses (evidence: `README.md`)
- Web application → Web controllers: routes requests (evidence: `Program.cs`)
- Web controllers → Web views: renders
- Web application → Repository scanner: registers (evidence: `Program.cs`)
- Web application → Git service: registers (evidence: `Program.cs`)
- Desktop workspace → Repository scanner: scans workspace (evidence: `LGMS.Desktop/ViewModels/MainViewModel.cs`)
- Desktop workspace → Git service: manages repositories (evidence: `LGMS.Desktop/ViewModels/MainViewModel.cs`)
- Desktop workspace → Process service: runs Git checks (evidence: `LGMS.Desktop/ViewModels/MainViewModel.cs`)
- Desktop window → Desktop workspace: binds to
- Repository scanner → Repository details: builds details (evidence: `LGMS.Core/Services/RepositoryScanner.cs`)
- Repository scanner → Process service: queries Git (evidence: `LGMS.Core/Services/RepositoryScanner.cs`)
- Repository scanner → Local repositories: discovers (evidence: `README.md`)
- Git service → Process service: executes commands (evidence: `LGMS.Core/Services/GitService.cs`)
- Process service → Local Git CLI: invokes (evidence: `README.md`)
- Local Git CLI → Local repositories: reads and updates
- Git service → Status and changes: parses status (evidence: `LGMS.Core/Services/GitService.cs`)
- Git service → Git domain models: returns Git data (evidence: `LGMS.Core/Services/GitService.cs`)
- Web controllers → Repository scanner: resolves repositories (evidence: `Controllers/GitController.cs`)
- Web controllers → Git service: requests Git actions (evidence: `Controllers/GitController.cs`)
- Web controllers → History and patches: routes history (evidence: `README.md`)
- Web controllers → Branch management: routes branch actions (evidence: `README.md`)
- Web controllers → Changes and diffs: routes change actions (evidence: `Controllers/GitController.cs`)
- Web controllers → Stashes and remotes: routes stash and remote actions (evidence: `Controllers/GitController.cs`)
- Web controllers → Git console: routes commands (evidence: `README.md`)
- Web controllers → Settings interface: routes settings (evidence: `README.md`)
- Desktop workspace → Desktop settings persistence: persists preferences
- Desktop settings persistence → Workspace settings: loads and saves (evidence: `LGMS.Desktop/Services/SettingsService.cs`)
- Git service → Git upstreams: syncs with remotes
