Skip to content

A real-time GPS tracking system using Rust, SurrealDB, and Vue.js. It features a UDP server processing GPS packets, a WebSocket & REST API, and an OpenLayers frontend for live map visualization.

Notifications You must be signed in to change notification settings

j-p-d-e-v/gps-simulator-app

Repository files navigation

GPS Simulator App (Real-Time GPS Tracking Using Rust, SurrealDB, TypeScript and Vue.js)

Project Overview

This project is a real-time GPS tracking system designed to explore UDP server-client communication, packet parsing, database integration, and real-time data visualization. The system consists of multiple components working together to process and display GPS coordinates from simulated users.

System Architecture

1. UDP Client (Mock Users)

  • Simulates users by sending GPS coordinates as UDP packets.
  • Uses IEEE 754 floating-point standard for representing latitude and longitude.

2. UDP Server (Rust)

  • Receives incoming packets from UDP clients.
  • Parses the data using a custom Rust library that handles IEEE 754 floating-point numbers and custom endian handling.
  • Stores processed coordinates in SurrealDB for near real-time access.

3. Backend API (Rust-based WebSocket & RESTful Service)

  • Connects to SurrealDB and serves stored GPS data.
  • Provides both WebSocket and RESTful endpoints for data retrieval.
  • Ensures near real-time updates to connected clients.

4. Frontend (Vue.js with OpenLayers)

  • Displays users on a real-time map using OpenLayers.
  • Fetches live GPS data from the backend API via WebSocket and REST endpoints.
  • Focuses purely on real-time visualization (no historical tracking or geofencing).

Key Features

Efficient UDP-based GPS Data Transfer – Uses custom packets for optimized data exchange.
Custom IEEE 754 Parsing & Endian Handling – Ensures precise coordinate interpretation.
Near Real-Time Database (SurrealDB) – Enables fast data storage and retrieval.
WebSocket & RESTful API – Provides flexible access for frontend clients.
Live Map Visualization with OpenLayers – Displays user locations dynamically.

Project Goals & Learning Focus

  • Improve knowledge of UDP networking and packet-based communication.
  • Explore Rust for high-performance server-side applications.
  • Learn database interaction with SurrealDB.
  • Implement real-time data streaming with WebSockets.
  • Visualize geospatial data using OpenLayers in Vue.js.

Getting Started

Starting SurrealDB

surreal start --user root --pass root --bind 0.0.0.0:8080 rocksdb:gps.db

Build the Binaries

cargo build --release

Start the UDP Server

./target/release/gps-tracker --config-path=config.toml

Start the API Server

./target/release/gps-tracker-api --config-path=./config.toml

Start the Frontend

cd ui
yarn
yarn dev

Go to your browser then type:

http://localhost:5173

Start the Client for Simulation

bash launch_clients.sh

About

A real-time GPS tracking system using Rust, SurrealDB, and Vue.js. It features a UDP server processing GPS packets, a WebSocket & REST API, and an OpenLayers frontend for live map visualization.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published