# jeziellago/beautycat architecture

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

- Interactive diagram: https://gitdiagram.com/jeziellago/beautycat
- Repository: https://github.com/jeziellago/beautycat

## Overview

BeautyCat is a web-based Android logcat viewer. The main workflow is launching the local server, selecting a device, streaming and parsing its logcat output into per-device sessions, then viewing and filtering records in the browser. The graph also captures device discovery and clearing, PID-to-package enrichment, saved presets, and export. The frontend implementation was not excerpted, so its internal request handling is not mapped; documented browser/server behavior is retained.

Main entry points: [`beautycat/server.py`](https://github.com/jeziellago/beautycat/blob/main/beautycat/server.py) (HTTP / WS API), [`beautycat/session.py`](https://github.com/jeziellago/beautycat/blob/main/beautycat/session.py) (Device Sessions), [`beautycat/adb.py`](https://github.com/jeziellago/beautycat/blob/main/beautycat/adb.py) (ADB Adapter), [`beautycat/web/app.js`](https://github.com/jeziellago/beautycat/blob/main/beautycat/web/app.js) (Browser UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime and API"]
  node_cli["Command Line<br/>[cli.py]"]
  node_server["HTTP / WS API<br/>[server.py]"]
end

subgraph group_collection["Log Collection"]
  node_adb["ADB Adapter<br/>[adb.py]"]
  node_sessions["Device Sessions<br/>[session.py]"]
  node_resolver["Package Resolver<br/>[resolver.py]"]
end

subgraph group_logdata["Log Data"]
  node_parser["Logcat Parser<br/>[parser.py]"]
  node_buffer[("Per-device Buffer<br/>[buffer.py]")]
  node_filters["Log Filters<br/>[filters.py]"]
  node_presets[("Preset Store<br/>[presets.py]")]
end

subgraph group_browser["Browser Experience"]
  node_browser["Browser UI<br/>[app.js]"]
  node_webpage["UI Document<br/>[index.html]"]
  node_styles["UI Styles<br/>[styles.css]"]
end

node_user(("Developer"))
node_android["Android Devices"]

node_user -->|"launches"| node_cli
node_cli -->|"creates app"| node_server
node_user -->|"uses"| node_browser
node_server -->|"serves"| node_webpage
node_browser -->|"requests / streams"| node_server
node_server -->|"lists devices"| node_adb
node_server -->|"gets sessions"| node_sessions
node_server -->|"filters exports"| node_filters
node_server -->|"manages presets"| node_presets
node_adb -->|"runs logcat / ps"| node_android
node_sessions -->|"streams / clears"| node_adb
node_sessions -->|"parses lines"| node_parser
node_sessions -->|"stores records"| node_buffer
node_sessions -->|"enriches records"| node_resolver
node_resolver -->|"refreshes process map"| node_adb
node_browser -.->|"uses styling"| node_styles

click node_cli "https://github.com/jeziellago/beautycat/blob/main/beautycat/cli.py"
click node_server "https://github.com/jeziellago/beautycat/blob/main/beautycat/server.py"
click node_adb "https://github.com/jeziellago/beautycat/blob/main/beautycat/adb.py"
click node_sessions "https://github.com/jeziellago/beautycat/blob/main/beautycat/session.py"
click node_resolver "https://github.com/jeziellago/beautycat/blob/main/beautycat/resolver.py"
click node_parser "https://github.com/jeziellago/beautycat/blob/main/beautycat/parser.py"
click node_buffer "https://github.com/jeziellago/beautycat/blob/main/beautycat/buffer.py"
click node_filters "https://github.com/jeziellago/beautycat/blob/main/beautycat/filters.py"
click node_presets "https://github.com/jeziellago/beautycat/blob/main/beautycat/presets.py"
click node_browser "https://github.com/jeziellago/beautycat/blob/main/beautycat/web/app.js"
click node_webpage "https://github.com/jeziellago/beautycat/blob/main/beautycat/web/index.html"
click node_styles "https://github.com/jeziellago/beautycat/blob/main/beautycat/web/styles.css"

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_cli,node_server toneBlue
class node_adb,node_sessions,node_resolver toneAmber
class node_parser,node_buffer,node_filters,node_presets toneMint
class node_browser,node_webpage,node_styles toneRose
class node_user,node_android toneIndigo
```

## Components

### Runtime and API

- [Command Line](https://github.com/jeziellago/beautycat/blob/main/beautycat/cli.py): `beautycat/cli.py`
- [HTTP / WS API](https://github.com/jeziellago/beautycat/blob/main/beautycat/server.py): `beautycat/server.py`

### Log Collection

- [ADB Adapter](https://github.com/jeziellago/beautycat/blob/main/beautycat/adb.py): `beautycat/adb.py`
- [Device Sessions](https://github.com/jeziellago/beautycat/blob/main/beautycat/session.py): `beautycat/session.py`
- [Package Resolver](https://github.com/jeziellago/beautycat/blob/main/beautycat/resolver.py): `beautycat/resolver.py`

### Log Data

- [Logcat Parser](https://github.com/jeziellago/beautycat/blob/main/beautycat/parser.py): `beautycat/parser.py`
- [Per-device Buffer](https://github.com/jeziellago/beautycat/blob/main/beautycat/buffer.py): `beautycat/buffer.py`
- [Log Filters](https://github.com/jeziellago/beautycat/blob/main/beautycat/filters.py): `beautycat/filters.py`
- [Preset Store](https://github.com/jeziellago/beautycat/blob/main/beautycat/presets.py): `beautycat/presets.py`

### Browser Experience

- [Browser UI](https://github.com/jeziellago/beautycat/blob/main/beautycat/web/app.js): `beautycat/web/app.js`
- [UI Document](https://github.com/jeziellago/beautycat/blob/main/beautycat/web/index.html): `beautycat/web/index.html`
- [UI Styles](https://github.com/jeziellago/beautycat/blob/main/beautycat/web/styles.css): `beautycat/web/styles.css`

### Other components

- **Developer**
- **Android Devices**

## Connections

- Developer → Command Line: launches (evidence: `README.md`)
- Command Line → HTTP / WS API: creates app (evidence: `beautycat/cli.py`)
- Developer → Browser UI: uses (evidence: `README.md`)
- HTTP / WS API → UI Document: serves (evidence: `beautycat/server.py`)
- Browser UI → HTTP / WS API: requests / streams (evidence: `README.md`)
- HTTP / WS API → ADB Adapter: lists devices (evidence: `beautycat/server.py`)
- HTTP / WS API → Device Sessions: gets sessions (evidence: `beautycat/server.py`)
- HTTP / WS API → Log Filters: filters exports (evidence: `beautycat/server.py`)
- HTTP / WS API → Preset Store: manages presets (evidence: `beautycat/server.py`)
- ADB Adapter → Android Devices: runs logcat / ps (evidence: `beautycat/adb.py`)
- Device Sessions → ADB Adapter: streams / clears (evidence: `beautycat/session.py`)
- Device Sessions → Logcat Parser: parses lines (evidence: `beautycat/session.py`)
- Device Sessions → Per-device Buffer: stores records (evidence: `beautycat/session.py`)
- Device Sessions → Package Resolver: enriches records (evidence: `beautycat/session.py`)
- Package Resolver → ADB Adapter: refreshes process map (evidence: `beautycat/resolver.py`)
- Browser UI → UI Styles: uses styling
