# Overview

# What is the base station?

The Base Station is the ground control application used to monitor and control the rover during operation. It runs on an operator's laptop and provides a unified interface for live video feeds, navigation, task management, rover arm control, and sensor readouts.

<span style="white-space: pre-wrap;">It is built with </span>**Tauri v2**<span style="white-space: pre-wrap;"> (Rust backend) and </span>**SvelteKit**<span style="white-space: pre-wrap;"> (TypeScript frontend), bundled into a native desktop application. Communication with the rover happens over </span>**UDP**<span style="white-space: pre-wrap;"> using </span>**Protocol Buffers (protobuf)**<span style="white-space: pre-wrap;"> for message serialisation.</span>

# Tech Stack

<table id="bkmrk-layertechnologydeskt"><colgroup><col style="width: 240px;"></col><col style="width: 240px;"></col></colgroup><tbody><tr><td>**Layer**

</td><td>**Technology**

</td></tr><tr><td>Desktop framework

</td><td>Tauri v2

</td></tr><tr style="height: 10px;"><td>Frontend

</td><td>SvelteKit + TypeScript

</td></tr><tr><td>Backend

</td><td>Rust

</td></tr><tr><td>Build tool

</td><td>Bun + Vite

</td></tr><tr><td>Video streaming

</td><td>GStreamer (MJPEG)

</td></tr><tr><td>Rover communication

</td><td>UDP on port 9000

</td></tr><tr style="height: 10px;"><td>Serialisation

</td><td>Protocol Buffers

</td></tr><tr><td>3D model rendering

</td><td><span style="white-space: pre-wrap;">(see </span>[Model Viewer](https://bookstack.roboteamtwente.nl/link/149#bkmrk-page-title))

</td></tr></tbody></table>

# System Architecture

At a high level, the app has three layers:

[![BasestationArchitacture.png](https://bookstack.roboteamtwente.nl/uploads/images/gallery/2026-04/scaled-1680-/basestationarchitacture.png)](https://bookstack.roboteamtwente.nl/uploads/images/gallery/2026-04/scaled-1680-/basestationarchitacture.png)

<span style="white-space: pre-wrap;">The frontend communicates with the Rust backend exclusively through </span>**Tauri commands**<span style="white-space: pre-wrap;"> (called via </span>`<span class="editor-theme-code">invoke()</span>`). The backend owns the UDP socket and all rover communication — the frontend never talks to the rover directly.

# Project structure

```markdown
ERC-SOFTWARE-BASESTATION/
├── src/                    # SvelteKit frontend
│   ├── lib
│   │   ├── components/     # Reusable UI components
│   │   ├── css/            # css code
│   │   ├── proto/          # Auto generated types from protobuffers
│   │   └── stores/         # Svelte stores for reusable data across components
│   ├── routes/             # Page routes
│   └── state.svelte.js     # Global reactive state
├── src-tauri/              # Tauri + Rust backend
│   ├── src/
│   │   ├── commands/       # Tauri command handlers
│   │   └── network/        # UDP service + listener
│   ├── proto/              # Protobuf definitions
│   ├── models/             # Bundled 3D model files
│   ├── build.rs            # Handling of protobuffers during build
│   ├── Cargo.toml          # Dependencies
│   └── tauri.conf.json     # Settings, configuration and permissions
├── fake_camera_gstreamer/  # GStreamer-based test video source
└── static/                 # Static frontend assets
```