# perryvegehan/cleanlaptop architecture

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

- Interactive diagram: https://gitdiagram.com/perryvegehan/cleanlaptop
- Repository: https://github.com/perryvegehan/cleanlaptop

## Overview

CleanLaptop is a small Python utility that captures a webcam image, saves it as photo.png, and displays it. The documented setup runs the script once, and the installed pre-commit hook runs it before commits. The capture and display behavior is visible in scripts/script.py; setup and hook wiring are documented in the README, but their source contents were not sampled.

Main entry points: [`scripts/script.py`](https://github.com/perryvegehan/cleanlaptop/blob/main/scripts/script.py) (Photo capture), [`setup.sh`](https://github.com/perryvegehan/cleanlaptop/blob/main/setup.sh) (Setup command)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("User"))
node_git_commit(("Git commit"))
node_setup["Setup command<br/>[setup.sh]"]
node_script["Photo capture<br/>[script.py]"]
node_camera["Webcam"]
node_photo["Saved photo"]
node_window["Photo window"]

node_user -->|"runs setup"| node_setup
node_setup -->|"runs once"| node_script
node_git_commit -->|"runs before commit"| node_script
node_script -->|"captures frame"| node_camera
node_script -->|"writes image"| node_photo
node_script -->|"displays frame"| node_window

click node_setup "https://github.com/perryvegehan/cleanlaptop/blob/main/setup.sh"
click node_script "https://github.com/perryvegehan/cleanlaptop/blob/main/scripts/script.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_user toneBlue
class node_git_commit,node_camera,node_photo,node_window toneIndigo
class node_setup,node_script toneTeal
```

## Components

### Other components

- **User**
- **Git commit**
- [Setup command](https://github.com/perryvegehan/cleanlaptop/blob/main/setup.sh): `setup.sh`
- [Photo capture](https://github.com/perryvegehan/cleanlaptop/blob/main/scripts/script.py): `scripts/script.py`
- **Webcam**
- **Saved photo**
- **Photo window**

## Connections

- User → Setup command: runs setup (evidence: `README.md`)
- Setup command → Photo capture: runs once (evidence: `README.md`)
- Git commit → Photo capture: runs before commit (evidence: `README.md`)
- Photo capture → Webcam: captures frame (evidence: `scripts/script.py`)
- Photo capture → Saved photo: writes image (evidence: `scripts/script.py`)
- Photo capture → Photo window: displays frame (evidence: `scripts/script.py`)
