# waughb/vision-streamlit architecture

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

- Interactive diagram: https://gitdiagram.com/waughb/vision-streamlit
- Repository: https://github.com/waughb/vision-streamlit

## Overview

##### Project type and purpose
- From the top‐level file tree and README, this is a small full-stack prototype: a Streamlit web application (“vision-streamlit”) that exercises the llama3.2-vision model via Ollama, combined with a local data-processing submodule (“vessel-information”).

##### File structure
- Top level:
- app.py – the Streamlit entry point (frontend + API in one)
- .gitignore, .gitattributes, README.md
- Subdirectory “vessel-information/”:
- data ingestion & processing scripts (download-ais.py, extract-all-zip.py, move-data.py, data-exploration.py)
- static CSV lookups (cargo-lookup.csv, vessel-type-lookup.csv)
- its own requirements.txt
- a README.md describing how to run the data pipeline

##### README for additional insights
- The app uses Ollama to pull and run llama3.2-vision locally
- Setup steps: create a venv, install Streamlit and Ollama, then `streamlit run app.py`

##### Detail
- File paths under the Data Store: `/vessel-information/*.csv`, `/vessel-information/raw_zips/`
- Call out that the data pipeline scripts can be run standalone or invoked on-demand by the Streamlit app

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Frontend Layer
    Browser["Client Browser"]:::frontend

    %% Backend Layer
    subgraph "Streamlit Server"
        direction TB
        UI["Streamlit UI"]:::frontend
        BL["Business Logic (app.py)"]:::backend
    end

    %% Data Pipeline Module
    subgraph "Data Pipeline Module"
        direction TB
        VM["vessel-information/"]:::backend

        subgraph "Scripts"
            direction TB
            Script1["download-ais.py"]:::data
            Script2["extract-all-zip.py"]:::data
            Script3["move-data.py"]:::data
            Script4["data-exploration.py"]:::data
        end

        subgraph "Lookup Tables"
            direction TB
            CSV1["cargo-lookup.csv"]:::storage
            CSV2["vessel-type-lookup.csv"]:::storage
        end

        Req["requirements.txt"]:::docs
        VMReadme["README.md"]:::docs
    end

    %% Model Service
    Ol["Ollama Model Service (llama3.2-vision)"]:::model

    %% File System / Data Store
    FS["File System (CSVs, ZIPs)"]:::storage

    %% Project Documentation
    PR["Project README.md"]:::docs

    %% Connections
    Browser -->|"HTTP"| UI
    UI -->|"internal call"| BL
    BL -->|"Python import & function call"| VM
    BL -->|"CLI/gRPC"| Ol
    BL -->|"read processed CSVs"| FS

    VM -->|"read/write"| FS

    %% Click Events
    click BL "https://github.com/waughb/vision-streamlit/blob/main/app.py"
    click VM "https://github.com/waughb/vision-streamlit/tree/main/vessel-information/"
    click Script1 "https://github.com/waughb/vision-streamlit/blob/main/vessel-information/download-ais.py"
    click Script2 "https://github.com/waughb/vision-streamlit/blob/main/vessel-information/extract-all-zip.py"
    click Script3 "https://github.com/waughb/vision-streamlit/blob/main/vessel-information/move-data.py"
    click Script4 "https://github.com/waughb/vision-streamlit/blob/main/vessel-information/data-exploration.py"
    click CSV1 "https://github.com/waughb/vision-streamlit/blob/main/vessel-information/cargo-lookup.csv"
    click CSV2 "https://github.com/waughb/vision-streamlit/blob/main/vessel-information/vessel-type-lookup.csv"
    click Req "https://github.com/waughb/vision-streamlit/blob/main/vessel-information/requirements.txt"
    click VMReadme "https://github.com/waughb/vision-streamlit/blob/main/vessel-information/README.md"
    click PR "https://github.com/waughb/vision-streamlit/blob/main/README.md"

    %% Styles
    classDef frontend fill:#ADD8E6,stroke:#000,color:#000;
    classDef backend fill:#90EE90,stroke:#000,color:#000;
    classDef data fill:#98FB98,stroke:#000,color:#000;
    classDef model fill:#FFA500,stroke:#000,color:#000;
    classDef storage fill:#D3D3D3,stroke:#000,color:#000;
    classDef docs fill:#FFFFE0,stroke:#000,color:#000;
```
