# imovertinker/photobooth architecture

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

- Interactive diagram: https://gitdiagram.com/imovertinker/photobooth
- Repository: https://github.com/imovertinker/photobooth

## Overview

This is a Raspberry Pi photobooth application: button presses drive creation, browsing, printing, and shutdown. In creation mode, photos and a selected frame design form a strip; the app previews it and saves completed strips. Browse mode navigates saved strips, while button actions also change frame design or strip capacity and request two-copy printing. The single-file architecture is supported by the README and sampled excerpts; omitted portions mean some action-to-function wiring is shown only where documented, and external printer details are not established.

Main entry points: [`photobooth.py`](https://github.com/imovertinker/photobooth/blob/main/photobooth.py) (App event loop), [`frames`](https://github.com/imovertinker/photobooth/tree/main/frames) (Frame assets)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_input["Input and control"]
  node_button["Button events<br/>[photobooth.py]"]
  node_queue["Action queue<br/>[photobooth.py]"]
  node_loop["App event loop<br/>[photobooth.py]"]
  node_modes["Mode control<br/>[photobooth.py]"]
  node_shutdown["Pi shutdown<br/>[photobooth.py]"]
end

subgraph group_creation["Photo creation"]
  node_capture["Photo capture<br/>[photobooth.py]"]
  node_frameconfig["Frame configuration<br/>[photobooth.py]"]
  node_composer["Strip composer<br/>[photobooth.py]"]
  node_preview["Live preview<br/>[photobooth.py]"]
end

subgraph group_review["Review and output"]
  node_saved[("Saved strips<br/>[photobooth.py]")]
  node_browse["Strip browsing<br/>[photobooth.py]"]
  node_printing["Strip printing<br/>[photobooth.py]"]
end

subgraph group_hardware["Hardware and assets"]
  node_frames["Frame assets"]
  node_camera["Pi camera"]
  node_lcd["LCD display"]
  node_printer["CUPS printer"]
end

node_user(("Photobooth user"))

node_user -->|"presses"| node_button
node_button -->|"enqueues actions"| node_queue
node_loop -->|"dequeues actions"| node_queue
node_loop -->|"dispatches mode actions"| node_modes
node_loop -->|"dispatches capture actions"| node_capture
node_loop -->|"dispatches browse actions"| node_browse
node_loop -->|"dispatches print actions"| node_printing
node_loop -->|"dispatches shutdown"| node_shutdown
node_capture -->|"captures images"| node_camera
node_capture -->|"supplies photos"| node_composer
node_frameconfig -->|"reads designs"| node_frames
node_composer -->|"loads slot layout"| node_frameconfig
node_composer -->|"loads frame image"| node_frames
node_preview -->|"captures preview"| node_camera
node_preview -->|"composes preview"| node_composer
node_preview -->|"updates display"| node_lcd
node_capture -->|"saves strip archive"| node_saved
node_browse -->|"reads saved strips"| node_saved
node_printing -->|"prints selected strips"| node_saved
node_printing -->|"submits print job"| node_printer

click node_button "https://github.com/imovertinker/photobooth/blob/main/photobooth.py"
click node_queue "https://github.com/imovertinker/photobooth/blob/main/photobooth.py"
click node_loop "https://github.com/imovertinker/photobooth/blob/main/photobooth.py"
click node_modes "https://github.com/imovertinker/photobooth/blob/main/photobooth.py"
click node_capture "https://github.com/imovertinker/photobooth/blob/main/photobooth.py"
click node_frames "https://github.com/imovertinker/photobooth/tree/main/frames"
click node_frameconfig "https://github.com/imovertinker/photobooth/blob/main/photobooth.py"
click node_composer "https://github.com/imovertinker/photobooth/blob/main/photobooth.py"
click node_preview "https://github.com/imovertinker/photobooth/blob/main/photobooth.py"
click node_saved "https://github.com/imovertinker/photobooth/blob/main/photobooth.py"
click node_browse "https://github.com/imovertinker/photobooth/blob/main/photobooth.py"
click node_printing "https://github.com/imovertinker/photobooth/blob/main/photobooth.py"
click node_shutdown "https://github.com/imovertinker/photobooth/blob/main/photobooth.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_button,node_queue,node_loop,node_modes,node_shutdown,node_user toneBlue
class node_capture,node_frameconfig,node_composer,node_preview toneAmber
class node_saved,node_browse,node_printing toneMint
class node_frames,node_camera,node_lcd,node_printer toneRose
```

## Components

### Input and control

- [Button events](https://github.com/imovertinker/photobooth/blob/main/photobooth.py): `photobooth.py`
- [Action queue](https://github.com/imovertinker/photobooth/blob/main/photobooth.py): `photobooth.py`
- [App event loop](https://github.com/imovertinker/photobooth/blob/main/photobooth.py): `photobooth.py`
- [Mode control](https://github.com/imovertinker/photobooth/blob/main/photobooth.py): `photobooth.py`
- [Pi shutdown](https://github.com/imovertinker/photobooth/blob/main/photobooth.py): `photobooth.py`

### Photo creation

- [Photo capture](https://github.com/imovertinker/photobooth/blob/main/photobooth.py): `photobooth.py`
- [Frame configuration](https://github.com/imovertinker/photobooth/blob/main/photobooth.py): `photobooth.py`
- [Strip composer](https://github.com/imovertinker/photobooth/blob/main/photobooth.py): `photobooth.py`
- [Live preview](https://github.com/imovertinker/photobooth/blob/main/photobooth.py): `photobooth.py`

### Review and output

- [Saved strips](https://github.com/imovertinker/photobooth/blob/main/photobooth.py): `photobooth.py`
- [Strip browsing](https://github.com/imovertinker/photobooth/blob/main/photobooth.py): `photobooth.py`
- [Strip printing](https://github.com/imovertinker/photobooth/blob/main/photobooth.py): `photobooth.py`

### Hardware and assets

- [Frame assets](https://github.com/imovertinker/photobooth/tree/main/frames): `frames`
- **Pi camera**
- **LCD display**
- **CUPS printer**

### Other components

- **Photobooth user**

## Connections

- Photobooth user → Button events: presses
- Button events → Action queue: enqueues actions
- App event loop → Action queue: dequeues actions
- App event loop → Mode control: dispatches mode actions
- App event loop → Photo capture: dispatches capture actions
- App event loop → Strip browsing: dispatches browse actions
- App event loop → Strip printing: dispatches print actions
- App event loop → Pi shutdown: dispatches shutdown
- Photo capture → Pi camera: captures images
- Photo capture → Strip composer: supplies photos
- Frame configuration → Frame assets: reads designs
- Strip composer → Frame configuration: loads slot layout
- Strip composer → Frame assets: loads frame image
- Live preview → Pi camera: captures preview
- Live preview → Strip composer: composes preview
- Live preview → LCD display: updates display
- Photo capture → Saved strips: saves strip archive
- Strip browsing → Saved strips: reads saved strips
- Strip printing → Saved strips: prints selected strips
- Strip printing → CUPS printer: submits print job
