# kytdk/snapshatter architecture

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

- Interactive diagram: https://gitdiagram.com/kytdk/snapshatter
- Repository: https://github.com/kytdk/snapshatter

## Overview

SnapShatter is a command-line Snapchat automation tool. The user chooses a task, and the main program runs the corresponding snap-sending, streak-maintenance, friend-adding, or scale-calibration workflow. These workflows recognize Snapchat controls in screenshots and issue device input through ADB; calibration can also establish the image scale used by recognition. The README documents the major automation capabilities, but the sampled code does not show the full behavior of every interaction. The graph reflects the shown calls and documented features; templates and Snapchat are represented as dependencies, not inspected implementations.

Main entry points: [`src/utils.py`](https://github.com/kytdk/snapshatter/blob/main/src/utils.py) (Image recognition), [`main.py`](https://github.com/kytdk/snapshatter/blob/main/main.py) (Task selection), [`images`](https://github.com/kytdk/snapshatter/tree/main/images) (Image templates)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflows["Automation workflows"]
  node_menu["Task selection<br/>[main.py]"]
  node_snaps["Send snaps<br/>[main.py]"]
  node_streaks["Maintain streaks<br/>[main.py]"]
  node_friends["Add friends<br/>[main.py]"]
  node_calibration["Scale calibration<br/>[main.py]"]
end

subgraph group_device["Device interaction"]
  node_matching["Image recognition<br/>[utils.py]"]
  node_input["Touch input<br/>[utils.py]"]
end

subgraph group_external["External dependencies"]
  node_templates["Image templates"]
  node_adb["ADB device"]
  node_snapchat["Snapchat app"]
end

node_user(("User"))

node_user -->|"chooses task"| node_menu
node_menu -->|"dispatches"| node_snaps
node_menu -->|"dispatches"| node_streaks
node_menu -->|"dispatches"| node_friends
node_menu -->|"dispatches"| node_calibration
node_snaps -->|"recognizes controls"| node_matching
node_streaks -->|"recognizes controls"| node_matching
node_friends -->|"recognizes controls"| node_matching
node_calibration -->|"captures screen"| node_adb
node_calibration -->|"loads template"| node_templates
node_calibration -->|"sets scale"| node_matching
node_matching -->|"captures screen"| node_adb
node_matching -->|"loads template"| node_templates
node_matching -->|"taps matches"| node_input
node_input -->|"sends commands"| node_adb
node_adb -.->|"controls app"| node_snapchat

click node_menu "https://github.com/kytdk/snapshatter/blob/main/main.py"
click node_snaps "https://github.com/kytdk/snapshatter/blob/main/main.py"
click node_streaks "https://github.com/kytdk/snapshatter/blob/main/main.py"
click node_friends "https://github.com/kytdk/snapshatter/blob/main/main.py"
click node_calibration "https://github.com/kytdk/snapshatter/blob/main/main.py"
click node_matching "https://github.com/kytdk/snapshatter/blob/main/src/utils.py"
click node_input "https://github.com/kytdk/snapshatter/blob/main/src/utils.py"
click node_templates "https://github.com/kytdk/snapshatter/tree/main/images"

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_menu,node_snaps,node_streaks,node_friends,node_calibration,node_user toneBlue
class node_matching,node_input toneAmber
class node_templates,node_adb,node_snapchat toneMint
```

## Components

### Automation workflows

- [Task selection](https://github.com/kytdk/snapshatter/blob/main/main.py): `main.py`
- [Send snaps](https://github.com/kytdk/snapshatter/blob/main/main.py): `main.py`
- [Maintain streaks](https://github.com/kytdk/snapshatter/blob/main/main.py): `main.py`
- [Add friends](https://github.com/kytdk/snapshatter/blob/main/main.py): `main.py`
- [Scale calibration](https://github.com/kytdk/snapshatter/blob/main/main.py): `main.py`

### Device interaction

- [Image recognition](https://github.com/kytdk/snapshatter/blob/main/src/utils.py): `src/utils.py`
- [Touch input](https://github.com/kytdk/snapshatter/blob/main/src/utils.py): `src/utils.py`

### External dependencies

- [Image templates](https://github.com/kytdk/snapshatter/tree/main/images): `images`
- **ADB device**
- **Snapchat app**

### Other components

- **User**

## Connections

- User → Task selection: chooses task (evidence: `main.py`)
- Task selection → Send snaps: dispatches (evidence: `main.py`)
- Task selection → Maintain streaks: dispatches (evidence: `main.py`)
- Task selection → Add friends: dispatches (evidence: `main.py`)
- Task selection → Scale calibration: dispatches (evidence: `main.py`)
- Send snaps → Image recognition: recognizes controls (evidence: `main.py`)
- Maintain streaks → Image recognition: recognizes controls (evidence: `main.py`)
- Add friends → Image recognition: recognizes controls (evidence: `main.py`)
- Scale calibration → ADB device: captures screen (evidence: `main.py`)
- Scale calibration → Image templates: loads template (evidence: `main.py`)
- Scale calibration → Image recognition: sets scale (evidence: `main.py`)
- Image recognition → ADB device: captures screen (evidence: `src/utils.py`)
- Image recognition → Image templates: loads template (evidence: `src/utils.py`)
- Image recognition → Touch input: taps matches (evidence: `src/utils.py`)
- Touch input → ADB device: sends commands (evidence: `src/utils.py`)
- ADB device → Snapchat app: controls app
