# okufaf/web-markup-updated architecture

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

- Interactive diagram: https://gitdiagram.com/okufaf/web-markup-updated
- Repository: https://github.com/okufaf/web-markup-updated

## Overview

Agriculture Vision is a browser-based agricultural mapping application with account access, configurable basemaps, map-layer and field-overlay tools, and an ML-proxy backend. The main workflow is user interaction in the web UI, API-backed authentication and service setup, map and field work, then processed-result handling. The sampled code shows the WMTS parser and DZZ connection flow; the large client file was only sampled, so some product branches and integrations are represented conservatively.

Main entry points: [`app.js`](https://github.com/okufaf/web-markup-updated/blob/main/app.js) (Client Application), [`server.js`](https://github.com/okufaf/web-markup-updated/blob/main/server.js) (API Server), [`index.html`](https://github.com/okufaf/web-markup-updated/blob/main/index.html) (Web UI Shell), [`wmts.js`](https://github.com/okufaf/web-markup-updated/blob/main/wmts.js) (WMTS Parser)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web Client"]
  node_web["Web UI Shell<br/>[index.html]"]
  node_client_app["Client Application<br/>[app.js]"]
  node_auth_ui["Account Access<br/>[app.js]"]
end

subgraph group_mapping["Mapping Tools"]
  node_map_workspace["Map Workspace<br/>[app.js]"]
  node_basemap_tools["Basemap Tools<br/>[app.js]"]
  node_wmts_config["WMTS Configuration<br/>[app.js]"]
  node_layer_tools["Layer Management<br/>[app.js]"]
  node_field_tools["Field Overlays<br/>[app.js]"]
  node_results["Processed Results<br/>[app.js]"]
end

subgraph group_backend["Backend Services"]
  node_api_server["API Server<br/>[server.js]"]
  node_auth_api["Auth API<br/>[server.js]"]
  node_dzz_api["DZZ Connection API<br/>[server.js]"]
  node_wmts_parser["WMTS Parser<br/>[wmts.js]"]
  node_ml_proxy["ML Proxy<br/>[server.js]"]
  node_account_store[("Account Store<br/>[server.js]")]
end

subgraph group_integrations["External Services"]
  node_postgres[("PostgreSQL")]
  node_ml_service["ML Backend"]
  node_dzz_service["DZZ Service"]
  node_map_services["WMTS Tile Services"]
end

node_user(("Agriculture User"))

node_user -->|"opens"| node_web
node_web -->|"hosts"| node_client_app
node_client_app -->|"calls API"| node_api_server
node_client_app -->|"supports"| node_auth_ui
node_client_app -->|"renders"| node_map_workspace
node_map_workspace -->|"configures"| node_basemap_tools
node_basemap_tools -->|"configures"| node_wmts_config
node_map_workspace -->|"manages"| node_layer_tools
node_map_workspace -->|"edits"| node_field_tools
node_client_app -->|"stores results"| node_results
node_api_server -->|"routes"| node_auth_api
node_api_server -->|"routes"| node_dzz_api
node_api_server -.->|"proxies requests"| node_ml_proxy
node_auth_api -->|"reads and writes"| node_account_store
node_account_store -->|"uses when configured"| node_postgres
node_dzz_api -->|"parses capabilities"| node_wmts_parser
node_dzz_api -->|"probes and fetches"| node_dzz_service
node_ml_proxy -.->|"forwards requests"| node_ml_service
node_wmts_config -.->|"requests tiles"| node_map_services
node_api_server -->|"serves UI"| node_web

click node_web "https://github.com/okufaf/web-markup-updated/blob/main/index.html"
click node_client_app "https://github.com/okufaf/web-markup-updated/blob/main/app.js"
click node_auth_ui "https://github.com/okufaf/web-markup-updated/blob/main/app.js"
click node_map_workspace "https://github.com/okufaf/web-markup-updated/blob/main/app.js"
click node_basemap_tools "https://github.com/okufaf/web-markup-updated/blob/main/app.js"
click node_wmts_config "https://github.com/okufaf/web-markup-updated/blob/main/app.js"
click node_layer_tools "https://github.com/okufaf/web-markup-updated/blob/main/app.js"
click node_field_tools "https://github.com/okufaf/web-markup-updated/blob/main/app.js"
click node_results "https://github.com/okufaf/web-markup-updated/blob/main/app.js"
click node_api_server "https://github.com/okufaf/web-markup-updated/blob/main/server.js"
click node_auth_api "https://github.com/okufaf/web-markup-updated/blob/main/server.js"
click node_dzz_api "https://github.com/okufaf/web-markup-updated/blob/main/server.js"
click node_wmts_parser "https://github.com/okufaf/web-markup-updated/blob/main/wmts.js"
click node_ml_proxy "https://github.com/okufaf/web-markup-updated/blob/main/server.js"
click node_account_store "https://github.com/okufaf/web-markup-updated/blob/main/server.js"

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_web,node_client_app,node_auth_ui,node_user toneBlue
class node_map_workspace,node_basemap_tools,node_wmts_config,node_layer_tools,node_field_tools,node_results toneAmber
class node_api_server,node_auth_api,node_dzz_api,node_wmts_parser,node_ml_proxy,node_account_store toneMint
class node_postgres,node_ml_service,node_dzz_service,node_map_services toneRose
```

## Components

### Web Client

- [Web UI Shell](https://github.com/okufaf/web-markup-updated/blob/main/index.html): `index.html`
- [Client Application](https://github.com/okufaf/web-markup-updated/blob/main/app.js): `app.js`
- [Account Access](https://github.com/okufaf/web-markup-updated/blob/main/app.js): `app.js`

### Mapping Tools

- [Map Workspace](https://github.com/okufaf/web-markup-updated/blob/main/app.js): `app.js`
- [Basemap Tools](https://github.com/okufaf/web-markup-updated/blob/main/app.js): `app.js`
- [WMTS Configuration](https://github.com/okufaf/web-markup-updated/blob/main/app.js): `app.js`
- [Layer Management](https://github.com/okufaf/web-markup-updated/blob/main/app.js): `app.js`
- [Field Overlays](https://github.com/okufaf/web-markup-updated/blob/main/app.js): `app.js`
- [Processed Results](https://github.com/okufaf/web-markup-updated/blob/main/app.js): `app.js`

### Backend Services

- [API Server](https://github.com/okufaf/web-markup-updated/blob/main/server.js): `server.js`
- [Auth API](https://github.com/okufaf/web-markup-updated/blob/main/server.js): `server.js`
- [DZZ Connection API](https://github.com/okufaf/web-markup-updated/blob/main/server.js): `server.js`
- [WMTS Parser](https://github.com/okufaf/web-markup-updated/blob/main/wmts.js): `wmts.js`
- [ML Proxy](https://github.com/okufaf/web-markup-updated/blob/main/server.js): `server.js`
- [Account Store](https://github.com/okufaf/web-markup-updated/blob/main/server.js): `server.js`

### External Services

- **PostgreSQL**
- **ML Backend**
- **DZZ Service**
- **WMTS Tile Services**

### Other components

- **Agriculture User**

## Connections

- Agriculture User → Web UI Shell: opens
- Web UI Shell → Client Application: hosts
- Client Application → API Server: calls API (evidence: `app.js`)
- Client Application → Account Access: supports (evidence: `app.js`)
- Client Application → Map Workspace: renders (evidence: `app.js`)
- Map Workspace → Basemap Tools: configures (evidence: `app.js`)
- Basemap Tools → WMTS Configuration: configures (evidence: `app.js`)
- Map Workspace → Layer Management: manages (evidence: `app.js`)
- Map Workspace → Field Overlays: edits (evidence: `app.js`)
- Client Application → Processed Results: stores results (evidence: `app.js`)
- API Server → Auth API: routes (evidence: `server.js`)
- API Server → DZZ Connection API: routes (evidence: `server.js`)
- API Server → ML Proxy: proxies requests (evidence: `server.js`)
- Auth API → Account Store: reads and writes (evidence: `server.js`)
- Account Store → PostgreSQL: uses when configured (evidence: `server.js`)
- DZZ Connection API → WMTS Parser: parses capabilities (evidence: `server.js`)
- DZZ Connection API → DZZ Service: probes and fetches (evidence: `server.js`)
- ML Proxy → ML Backend: forwards requests
- WMTS Configuration → WMTS Tile Services: requests tiles
- API Server → Web UI Shell: serves UI (evidence: `server.js`)
