Files
spore-gateway/docs/README.md
2025-10-26 18:37:07 +01:00

2.3 KiB

SPORE Gateway Documentation

Welcome to the SPORE Gateway documentation. This directory contains detailed documentation for various features and capabilities of the gateway.

Available Documentation

MQTT Integration

Comprehensive guide to the MQTT integration feature, including:

  • Setting up MQTT integration
  • Message format and handling
  • Testing with local MQTT brokers
  • Architecture and data flow
  • Troubleshooting and best practices

Rollout Process

Detailed documentation for the firmware rollout system:

  • Parallel firmware updates across multiple nodes
  • WebSocket progress updates
  • Integration with spore-registry
  • API endpoints and message formats

Feature Overview

Core Features

  • UDP-based node discovery
  • Cluster management and primary node selection
  • HTTP API server for cluster operations
  • WebSocket real-time updates
  • Failover logic for automatic primary switching
  • Generic proxy calls to SPORE nodes

Integration Features

  • MQTT Integration: Subscribe to MQTT topics and forward messages to WebSocket clients
  • Firmware Rollout: Orchestrated firmware updates across the cluster
  • Registry Proxy: Proxy for spore-registry firmware management

Getting Started

  1. Basic Setup: See Main README for installation and basic usage
  2. MQTT Integration: See MQTT.md for MQTT setup and testing
  3. Testing: See Hack README for local testing tools

Development

The gateway is written in Go and follows modern Go best practices:

  • Structured logging using logrus
  • Graceful shutdown handling
  • Concurrent-safe operations
  • HTTP middleware for CORS and logging
  • WebSocket support for real-time updates

Contributing

When adding new features:

  1. Update relevant documentation in this directory
  2. Add examples to the hack/ directory
  3. Update the main README with feature highlights
  4. Follow the existing documentation style and structure

Support

For questions or issues:

  • Check the relevant documentation in this directory
  • Review gateway logs for error messages
  • Use testing tools in the hack/ directory
  • Check the main README for troubleshooting tips