# chodragon04/pawmatch architecture

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

- Interactive diagram: https://gitdiagram.com/chodragon04/pawmatch
- Repository: https://github.com/chodragon04/pawmatch

## Overview

PawMatch is a Streamlit dog-adoption discovery and matching service. Users browse nearby shelters, filter dogs, answer a lifestyle survey for compatibility scores and reasons, search by photo, inspect dog and shelter details, and save favorites in browser storage. Data is served from snapshots when available and refreshed from the public API; location-aware sorting and optional Kakao geocoding support discovery. The README documents several capabilities whose implementation was not sampled, so those links cite the README; unsampled internal wiring is otherwise omitted.

Main entry points: [`app.py`](https://github.com/chodragon04/pawmatch/blob/main/app.py) (Streamlit entry), [`views/browse.py`](https://github.com/chodragon04/pawmatch/blob/main/views/browse.py) (Browse page), [`pawmatch/detail.py`](https://github.com/chodragon04/pawmatch/blob/main/pawmatch/detail.py) (Dog details), [`views/home.py`](https://github.com/chodragon04/pawmatch/blob/main/views/home.py) (Home page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Web experience"]
  node_app["Streamlit entry<br/>[app.py]"]
  node_shared_ui["Shared UI<br/>[ui.py]"]
  node_home_view["Home page<br/>[home.py]"]
  node_browse_view["Browse page<br/>[browse.py]"]
  node_match_view["Match page<br/>[match.py]"]
  node_photo_view["Photo search page<br/>[photo_search.py]"]
  node_favorites_view["Favorites page<br/>[favorites.py]"]
end

subgraph group_discovery["Discovery and matching"]
  node_browse_logic["Dog filtering<br/>[browse.py]"]
  node_matching["Compatibility scoring<br/>[matching.py]"]
  node_traits["Dog traits<br/>[traits.py]"]
  node_image_search["Photo similarity<br/>[image_search.py]"]
  node_favorites["Saved favorites<br/>[favorites.py]"]
end

subgraph group_data["Data and location"]
  node_data_store["Dataset refresh<br/>[data.py]"]
  node_api_client["API client<br/>[api.py]"]
  node_geo["Shelter distances<br/>[geo.py]"]
  node_location["Location selection<br/>[location.py]"]
  node_kakao["Region geocoding<br/>[kakao.py]"]
  node_shelter_coords["Coordinate corrections<br/>[shelter_coords.py]"]
end

subgraph group_presentation["Dog presentation"]
  node_detail["Dog details<br/>[detail.py]"]
  node_display["Dog formatting<br/>[display.py]"]
end

node_adopter(("Adopter"))
node_browser[("Browser storage")]
node_public_api["Public animal API"]
node_kakao_api["Kakao Local API"]
node_snapshot_store[("Data snapshots")]

node_adopter -->|"opens app"| node_app
node_app -->|"renders navigation"| node_shared_ui
node_app -->|"routes pages"| node_home_view
node_app -->|"routes pages"| node_browse_view
node_app -->|"routes pages"| node_match_view
node_app -->|"routes pages"| node_photo_view
node_app -->|"routes pages"| node_favorites_view
node_adopter -->|"chooses location"| node_home_view
node_adopter -->|"sets filters"| node_browse_view
node_adopter -->|"answers survey"| node_match_view
node_adopter -->|"uploads photo"| node_photo_view
node_browse_view -->|"filters dogs"| node_browse_logic
node_browse_view -->|"sorts by fit"| node_matching
node_match_view -->|"scores survey"| node_matching
node_browse_logic -->|"searches memo traits"| node_traits
node_matching -->|"uses dog profiles"| node_traits
node_photo_view -->|"searches similarity"| node_image_search
node_favorites_view -->|"loads saved dogs"| node_favorites
node_adopter -->|"saves favorites"| node_browser
node_browser -.->|"stores favorites"| node_favorites
node_home_view -->|"selects location"| node_location
node_browse_view -->|"selects location"| node_location
node_match_view -->|"selects location"| node_location
node_photo_view -->|"narrows region"| node_location
node_location -->|"geocodes region"| node_kakao
node_kakao -.->|"requests coordinates"| node_kakao_api
node_data_store -->|"reads snapshots"| node_snapshot_store
node_data_store -->|"fetches live data"| node_api_client
node_api_client -->|"requests animal data"| node_public_api
node_home_view -->|"orders nearby shelters"| node_geo
node_geo -->|"uses corrected coordinates"| node_shelter_coords
node_home_view -->|"opens dog details"| node_detail
node_browse_view -->|"opens dog details"| node_detail
node_match_view -->|"opens dog details"| node_detail
node_photo_view -->|"opens dog details"| node_detail
node_favorites_view -->|"opens dog details"| node_detail
node_detail -->|"formats dog facts"| node_display

click node_snapshot_store "https://github.com/chodragon04/pawmatch/tree/main/data"
click node_app "https://github.com/chodragon04/pawmatch/blob/main/app.py"
click node_shared_ui "https://github.com/chodragon04/pawmatch/blob/main/pawmatch/ui.py"
click node_home_view "https://github.com/chodragon04/pawmatch/blob/main/views/home.py"
click node_browse_view "https://github.com/chodragon04/pawmatch/blob/main/views/browse.py"
click node_match_view "https://github.com/chodragon04/pawmatch/blob/main/views/match.py"
click node_photo_view "https://github.com/chodragon04/pawmatch/blob/main/views/photo_search.py"
click node_favorites_view "https://github.com/chodragon04/pawmatch/blob/main/views/favorites.py"
click node_data_store "https://github.com/chodragon04/pawmatch/blob/main/pawmatch/data.py"
click node_api_client "https://github.com/chodragon04/pawmatch/blob/main/pawmatch/api.py"
click node_geo "https://github.com/chodragon04/pawmatch/blob/main/pawmatch/geo.py"
click node_location "https://github.com/chodragon04/pawmatch/blob/main/pawmatch/location.py"
click node_kakao "https://github.com/chodragon04/pawmatch/blob/main/pawmatch/kakao.py"
click node_shelter_coords "https://github.com/chodragon04/pawmatch/blob/main/pawmatch/shelter_coords.py"
click node_browse_logic "https://github.com/chodragon04/pawmatch/blob/main/pawmatch/browse.py"
click node_matching "https://github.com/chodragon04/pawmatch/blob/main/pawmatch/matching.py"
click node_traits "https://github.com/chodragon04/pawmatch/blob/main/pawmatch/traits.py"
click node_image_search "https://github.com/chodragon04/pawmatch/blob/main/pawmatch/image_search.py"
click node_favorites "https://github.com/chodragon04/pawmatch/blob/main/pawmatch/favorites.py"
click node_detail "https://github.com/chodragon04/pawmatch/blob/main/pawmatch/detail.py"
click node_display "https://github.com/chodragon04/pawmatch/blob/main/pawmatch/display.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_app,node_shared_ui,node_home_view,node_browse_view,node_match_view,node_photo_view,node_favorites_view toneBlue
class node_browse_logic,node_matching,node_traits,node_image_search,node_favorites,node_browser,node_snapshot_store toneAmber
class node_data_store,node_api_client,node_geo,node_location,node_kakao,node_shelter_coords,node_public_api,node_kakao_api toneMint
class node_detail,node_display toneRose
class node_adopter toneIndigo
```

## Components

### Web experience

- [Streamlit entry](https://github.com/chodragon04/pawmatch/blob/main/app.py): `app.py`
- [Shared UI](https://github.com/chodragon04/pawmatch/blob/main/pawmatch/ui.py): `pawmatch/ui.py`
- [Home page](https://github.com/chodragon04/pawmatch/blob/main/views/home.py): `views/home.py`
- [Browse page](https://github.com/chodragon04/pawmatch/blob/main/views/browse.py): `views/browse.py`
- [Match page](https://github.com/chodragon04/pawmatch/blob/main/views/match.py): `views/match.py`
- [Photo search page](https://github.com/chodragon04/pawmatch/blob/main/views/photo_search.py): `views/photo_search.py`
- [Favorites page](https://github.com/chodragon04/pawmatch/blob/main/views/favorites.py): `views/favorites.py`

### Discovery and matching

- [Dog filtering](https://github.com/chodragon04/pawmatch/blob/main/pawmatch/browse.py): `pawmatch/browse.py`
- [Compatibility scoring](https://github.com/chodragon04/pawmatch/blob/main/pawmatch/matching.py): `pawmatch/matching.py`
- [Dog traits](https://github.com/chodragon04/pawmatch/blob/main/pawmatch/traits.py): `pawmatch/traits.py`
- [Photo similarity](https://github.com/chodragon04/pawmatch/blob/main/pawmatch/image_search.py): `pawmatch/image_search.py`
- [Saved favorites](https://github.com/chodragon04/pawmatch/blob/main/pawmatch/favorites.py): `pawmatch/favorites.py`

### Data and location

- [Dataset refresh](https://github.com/chodragon04/pawmatch/blob/main/pawmatch/data.py): `pawmatch/data.py`
- [API client](https://github.com/chodragon04/pawmatch/blob/main/pawmatch/api.py): `pawmatch/api.py`
- [Shelter distances](https://github.com/chodragon04/pawmatch/blob/main/pawmatch/geo.py): `pawmatch/geo.py`
- [Location selection](https://github.com/chodragon04/pawmatch/blob/main/pawmatch/location.py): `pawmatch/location.py`
- [Region geocoding](https://github.com/chodragon04/pawmatch/blob/main/pawmatch/kakao.py): `pawmatch/kakao.py`
- [Coordinate corrections](https://github.com/chodragon04/pawmatch/blob/main/pawmatch/shelter_coords.py): `pawmatch/shelter_coords.py`

### Dog presentation

- [Dog details](https://github.com/chodragon04/pawmatch/blob/main/pawmatch/detail.py): `pawmatch/detail.py`
- [Dog formatting](https://github.com/chodragon04/pawmatch/blob/main/pawmatch/display.py): `pawmatch/display.py`

### Other components

- **Adopter**
- **Browser storage**
- **Public animal API**
- **Kakao Local API**
- [Data snapshots](https://github.com/chodragon04/pawmatch/tree/main/data): `data`

## Connections

- Adopter → Streamlit entry: opens app (evidence: `README.md`)
- Streamlit entry → Shared UI: renders navigation (evidence: `app.py`)
- Streamlit entry → Home page: routes pages (evidence: `README.md`)
- Streamlit entry → Browse page: routes pages (evidence: `README.md`)
- Streamlit entry → Match page: routes pages (evidence: `README.md`)
- Streamlit entry → Photo search page: routes pages (evidence: `README.md`)
- Streamlit entry → Favorites page: routes pages (evidence: `README.md`)
- Adopter → Home page: chooses location (evidence: `README.md`)
- Adopter → Browse page: sets filters (evidence: `README.md`)
- Adopter → Match page: answers survey (evidence: `README.md`)
- Adopter → Photo search page: uploads photo (evidence: `README.md`)
- Browse page → Dog filtering: filters dogs (evidence: `views/browse.py`)
- Browse page → Compatibility scoring: sorts by fit (evidence: `views/browse.py`)
- Match page → Compatibility scoring: scores survey (evidence: `views/match.py`)
- Dog filtering → Dog traits: searches memo traits (evidence: `pawmatch/browse.py`)
- Compatibility scoring → Dog traits: uses dog profiles (evidence: `pawmatch/matching.py`)
- Photo search page → Photo similarity: searches similarity (evidence: `README.md`)
- Favorites page → Saved favorites: loads saved dogs (evidence: `views/favorites.py`)
- Adopter → Browser storage: saves favorites (evidence: `README.md`)
- Browser storage → Saved favorites: stores favorites
- Home page → Location selection: selects location (evidence: `README.md`)
- Browse page → Location selection: selects location (evidence: `views/browse.py`)
- Match page → Location selection: selects location (evidence: `views/match.py`)
- Photo search page → Location selection: narrows region (evidence: `README.md`)
- Location selection → Region geocoding: geocodes region (evidence: `pawmatch/location.py`)
- Region geocoding → Kakao Local API: requests coordinates
- Dataset refresh → Data snapshots: reads snapshots (evidence: `README.md`)
- Dataset refresh → API client: fetches live data (evidence: `pawmatch/data.py`)
- API client → Public animal API: requests animal data (evidence: `pawmatch/api.py`)
- Home page → Shelter distances: orders nearby shelters (evidence: `README.md`)
- Shelter distances → Coordinate corrections: uses corrected coordinates (evidence: `pawmatch/geo.py`)
- Home page → Dog details: opens dog details (evidence: `README.md`)
- Browse page → Dog details: opens dog details (evidence: `views/browse.py`)
- Match page → Dog details: opens dog details (evidence: `views/match.py`)
- Photo search page → Dog details: opens dog details (evidence: `README.md`)
- Favorites page → Dog details: opens dog details (evidence: `views/favorites.py`)
- Dog details → Dog formatting: formats dog facts (evidence: `pawmatch/detail.py`)
