# jola7898/terraform architecture

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

- Interactive diagram: https://gitdiagram.com/jola7898/terraform
- Repository: https://github.com/jola7898/terraform

## Overview

RTVIO is a self-hosted video-to-georeferenced-3D reconstruction product, with Studio, Android phone capture, and drone ingestion. Its main flow is session capture or video upload, reconstruction, then viewing and export; live reconstruction is an additional path. The graph preserves the documented pipeline and major product branches. Some links rely on the README’s system diagrams and code tour; unsampled modules are represented only where the tree and README support them.

Main entry points: [`rtvio/src/rtvio/vggt_reconstruct.py`](https://github.com/jola7898/terraform/blob/main/rtvio/src/rtvio/vggt_reconstruct.py) (VGGT reconstruction), [`rtvio/src/rtvio/studio/server.py`](https://github.com/jola7898/terraform/blob/main/rtvio/src/rtvio/studio/server.py) (Studio server), [`rtvio/src/rtvio/live_pipeline.py`](https://github.com/jola7898/terraform/blob/main/rtvio/src/rtvio/live_pipeline.py) (Live reconstruction), [`rtvioapk/app/src/main/java/com/rtvio/mapper/service/StreamingSession.kt`](https://github.com/jola7898/terraform/blob/main/rtvioapk/app/src/main/java/com/rtvio/mapper/service/StreamingSession.kt) (Streaming session)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Capture and ingest"]
  node_drone_link["Drone link<br/>[drone_link.py]"]
  node_mavlink["MAVLink telemetry<br/>[mavlink.py]"]
  node_phone_link["Phone receiver<br/>[phone_link.py]"]
  node_stream_source["Stream source<br/>[source.py]"]
  node_wire_protocol["Stream protocol<br/>[protocol.py]"]
end

subgraph group_studio["Studio and control"]
  node_studio_ui["Studio web UI<br/>[app.js]"]
  node_studio_server["Studio server<br/>[server.py]"]
  node_jobs["Reconstruction jobs<br/>[jobs.py]"]
  node_session_store[("Session data<br/>[server.py]")]
end

subgraph group_reconstruction["Reconstruction"]
  node_live_pipeline["Live reconstruction<br/>[live_pipeline.py]"]
  node_vggt_worker["VGGT worker<br/>[vggt_worker.py]"]
  node_vggt_reconstruct["VGGT reconstruction"]
end

subgraph group_geometry["Geometry and output"]
  node_camera_model["Camera model<br/>[camera_model.py]"]
  node_fusion["Point fusion<br/>[fusion.py]"]
  node_georeference["Georeferencing<br/>[georeference.py]"]
  node_geodesy["Geodesy<br/>[geodesy.py]"]
  node_surface["Surface and mesh<br/>[surface.py]"]
  node_export["Model export<br/>[export.py]"]
  node_outputs["3D outputs<br/>[export.py]"]
end

subgraph group_android["Android app"]
  node_phone_capture["Camera capture<br/>[CameraCapture.kt]"]
  node_phone_session["Streaming session"]
  node_local_recorder["Offline recorder"]
  node_stream_client["Phone stream client<br/>[StreamClient.kt]"]
  node_session_transfer["Session transfer"]
  node_phone_settings["Phone settings<br/>[SettingsManager.kt]"]
end

node_phone_user(("Phone operator"))
node_drone(("Drone"))
node_browser(("Browser user"))
node_video["Video or frames"]

node_phone_user -->|"records"| node_phone_capture
node_phone_capture -->|"supplies frames"| node_phone_session
node_phone_session -->|"records offline"| node_local_recorder
node_phone_session -->|"streams frames"| node_stream_client
node_phone_session -->|"reads settings"| node_phone_settings
node_phone_user -->|"transfers recording"| node_session_transfer
node_stream_client -->|"sends packets"| node_phone_link
node_phone_link -->|"receives stream"| node_stream_source
node_stream_source -->|"decodes packets"| node_wire_protocol
node_drone -->|"provides video"| node_drone_link
node_drone_link -->|"reads telemetry"| node_mavlink
node_video -->|"uploads footage"| node_studio_server
node_browser -->|"uses"| node_studio_ui
node_studio_ui -->|"calls API"| node_studio_server
node_studio_server -->|"manages sessions"| node_session_store
node_studio_server -->|"starts receiver"| node_phone_link
node_studio_server -->|"controls drone"| node_drone_link
node_studio_server -->|"queues jobs"| node_jobs
node_jobs -->|"dispatches work"| node_vggt_worker
node_vggt_worker -->|"runs model"| node_vggt_reconstruct
node_stream_source -->|"fans out packets"| node_live_pipeline
node_live_pipeline -->|"uses intrinsics"| node_camera_model
node_live_pipeline -->|"uses GPS conversion"| node_geodesy
node_live_pipeline -.->|"records session"| node_session_store
node_vggt_reconstruct -->|"rectifies lenses"| node_camera_model
node_vggt_reconstruct -->|"fuses points"| node_fusion
node_vggt_reconstruct -->|"builds mesh"| node_surface
node_vggt_reconstruct -->|"anchors model"| node_georeference
node_georeference -->|"converts coordinates"| node_geodesy
node_vggt_reconstruct -->|"exports models"| node_export
node_export -->|"writes"| node_outputs
node_browser -.->|"views results"| node_outputs

click node_phone_capture "https://github.com/jola7898/terraform/blob/main/rtvioapk/app/src/main/java/com/rtvio/mapper/capture/CameraCapture.kt"
click node_phone_session "https://github.com/jola7898/terraform/blob/main/rtvioapk/app/src/main/java/com/rtvio/mapper/service/StreamingSession.kt"
click node_local_recorder "https://github.com/jola7898/terraform/blob/main/rtvioapk/app/src/main/java/com/rtvio/mapper/capture/LocalSessionRecorder.kt"
click node_stream_client "https://github.com/jola7898/terraform/blob/main/rtvioapk/app/src/main/java/com/rtvio/mapper/net/StreamClient.kt"
click node_session_transfer "https://github.com/jola7898/terraform/blob/main/rtvioapk/app/src/main/java/com/rtvio/mapper/net/SessionTransferClient.kt"
click node_phone_settings "https://github.com/jola7898/terraform/blob/main/rtvioapk/app/src/main/java/com/rtvio/mapper/data/SettingsManager.kt"
click node_studio_ui "https://github.com/jola7898/terraform/blob/main/rtvio/src/rtvio/studio/web/app.js"
click node_studio_server "https://github.com/jola7898/terraform/blob/main/rtvio/src/rtvio/studio/server.py"
click node_jobs "https://github.com/jola7898/terraform/blob/main/rtvio/src/rtvio/studio/jobs.py"
click node_drone_link "https://github.com/jola7898/terraform/blob/main/rtvio/src/rtvio/studio/drone_link.py"
click node_mavlink "https://github.com/jola7898/terraform/blob/main/rtvio/src/rtvio/studio/mavlink.py"
click node_phone_link "https://github.com/jola7898/terraform/blob/main/rtvio/src/rtvio/studio/phone_link.py"
click node_stream_source "https://github.com/jola7898/terraform/blob/main/rtvio/src/rtvio/stream/source.py"
click node_wire_protocol "https://github.com/jola7898/terraform/blob/main/rtvio/src/rtvio/stream/protocol.py"
click node_live_pipeline "https://github.com/jola7898/terraform/blob/main/rtvio/src/rtvio/live_pipeline.py"
click node_vggt_worker "https://github.com/jola7898/terraform/blob/main/rtvio/src/rtvio/vggt_worker.py"
click node_vggt_reconstruct "https://github.com/jola7898/terraform/blob/main/rtvio/src/rtvio/vggt_reconstruct.py"
click node_camera_model "https://github.com/jola7898/terraform/blob/main/rtvio/src/rtvio/camera_model.py"
click node_fusion "https://github.com/jola7898/terraform/blob/main/rtvio/src/rtvio/fusion.py"
click node_georeference "https://github.com/jola7898/terraform/blob/main/rtvio/src/rtvio/georeference.py"
click node_geodesy "https://github.com/jola7898/terraform/blob/main/rtvio/src/rtvio/stream/geodesy.py"
click node_surface "https://github.com/jola7898/terraform/blob/main/rtvio/src/rtvio/surface.py"
click node_export "https://github.com/jola7898/terraform/blob/main/rtvio/src/rtvio/export.py"
click node_session_store "https://github.com/jola7898/terraform/blob/main/rtvio/src/rtvio/studio/server.py"
click node_outputs "https://github.com/jola7898/terraform/blob/main/rtvio/src/rtvio/export.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_drone_link,node_mavlink,node_phone_link,node_stream_source,node_wire_protocol,node_browser toneBlue
class node_studio_ui,node_studio_server,node_jobs,node_session_store toneAmber
class node_live_pipeline,node_vggt_worker,node_vggt_reconstruct toneMint
class node_camera_model,node_fusion,node_georeference,node_geodesy,node_surface,node_export,node_outputs toneRose
class node_phone_capture,node_phone_session,node_local_recorder,node_stream_client,node_session_transfer,node_phone_settings,node_phone_user,node_drone,node_video toneIndigo
```

## Components

### Capture and ingest

- [Drone link](https://github.com/jola7898/terraform/blob/main/rtvio/src/rtvio/studio/drone_link.py): `rtvio/src/rtvio/studio/drone_link.py`
- [MAVLink telemetry](https://github.com/jola7898/terraform/blob/main/rtvio/src/rtvio/studio/mavlink.py): `rtvio/src/rtvio/studio/mavlink.py`
- [Phone receiver](https://github.com/jola7898/terraform/blob/main/rtvio/src/rtvio/studio/phone_link.py): `rtvio/src/rtvio/studio/phone_link.py`
- [Stream source](https://github.com/jola7898/terraform/blob/main/rtvio/src/rtvio/stream/source.py): `rtvio/src/rtvio/stream/source.py`
- [Stream protocol](https://github.com/jola7898/terraform/blob/main/rtvio/src/rtvio/stream/protocol.py): `rtvio/src/rtvio/stream/protocol.py`

### Studio and control

- [Studio web UI](https://github.com/jola7898/terraform/blob/main/rtvio/src/rtvio/studio/web/app.js): `rtvio/src/rtvio/studio/web/app.js`
- [Studio server](https://github.com/jola7898/terraform/blob/main/rtvio/src/rtvio/studio/server.py): `rtvio/src/rtvio/studio/server.py`
- [Reconstruction jobs](https://github.com/jola7898/terraform/blob/main/rtvio/src/rtvio/studio/jobs.py): `rtvio/src/rtvio/studio/jobs.py`
- [Session data](https://github.com/jola7898/terraform/blob/main/rtvio/src/rtvio/studio/server.py): `rtvio/src/rtvio/studio/server.py`

### Reconstruction

- [Live reconstruction](https://github.com/jola7898/terraform/blob/main/rtvio/src/rtvio/live_pipeline.py): `rtvio/src/rtvio/live_pipeline.py`
- [VGGT worker](https://github.com/jola7898/terraform/blob/main/rtvio/src/rtvio/vggt_worker.py): `rtvio/src/rtvio/vggt_worker.py`
- [VGGT reconstruction](https://github.com/jola7898/terraform/blob/main/rtvio/src/rtvio/vggt_reconstruct.py): `rtvio/src/rtvio/vggt_reconstruct.py`

### Geometry and output

- [Camera model](https://github.com/jola7898/terraform/blob/main/rtvio/src/rtvio/camera_model.py): `rtvio/src/rtvio/camera_model.py`
- [Point fusion](https://github.com/jola7898/terraform/blob/main/rtvio/src/rtvio/fusion.py): `rtvio/src/rtvio/fusion.py`
- [Georeferencing](https://github.com/jola7898/terraform/blob/main/rtvio/src/rtvio/georeference.py): `rtvio/src/rtvio/georeference.py`
- [Geodesy](https://github.com/jola7898/terraform/blob/main/rtvio/src/rtvio/stream/geodesy.py): `rtvio/src/rtvio/stream/geodesy.py`
- [Surface and mesh](https://github.com/jola7898/terraform/blob/main/rtvio/src/rtvio/surface.py): `rtvio/src/rtvio/surface.py`
- [Model export](https://github.com/jola7898/terraform/blob/main/rtvio/src/rtvio/export.py): `rtvio/src/rtvio/export.py`
- [3D outputs](https://github.com/jola7898/terraform/blob/main/rtvio/src/rtvio/export.py): `rtvio/src/rtvio/export.py`

### Android app

- [Camera capture](https://github.com/jola7898/terraform/blob/main/rtvioapk/app/src/main/java/com/rtvio/mapper/capture/CameraCapture.kt): `rtvioapk/app/src/main/java/com/rtvio/mapper/capture/CameraCapture.kt`
- [Streaming session](https://github.com/jola7898/terraform/blob/main/rtvioapk/app/src/main/java/com/rtvio/mapper/service/StreamingSession.kt): `rtvioapk/app/src/main/java/com/rtvio/mapper/service/StreamingSession.kt`
- [Offline recorder](https://github.com/jola7898/terraform/blob/main/rtvioapk/app/src/main/java/com/rtvio/mapper/capture/LocalSessionRecorder.kt): `rtvioapk/app/src/main/java/com/rtvio/mapper/capture/LocalSessionRecorder.kt`
- [Phone stream client](https://github.com/jola7898/terraform/blob/main/rtvioapk/app/src/main/java/com/rtvio/mapper/net/StreamClient.kt): `rtvioapk/app/src/main/java/com/rtvio/mapper/net/StreamClient.kt`
- [Session transfer](https://github.com/jola7898/terraform/blob/main/rtvioapk/app/src/main/java/com/rtvio/mapper/net/SessionTransferClient.kt): `rtvioapk/app/src/main/java/com/rtvio/mapper/net/SessionTransferClient.kt`
- [Phone settings](https://github.com/jola7898/terraform/blob/main/rtvioapk/app/src/main/java/com/rtvio/mapper/data/SettingsManager.kt): `rtvioapk/app/src/main/java/com/rtvio/mapper/data/SettingsManager.kt`

### Other components

- **Phone operator**
- **Drone**
- **Browser user**
- **Video or frames**

## Connections

- Phone operator → Camera capture: records
- Camera capture → Streaming session: supplies frames (evidence: `rtvioapk/app/src/main/java/com/rtvio/mapper/service/StreamingSession.kt`)
- Streaming session → Offline recorder: records offline (evidence: `rtvioapk/app/src/main/java/com/rtvio/mapper/service/StreamingSession.kt`)
- Streaming session → Phone stream client: streams frames (evidence: `rtvioapk/app/src/main/java/com/rtvio/mapper/service/StreamingSession.kt`)
- Streaming session → Phone settings: reads settings (evidence: `rtvioapk/app/src/main/java/com/rtvio/mapper/service/StreamingSession.kt`)
- Phone operator → Session transfer: transfers recording
- Phone stream client → Phone receiver: sends packets
- Phone receiver → Stream source: receives stream (evidence: `rtvio/src/rtvio/studio/phone_link.py`)
- Stream source → Stream protocol: decodes packets (evidence: `rtvio/src/rtvio/stream/source.py`)
- Drone → Drone link: provides video
- Drone link → MAVLink telemetry: reads telemetry (evidence: `rtvio/src/rtvio/studio/drone_link.py`)
- Video or frames → Studio server: uploads footage
- Browser user → Studio web UI: uses
- Studio web UI → Studio server: calls API
- Studio server → Session data: manages sessions (evidence: `rtvio/src/rtvio/studio/server.py`)
- Studio server → Phone receiver: starts receiver (evidence: `rtvio/src/rtvio/studio/server.py`)
- Studio server → Drone link: controls drone (evidence: `rtvio/src/rtvio/studio/server.py`)
- Studio server → Reconstruction jobs: queues jobs (evidence: `rtvio/src/rtvio/studio/server.py`)
- Reconstruction jobs → VGGT worker: dispatches work
- VGGT worker → VGGT reconstruction: runs model (evidence: `rtvio/src/rtvio/vggt_worker.py`)
- Stream source → Live reconstruction: fans out packets (evidence: `rtvio/src/rtvio/live_pipeline.py`)
- Live reconstruction → Camera model: uses intrinsics (evidence: `rtvio/src/rtvio/live_pipeline.py`)
- Live reconstruction → Geodesy: uses GPS conversion (evidence: `rtvio/src/rtvio/live_pipeline.py`)
- Live reconstruction → Session data: records session
- VGGT reconstruction → Camera model: rectifies lenses (evidence: `rtvio/src/rtvio/vggt_reconstruct.py`)
- VGGT reconstruction → Point fusion: fuses points (evidence: `rtvio/src/rtvio/vggt_reconstruct.py`)
- VGGT reconstruction → Surface and mesh: builds mesh (evidence: `rtvio/src/rtvio/vggt_reconstruct.py`)
- VGGT reconstruction → Georeferencing: anchors model (evidence: `rtvio/src/rtvio/vggt_reconstruct.py`)
- Georeferencing → Geodesy: converts coordinates (evidence: `rtvio/src/rtvio/vggt_reconstruct.py`)
- VGGT reconstruction → Model export: exports models (evidence: `rtvio/src/rtvio/vggt_reconstruct.py`)
- Model export → 3D outputs: writes
- Browser user → 3D outputs: views results
