Go-based web application for monitoring and managing warehouse robot telemetry, events, thresholds, and user access.
It combines:
- Fiber HTTP server
- Template-rendered web pages
- REST APIs
- MQTT connectivity
- Relational + ScyllaDB-backed persistence
This repository is part of a final year project.
- Sebastian Muchui
- Okoth Glen Ochieng
- Gloria Mwende Ngei
The system is organized with clear boundaries between routing, handlers, data models, storage adapters, and UI assets.
Core design goals:
- Keep telemetry ingestion and dashboard rendering independent
- Support both server-rendered pages and API-driven interactions
- Allow graceful startup even when optional integrations are unavailable
- Live dashboard for warehouse robot telemetry
- Telemetry ingestion and history retrieval endpoints
- IMU latest + replay support
- Event logging and browsing
- Threshold creation, update, toggle, and deletion
- User registration, authentication, verification, and password reset flows
- MQTT integration for robot communication
- ScyllaDB integration for operational telemetry/event data
Application entry point: cmd/main.go
Initialization sequence:
- Load environment variables
- Connect relational database
- Run migrations
- Attempt ScyllaDB connection
- Start MQTT connection asynchronously
- Configure Fiber app, middleware, templates, and routes
- Listen on configured HTTP port
- Centralized bootstrap: predictable startup behavior
- Separated persistence concerns: metadata vs high-frequency telemetry
- Async MQTT startup: web app remains available during broker delays
- Hybrid UI + APIs: fast page load with flexible data access
- Internal package boundaries: easier maintenance and safer extension
- cmd/ — application entry point
- internal/routes/ — route registration
- internal/handlers/ — page handlers
- internal/handlers/api/ — API handlers
- internal/models/ — relational models
- internal/scylla/ — ScyllaDB connector, types, and queries
- internal/mqtt/ — MQTT adapter and message handling
- internal/templates/ — server-rendered views
- internal/utils/ — migration, auth, and helper utilities
- assets/css/ — stylesheets
- assets/js/ — frontend logic
- cql/ — ScyllaDB schema initialization
- / — home page
- /dashboard — robot dashboard
- /analysis — telemetry analysis
- /events — event viewer
- /thresholds — threshold configuration
- /replay — telemetry replay
Base path: /api/v1
Users:
- POST /users/register
- POST /users/login
- GET /users/verify-account/:uid/:token
- PATCH /users/reset-password/
Telemetry:
- GET /telemetry/latest
- GET /telemetry/history
- GET /telemetry/imu/latest
- GET /telemetry/imu/replay
- POST /telemetry/ingest
Events:
- GET /events
Thresholds:
- GET /thresholds
- POST /thresholds
- PATCH /thresholds/:id
- DELETE /thresholds/:id
- Go 1.24+
- Fiber (HTTP framework)
- GORM (ORM)
- SQLite (local relational persistence)
- PostgreSQL driver support (production-oriented)
- ScyllaDB (telemetry/event storage)
- Eclipse Paho MQTT client
- Fiber HTML template engine
- Docker Compose (local services)
Environment is loaded from .env at startup.
Important variables include:
- SGG_ENVIRONMENT
- SGG_PORT
- SGG_POSTGRES_DSN
- SGG_MQTT_BROKER
- SGG_MQTT_PORT
- SGG_MQTT_USERNAME
- SGG_MQTT_PASSWORD
- SGG_MQTT_CLIENT_ID
- SGG_CASSANDRA_HOST
- SGG_CASSANDRA_PORT
- SGG_CASSANDRA_KEYSPACE
- SGG_CASSANDRA_USERNAME
- SGG_CASSANDRA_PASSWORD
- Go installed
- Docker + Docker Compose (recommended for local services)
docker compose up -dgo run ./cmd/main.go- http://localhost:8092 (or your configured SGG_PORT)
go build ./cmd/main.goJavaScript is served from assets/js/. The project's own source scripts are
shipped minified (compressed and mangled with terser):
- analysis.js
- dashboard.js
- main.js
- replay.js
- thresholds.js
- visualization.js
tailwind.js and three.js are third-party libraries and are left untouched.
To re-minify the source scripts after editing them (requires Node.js):
for f in analysis dashboard main replay thresholds visualization; do
npx -y terser "assets/js/$f.js" --compress --mangle --output "assets/js/$f.js"
doneReadable source is recoverable from version control history.
- Static assets are served from /assets
- Templates are loaded from internal/templates
- ScyllaDB connection failure is handled gracefully
- MQTT startup is asynchronous to avoid blocking web startup