# joeleehen/imgrecord architecture

> Architecture diagram of the GitHub repository joeleehen/imgrecord, 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/joeleehen/imgrecord
- Repository: https://github.com/joeleehen/imgrecord

## Overview

This is a Raspberry Pi album-art display: a user submits either a barcode or album-and-artist search, the Flask app retrieves a Discogs cover image, then sends it to an RGB matrix. The main stages are the web interface, request routing, image lookup, and physical display. The README also describes barcode and text search as product capabilities. Source excerpts show the route calls and display setup; the template’s form wiring and some hardware behavior are not shown, so that interface link is unverified.

Main entry points: [`python/client/displayArt.py`](https://github.com/joeleehen/imgrecord/blob/main/python/client/displayArt.py) (Image display), [`python/client/app.py`](https://github.com/joeleehen/imgrecord/blob/main/python/client/app.py) (Flask routes), [`python/client/getImage.py`](https://github.com/joeleehen/imgrecord/blob/main/python/client/getImage.py) (Discogs lookup), [`python/client/templates/index.html`](https://github.com/joeleehen/imgrecord/blob/main/python/client/templates/index.html) (Search page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_form["Search page<br/>[index.html]"]
  node_app["Flask routes<br/>[app.py]"]
end

subgraph group_lookup["Image lookup"]
  node_text_search["Text search<br/>[app.py]"]
  node_barcode_search["Barcode search<br/>[app.py]"]
  node_image_lookup["Discogs lookup<br/>[getImage.py]"]
end

subgraph group_display["Physical display"]
  node_display_art["Image display<br/>[displayArt.py]"]
end

node_user(("User"))
node_discogs{{"Discogs API"}}
node_image_host{{"Cover image host"}}
node_matrix{{"RGB matrix"}}

node_user -->|"enters search"| node_form
node_form -.->|"submits search"| node_app
node_app -->|"routes text"| node_text_search
node_app -->|"routes barcode"| node_barcode_search
node_text_search -->|"calls text lookup"| node_image_lookup
node_barcode_search -->|"calls barcode lookup"| node_image_lookup
node_image_lookup -->|"queries"| node_discogs
node_text_search -->|"displays cover"| node_display_art
node_barcode_search -->|"displays cover"| node_display_art
node_display_art -->|"downloads image"| node_image_host
node_display_art -->|"sets image"| node_matrix

click node_form "https://github.com/joeleehen/imgrecord/blob/main/python/client/templates/index.html"
click node_app "https://github.com/joeleehen/imgrecord/blob/main/python/client/app.py"
click node_text_search "https://github.com/joeleehen/imgrecord/blob/main/python/client/app.py"
click node_barcode_search "https://github.com/joeleehen/imgrecord/blob/main/python/client/app.py"
click node_image_lookup "https://github.com/joeleehen/imgrecord/blob/main/python/client/getImage.py"
click node_display_art "https://github.com/joeleehen/imgrecord/blob/main/python/client/displayArt.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_form,node_app,node_user toneBlue
class node_text_search,node_barcode_search,node_image_lookup toneAmber
class node_display_art,node_discogs toneMint
class node_image_host,node_matrix toneIndigo
```

## Components

### Web interface

- [Search page](https://github.com/joeleehen/imgrecord/blob/main/python/client/templates/index.html): `python/client/templates/index.html`
- [Flask routes](https://github.com/joeleehen/imgrecord/blob/main/python/client/app.py): `python/client/app.py`

### Image lookup

- [Text search](https://github.com/joeleehen/imgrecord/blob/main/python/client/app.py): `python/client/app.py`
- [Barcode search](https://github.com/joeleehen/imgrecord/blob/main/python/client/app.py): `python/client/app.py`
- [Discogs lookup](https://github.com/joeleehen/imgrecord/blob/main/python/client/getImage.py): `python/client/getImage.py`

### Physical display

- [Image display](https://github.com/joeleehen/imgrecord/blob/main/python/client/displayArt.py): `python/client/displayArt.py`

### Other components

- **User**
- **Discogs API**
- **Cover image host**
- **RGB matrix**

## Connections

- User → Search page: enters search (evidence: `README.md`)
- Search page → Flask routes: submits search
- Flask routes → Text search: routes text (evidence: `python/client/app.py`)
- Flask routes → Barcode search: routes barcode (evidence: `python/client/app.py`)
- Text search → Discogs lookup: calls text lookup (evidence: `python/client/app.py`)
- Barcode search → Discogs lookup: calls barcode lookup (evidence: `python/client/app.py`)
- Discogs lookup → Discogs API: queries (evidence: `python/client/getImage.py`)
- Text search → Image display: displays cover (evidence: `python/client/app.py`)
- Barcode search → Image display: displays cover (evidence: `python/client/app.py`)
- Image display → Cover image host: downloads image (evidence: `python/client/displayArt.py`)
- Image display → RGB matrix: sets image (evidence: `python/client/displayArt.py`)
