# thevery-nvg/geo_rtp_service architecture

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

- Interactive diagram: https://gitdiagram.com/thevery-nvg/geo_rtp_service
- Repository: https://github.com/thevery-nvg/geo_rtp_service

## Overview

This is a FastAPI web application for coordinate conversion and engineering-oriented geometry tools. Its clearest user workflow is entering coordinate text in the browser, selecting a parsing/format option, calling API endpoints, and viewing decoded coordinates or generating GPX output. Separate endpoints convert UTM coordinates and process Tomsk AutoCAD labels; Megion pipe calculations are present as a standalone service. The README is empty, and the sampled files do not establish wiring for every listed template or service, so uncertain links are omitted.

Main entry points: [`src/api/work.py`](https://github.com/thevery-nvg/geo_rtp_service/blob/master/src/api/work.py) (API endpoints), [`src/main.py`](https://github.com/thevery-nvg/geo_rtp_service/blob/master/src/main.py) (FastAPI app), [`src/core/core_router.py`](https://github.com/thevery-nvg/geo_rtp_service/blob/master/src/core/core_router.py) (Page routes), [`src/static/js/main.js`](https://github.com/thevery-nvg/geo_rtp_service/blob/master/src/static/js/main.js) (Browser client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_browser["Browser client<br/>[main.js]"]
  node_pages["Page routes<br/>[core_router.py]"]
  node_index["Main page<br/>[index.html]"]
end

subgraph group_api["API workflows"]
  node_api_routes["API endpoints<br/>[work.py]"]
end

subgraph group_services["Conversion services"]
  node_coordinate_decode["Coordinate decoding<br/>[geo.py]"]
  node_gpx["GPX generation<br/>[geo.py]"]
  node_utm["UTM conversion<br/>[convert_vba.py]"]
  node_tomsk["AutoCAD geometry<br/>[tomsk_autocad.py]"]
  node_megion["Megion pipe sizing<br/>[megion_server.py]"]
end

subgraph group_runtime["Application runtime"]
  node_app["FastAPI app<br/>[main.py]"]
  node_db_helper["Database lifecycle<br/>[db_helper.py]"]
end

node_user(("User"))

node_user -->|"enters input"| node_browser
node_browser -->|"posts requests"| node_api_routes
node_user -->|"requests pages"| node_pages
node_pages -->|"renders"| node_index
node_app -->|"mounts routes"| node_pages
node_app -->|"mounts routes"| node_api_routes
node_api_routes -->|"decodes coordinates"| node_coordinate_decode
node_api_routes -->|"generates GPX"| node_gpx
node_api_routes -->|"converts values"| node_utm
node_api_routes -->|"decodes labels"| node_tomsk
node_app -->|"disposes on shutdown"| node_db_helper

click node_browser "https://github.com/thevery-nvg/geo_rtp_service/blob/master/src/static/js/main.js"
click node_pages "https://github.com/thevery-nvg/geo_rtp_service/blob/master/src/core/core_router.py"
click node_index "https://github.com/thevery-nvg/geo_rtp_service/blob/master/src/templates/index.html"
click node_api_routes "https://github.com/thevery-nvg/geo_rtp_service/blob/master/src/api/work.py"
click node_coordinate_decode "https://github.com/thevery-nvg/geo_rtp_service/blob/master/src/api/services/geo.py"
click node_gpx "https://github.com/thevery-nvg/geo_rtp_service/blob/master/src/api/services/geo.py"
click node_utm "https://github.com/thevery-nvg/geo_rtp_service/blob/master/src/api/services/convert_vba.py"
click node_tomsk "https://github.com/thevery-nvg/geo_rtp_service/blob/master/src/api/services/tomsk_autocad.py"
click node_megion "https://github.com/thevery-nvg/geo_rtp_service/blob/master/src/api/services/megion/megion_server.py"
click node_app "https://github.com/thevery-nvg/geo_rtp_service/blob/master/src/main.py"
click node_db_helper "https://github.com/thevery-nvg/geo_rtp_service/blob/master/src/core/models/db_helper.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_browser,node_pages,node_index,node_user toneBlue
class node_api_routes toneAmber
class node_coordinate_decode,node_gpx,node_utm,node_tomsk,node_megion toneMint
class node_app,node_db_helper toneRose
```

## Components

### Web interface

- [Browser client](https://github.com/thevery-nvg/geo_rtp_service/blob/master/src/static/js/main.js): `src/static/js/main.js`
- [Page routes](https://github.com/thevery-nvg/geo_rtp_service/blob/master/src/core/core_router.py): `src/core/core_router.py`
- [Main page](https://github.com/thevery-nvg/geo_rtp_service/blob/master/src/templates/index.html): `src/templates/index.html`

### API workflows

- [API endpoints](https://github.com/thevery-nvg/geo_rtp_service/blob/master/src/api/work.py): `src/api/work.py`

### Conversion services

- [Coordinate decoding](https://github.com/thevery-nvg/geo_rtp_service/blob/master/src/api/services/geo.py): `src/api/services/geo.py`
- [GPX generation](https://github.com/thevery-nvg/geo_rtp_service/blob/master/src/api/services/geo.py): `src/api/services/geo.py`
- [UTM conversion](https://github.com/thevery-nvg/geo_rtp_service/blob/master/src/api/services/convert_vba.py): `src/api/services/convert_vba.py`
- [AutoCAD geometry](https://github.com/thevery-nvg/geo_rtp_service/blob/master/src/api/services/tomsk_autocad.py): `src/api/services/tomsk_autocad.py`
- [Megion pipe sizing](https://github.com/thevery-nvg/geo_rtp_service/blob/master/src/api/services/megion/megion_server.py): `src/api/services/megion/megion_server.py`

### Application runtime

- [FastAPI app](https://github.com/thevery-nvg/geo_rtp_service/blob/master/src/main.py): `src/main.py`
- [Database lifecycle](https://github.com/thevery-nvg/geo_rtp_service/blob/master/src/core/models/db_helper.py): `src/core/models/db_helper.py`

### Other components

- **User**

## Connections

- User → Browser client: enters input
- Browser client → API endpoints: posts requests
- User → Page routes: requests pages
- Page routes → Main page: renders
- FastAPI app → Page routes: mounts routes
- FastAPI app → API endpoints: mounts routes
- API endpoints → Coordinate decoding: decodes coordinates
- API endpoints → GPX generation: generates GPX
- API endpoints → UTM conversion: converts values
- API endpoints → AutoCAD geometry: decodes labels
- FastAPI app → Database lifecycle: disposes on shutdown
