# elvisharchdruid/mtg-lowlander architecture

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

- Interactive diagram: https://gitdiagram.com/elvisharchdruid/mtg-lowlander
- Repository: https://github.com/elvisharchdruid/mtg-lowlander

## Overview

This is a small Java Swing card-search application. The principal workflow starts at the application entry point, opens the GUI, resolves a typed card name against PostgreSQL, retrieves its image URL and tags, then displays the card and tags. A separate Scryfall client downloads bulk card and tag data into local compressed files; the excerpts do not show it being invoked by the application or the database import being triggered. The architecture is based on the sampled sources, so those runtime links are left unasserted.

Main entry points: [`src/AppGUI.java`](https://github.com/elvisharchdruid/mtg-lowlander/blob/main/src/AppGUI.java) (Card search GUI), [`src/SFClient.java`](https://github.com/elvisharchdruid/mtg-lowlander/blob/main/src/SFClient.java) (Scryfall bulk client), [`src/Database.java`](https://github.com/elvisharchdruid/mtg-lowlander/blob/main/src/Database.java) (Card lookup), [`src/App.java`](https://github.com/elvisharchdruid/mtg-lowlander/blob/main/src/App.java) (App entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application UI"]
  node_entry["App entry<br/>[App.java]"]
  node_gui["Card search GUI<br/>[AppGUI.java]"]
  node_current["Current card state<br/>[AppGUI.java]"]
end

subgraph group_data["Card Data"]
  node_dbaccess["Card lookup<br/>[Database.java]"]
end

subgraph group_ingest["Bulk Data"]
  node_sfclient["Scryfall bulk client<br/>[SFClient.java]"]
  node_badresponse["API response error"]
end

node_user(("User"))
node_image(("Image host"))
node_postgres[("PostgreSQL")]
node_files["Compressed bulk files"]
node_scryfall(("Scryfall API"))

node_user -->|"searches"| node_gui
node_entry -->|"opens"| node_gui
node_gui -->|"looks up"| node_dbaccess
node_gui -->|"creates state"| node_current
node_gui -->|"loads image"| node_image
node_dbaccess -->|"queries"| node_postgres
node_dbaccess -->|"reads imports"| node_files
node_sfclient -->|"requests bulk data"| node_scryfall
node_sfclient -->|"writes downloads"| node_files
node_sfclient -->|"throws"| node_badresponse

click node_entry "https://github.com/elvisharchdruid/mtg-lowlander/blob/main/src/App.java"
click node_gui "https://github.com/elvisharchdruid/mtg-lowlander/blob/main/src/AppGUI.java"
click node_current "https://github.com/elvisharchdruid/mtg-lowlander/blob/main/src/AppGUI.java"
click node_dbaccess "https://github.com/elvisharchdruid/mtg-lowlander/blob/main/src/Database.java"
click node_sfclient "https://github.com/elvisharchdruid/mtg-lowlander/blob/main/src/SFClient.java"
click node_badresponse "https://github.com/elvisharchdruid/mtg-lowlander/blob/main/src/BadResponseException.java"

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_entry,node_gui,node_current,node_user toneBlue
class node_dbaccess,node_postgres toneAmber
class node_sfclient,node_badresponse,node_scryfall toneMint
class node_image,node_files toneIndigo
```

## Components

### Application UI

- [App entry](https://github.com/elvisharchdruid/mtg-lowlander/blob/main/src/App.java): `src/App.java`
- [Card search GUI](https://github.com/elvisharchdruid/mtg-lowlander/blob/main/src/AppGUI.java): `src/AppGUI.java`
- [Current card state](https://github.com/elvisharchdruid/mtg-lowlander/blob/main/src/AppGUI.java): `src/AppGUI.java`

### Card Data

- [Card lookup](https://github.com/elvisharchdruid/mtg-lowlander/blob/main/src/Database.java): `src/Database.java`

### Bulk Data

- [Scryfall bulk client](https://github.com/elvisharchdruid/mtg-lowlander/blob/main/src/SFClient.java): `src/SFClient.java`
- [API response error](https://github.com/elvisharchdruid/mtg-lowlander/blob/main/src/BadResponseException.java): `src/BadResponseException.java`

### Other components

- **User**
- **Image host**
- **PostgreSQL**
- **Compressed bulk files**
- **Scryfall API**

## Connections

- User → Card search GUI: searches (evidence: `src/AppGUI.java`)
- App entry → Card search GUI: opens (evidence: `src/App.java`)
- Card search GUI → Card lookup: looks up (evidence: `src/AppGUI.java`)
- Card search GUI → Current card state: creates state (evidence: `src/AppGUI.java`)
- Card search GUI → Image host: loads image (evidence: `src/AppGUI.java`)
- Card lookup → PostgreSQL: queries (evidence: `src/Database.java`)
- Card lookup → Compressed bulk files: reads imports (evidence: `src/Database.java`)
- Scryfall bulk client → Scryfall API: requests bulk data (evidence: `src/SFClient.java`)
- Scryfall bulk client → Compressed bulk files: writes downloads (evidence: `src/SFClient.java`)
- Scryfall bulk client → API response error: throws (evidence: `src/SFClient.java`)
