# yyegor/vision_api architecture

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

- Interactive diagram: https://gitdiagram.com/yyegor/vision_api
- Repository: https://github.com/yyegor/vision_api

## Overview

This repository is a photo-cataloguing and enrichment application: a batch updater scans image folders, extracts file metadata, stores records, and adds visual labels and safety/location metadata. A separate, older Django polls app provides question, choice, voting, and frequent-label database functionality. The batch workflow is supported by the updater and connector excerpts; database and external-service details are shown where calls are visible. The polls app is a distinct branch, not shown as wired into the photo catalogue’s web interface.

Main entry points: [`files_updater.py`](https://github.com/yyegor/vision_api/blob/main/files_updater.py) (Batch updater), [`glob.py`](https://github.com/yyegor/vision_api/blob/main/glob.py) (Folder scanner), [`database_connector.py`](https://github.com/yyegor/vision_api/blob/main/database_connector.py) (Catalogue connector), [`labeling.py`](https://github.com/yyegor/vision_api/blob/main/labeling.py) (Image analysis)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Photo ingestion"]
  node_updater["Batch updater<br/>[files_updater.py]"]
  node_scanner["Folder scanner<br/>[glob.py]"]
  node_exiftool["ExifTool wrapper<br/>[exiftool.py]"]
  node_settings["Photo settings<br/>[config_t.py]"]
end

subgraph group_enrichment["Metadata enrichment"]
  node_vision["Image analysis<br/>[labeling.py]"]
  node_geotags["GPS geocoding<br/>[geo_tags.py]"]
end

subgraph group_persistence["Catalogue storage"]
  node_connector["Catalogue connector"]
end

subgraph group_web["Legacy web app"]
  node_pollconnector["Polls DB access"]
  node_pollurls["Poll URL routing<br/>[urls.py]"]
  node_pollviews["Poll views<br/>[views.py]"]
  node_pollmodels["Poll models<br/>[models.py]"]
  node_polltemplates["Poll templates"]
end

node_operator(("Operator"))
node_exifcli["ExifTool process"]
node_visionapi["Google Vision"]
node_mapsapi["Google Maps"]
node_mysql[("MySQL catalogue")]
node_webuser(("Web user"))

node_operator -.->|"starts batches"| node_updater
node_updater -->|"scans folders"| node_scanner
node_scanner -->|"reads RAW metadata"| node_exiftool
node_exiftool -->|"runs process"| node_exifcli
node_scanner -->|"uses tag rules"| node_settings
node_updater -->|"stores file data"| node_connector
node_updater -->|"requests labels"| node_vision
node_updater -->|"reads folder tags"| node_scanner
node_vision -->|"uses image limits"| node_settings
node_vision -->|"sends images"| node_visionapi
node_updater -->|"stores labels"| node_connector
node_connector -->|"calls procedures"| node_mysql
node_connector -->|"geocodes GPS"| node_geotags
node_geotags -->|"requests geocoding"| node_mapsapi
node_webuser -.->|"requests pages"| node_pollurls
node_pollurls -->|"routes requests"| node_pollviews
node_pollviews -->|"queries and updates"| node_pollmodels
node_pollviews -->|"renders pages"| node_polltemplates
node_pollconnector -.->|"calls label procedure"| node_mysql

click node_updater "https://github.com/yyegor/vision_api/blob/main/files_updater.py"
click node_scanner "https://github.com/yyegor/vision_api/blob/main/glob.py"
click node_exiftool "https://github.com/yyegor/vision_api/blob/main/exiftool.py"
click node_settings "https://github.com/yyegor/vision_api/blob/main/config_t.py"
click node_vision "https://github.com/yyegor/vision_api/blob/main/labeling.py"
click node_geotags "https://github.com/yyegor/vision_api/blob/main/geo_tags.py"
click node_connector "https://github.com/yyegor/vision_api/blob/main/database_connector.py"
click node_pollconnector "https://github.com/yyegor/vision_api/blob/main/olddjango_project/my_project/polls/code/database_connector.py"
click node_pollurls "https://github.com/yyegor/vision_api/blob/main/olddjango_project/my_project/polls/urls.py"
click node_pollviews "https://github.com/yyegor/vision_api/blob/main/olddjango_project/my_project/polls/views.py"
click node_pollmodels "https://github.com/yyegor/vision_api/blob/main/olddjango_project/my_project/polls/models.py"
click node_polltemplates "https://github.com/yyegor/vision_api/tree/main/olddjango_project/my_project/polls/templates/polls"

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_updater,node_scanner,node_exiftool,node_settings,node_webuser toneBlue
class node_vision,node_geotags,node_mysql toneAmber
class node_connector toneMint
class node_pollconnector,node_pollurls,node_pollviews,node_pollmodels,node_polltemplates toneRose
class node_operator,node_exifcli,node_visionapi,node_mapsapi toneIndigo
```

## Components

### Photo ingestion

- [Batch updater](https://github.com/yyegor/vision_api/blob/main/files_updater.py): `files_updater.py`
- [Folder scanner](https://github.com/yyegor/vision_api/blob/main/glob.py): `glob.py`
- [ExifTool wrapper](https://github.com/yyegor/vision_api/blob/main/exiftool.py): `exiftool.py`
- [Photo settings](https://github.com/yyegor/vision_api/blob/main/config_t.py): `config_t.py`

### Metadata enrichment

- [Image analysis](https://github.com/yyegor/vision_api/blob/main/labeling.py): `labeling.py`
- [GPS geocoding](https://github.com/yyegor/vision_api/blob/main/geo_tags.py): `geo_tags.py`

### Catalogue storage

- [Catalogue connector](https://github.com/yyegor/vision_api/blob/main/database_connector.py): `database_connector.py`

### Legacy web app

- [Polls DB access](https://github.com/yyegor/vision_api/blob/main/olddjango_project/my_project/polls/code/database_connector.py): `olddjango_project/my_project/polls/code/database_connector.py`
- [Poll URL routing](https://github.com/yyegor/vision_api/blob/main/olddjango_project/my_project/polls/urls.py): `olddjango_project/my_project/polls/urls.py`
- [Poll views](https://github.com/yyegor/vision_api/blob/main/olddjango_project/my_project/polls/views.py): `olddjango_project/my_project/polls/views.py`
- [Poll models](https://github.com/yyegor/vision_api/blob/main/olddjango_project/my_project/polls/models.py): `olddjango_project/my_project/polls/models.py`
- [Poll templates](https://github.com/yyegor/vision_api/tree/main/olddjango_project/my_project/polls/templates/polls): `olddjango_project/my_project/polls/templates/polls`

### Other components

- **Operator**
- **ExifTool process**
- **Google Vision**
- **Google Maps**
- **MySQL catalogue**
- **Web user**

## Connections

- Operator → Batch updater: starts batches
- Batch updater → Folder scanner: scans folders (evidence: `files_updater.py`)
- Folder scanner → ExifTool wrapper: reads RAW metadata (evidence: `glob.py`)
- ExifTool wrapper → ExifTool process: runs process (evidence: `exiftool.py`)
- Folder scanner → Photo settings: uses tag rules (evidence: `glob.py`)
- Batch updater → Catalogue connector: stores file data (evidence: `files_updater.py`)
- Batch updater → Image analysis: requests labels (evidence: `files_updater.py`)
- Batch updater → Folder scanner: reads folder tags (evidence: `files_updater.py`)
- Image analysis → Photo settings: uses image limits (evidence: `labeling.py`)
- Image analysis → Google Vision: sends images (evidence: `labeling.py`)
- Batch updater → Catalogue connector: stores labels (evidence: `files_updater.py`)
- Catalogue connector → MySQL catalogue: calls procedures (evidence: `database_connector.py`)
- Catalogue connector → GPS geocoding: geocodes GPS (evidence: `database_connector.py`)
- GPS geocoding → Google Maps: requests geocoding (evidence: `geo_tags.py`)
- Web user → Poll URL routing: requests pages
- Poll URL routing → Poll views: routes requests (evidence: `olddjango_project/my_project/polls/urls.py`)
- Poll views → Poll models: queries and updates (evidence: `olddjango_project/my_project/polls/views.py`)
- Poll views → Poll templates: renders pages (evidence: `olddjango_project/my_project/polls/views.py`)
- Polls DB access → MySQL catalogue: calls label procedure
