# ad-h/smart-application-lifecycle-manager architecture

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

- Interactive diagram: https://gitdiagram.com/ad-h/smart-application-lifecycle-manager
- Repository: https://github.com/ad-h/smart-application-lifecycle-manager

## Overview

SALM monitors processes, scores and classifies their resource use and inactivity, then recommends or automates lifecycle actions. The principal interactive workflow runs through the FastAPI app and browser UI; a separate CLI monitor provides a terminal view. Automation repeatedly scans processes, applies protection and decision rules, suspends eligible processes, and can resume managed ones. The excerpts show these calls and the UI-serving route; browser-side API behavior is not inspected.

Main entry points: [`webapp.py`](https://github.com/ad-h/smart-application-lifecycle-manager/blob/main/webapp.py) (FastAPI app), [`automation_manager.py`](https://github.com/ad-h/smart-application-lifecycle-manager/blob/main/automation_manager.py) (Automation manager), [`main.py`](https://github.com/ad-h/smart-application-lifecycle-manager/blob/main/main.py) (CLI monitor), [`lifecycle_controller.py`](https://github.com/ad-h/smart-application-lifecycle-manager/blob/main/lifecycle_controller.py) (Lifecycle controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_webapp["FastAPI app<br/>[webapp.py]"]
  node_dashboard["Web dashboard<br/>[index.html]"]
  node_cli["CLI monitor<br/>[main.py]"]
end

subgraph group_analysis["Process analysis"]
  node_tracker["Activity tracker"]
  node_scorer["Resource scoring"]
  node_classifier["Process classifier<br/>[classifier.py]"]
  node_decision["Decision engine<br/>[decision_engine.py]"]
end

subgraph group_automation["Lifecycle automation"]
  node_automation["Automation manager"]
  node_protection["Process protection"]
  node_lifecycle["Lifecycle controller"]
end

subgraph group_system["Operating system"]
  node_processes[("Host processes")]
end

node_user(("User"))

node_user -->|"uses"| node_webapp
node_webapp -->|"serves"| node_dashboard
node_webapp -->|"controls"| node_automation
node_webapp -->|"enumerates"| node_processes
node_webapp -->|"updates"| node_tracker
node_webapp -->|"scores"| node_scorer
node_webapp -->|"classifies"| node_classifier
node_webapp -->|"decides"| node_decision
node_webapp -->|"checks"| node_protection
node_webapp -->|"requests actions"| node_lifecycle
node_cli -->|"enumerates"| node_processes
node_cli -->|"updates"| node_tracker
node_cli -->|"scores"| node_scorer
node_cli -->|"classifies"| node_classifier
node_cli -->|"decides"| node_decision
node_cli -->|"checks"| node_protection
node_automation -->|"scans"| node_processes
node_automation -->|"updates"| node_tracker
node_automation -->|"scores"| node_scorer
node_automation -->|"classifies"| node_classifier
node_automation -->|"decides"| node_decision
node_automation -->|"checks"| node_protection
node_automation -->|"suspends and resumes"| node_lifecycle
node_lifecycle -->|"changes state"| node_processes

click node_webapp "https://github.com/ad-h/smart-application-lifecycle-manager/blob/main/webapp.py"
click node_dashboard "https://github.com/ad-h/smart-application-lifecycle-manager/blob/main/static/index.html"
click node_cli "https://github.com/ad-h/smart-application-lifecycle-manager/blob/main/main.py"
click node_automation "https://github.com/ad-h/smart-application-lifecycle-manager/blob/main/automation_manager.py"
click node_tracker "https://github.com/ad-h/smart-application-lifecycle-manager/blob/main/activity_tracker.py"
click node_scorer "https://github.com/ad-h/smart-application-lifecycle-manager/blob/main/resource_analyzer.py"
click node_classifier "https://github.com/ad-h/smart-application-lifecycle-manager/blob/main/classifier.py"
click node_decision "https://github.com/ad-h/smart-application-lifecycle-manager/blob/main/decision_engine.py"
click node_protection "https://github.com/ad-h/smart-application-lifecycle-manager/blob/main/process_protection.py"
click node_lifecycle "https://github.com/ad-h/smart-application-lifecycle-manager/blob/main/lifecycle_controller.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_webapp,node_dashboard,node_cli,node_user toneBlue
class node_tracker,node_scorer,node_classifier,node_decision toneAmber
class node_automation,node_protection,node_lifecycle toneMint
class node_processes toneRose
```

## Components

### User interfaces

- [FastAPI app](https://github.com/ad-h/smart-application-lifecycle-manager/blob/main/webapp.py): `webapp.py`
- [Web dashboard](https://github.com/ad-h/smart-application-lifecycle-manager/blob/main/static/index.html): `static/index.html`
- [CLI monitor](https://github.com/ad-h/smart-application-lifecycle-manager/blob/main/main.py): `main.py`

### Process analysis

- [Activity tracker](https://github.com/ad-h/smart-application-lifecycle-manager/blob/main/activity_tracker.py): `activity_tracker.py`
- [Resource scoring](https://github.com/ad-h/smart-application-lifecycle-manager/blob/main/resource_analyzer.py): `resource_analyzer.py`
- [Process classifier](https://github.com/ad-h/smart-application-lifecycle-manager/blob/main/classifier.py): `classifier.py`
- [Decision engine](https://github.com/ad-h/smart-application-lifecycle-manager/blob/main/decision_engine.py): `decision_engine.py`

### Lifecycle automation

- [Automation manager](https://github.com/ad-h/smart-application-lifecycle-manager/blob/main/automation_manager.py): `automation_manager.py`
- [Process protection](https://github.com/ad-h/smart-application-lifecycle-manager/blob/main/process_protection.py): `process_protection.py`
- [Lifecycle controller](https://github.com/ad-h/smart-application-lifecycle-manager/blob/main/lifecycle_controller.py): `lifecycle_controller.py`

### Operating system

- **Host processes**

### Other components

- **User**

## Connections

- User → FastAPI app: uses (evidence: `webapp.py`)
- FastAPI app → Web dashboard: serves (evidence: `webapp.py`)
- FastAPI app → Automation manager: controls (evidence: `webapp.py`)
- FastAPI app → Host processes: enumerates (evidence: `webapp.py`)
- FastAPI app → Activity tracker: updates (evidence: `webapp.py`)
- FastAPI app → Resource scoring: scores (evidence: `webapp.py`)
- FastAPI app → Process classifier: classifies (evidence: `webapp.py`)
- FastAPI app → Decision engine: decides (evidence: `webapp.py`)
- FastAPI app → Process protection: checks (evidence: `webapp.py`)
- FastAPI app → Lifecycle controller: requests actions (evidence: `webapp.py`)
- CLI monitor → Host processes: enumerates (evidence: `main.py`)
- CLI monitor → Activity tracker: updates (evidence: `main.py`)
- CLI monitor → Resource scoring: scores (evidence: `main.py`)
- CLI monitor → Process classifier: classifies (evidence: `main.py`)
- CLI monitor → Decision engine: decides (evidence: `main.py`)
- CLI monitor → Process protection: checks (evidence: `main.py`)
- Automation manager → Host processes: scans (evidence: `automation_manager.py`)
- Automation manager → Activity tracker: updates (evidence: `automation_manager.py`)
- Automation manager → Resource scoring: scores (evidence: `automation_manager.py`)
- Automation manager → Process classifier: classifies (evidence: `automation_manager.py`)
- Automation manager → Decision engine: decides (evidence: `automation_manager.py`)
- Automation manager → Process protection: checks (evidence: `automation_manager.py`)
- Automation manager → Lifecycle controller: suspends and resumes (evidence: `automation_manager.py`)
- Lifecycle controller → Host processes: changes state (evidence: `lifecycle_controller.py`)
