Skip to content

A comprehensive maritime operations platform demonstrating offline-first architecture, real-time WebSocket communication, and edge computing capabilities for fleet management.

Notifications You must be signed in to change notification settings

ebarronh/edge-fleet

Repository files navigation

EdgeFleet: Maritime Edge Computing Platform

A comprehensive maritime operations platform demonstrating offline-first architecture, real-time WebSocket communication, and edge computing capabilities for fleet management. Built as a modern monorepo showcasing distributed systems, data synchronization, and maritime-specific UI/UX patterns.

πŸ“Έ Screenshots

Fleet Command Center Dashboard

Fleet Command Center - Real-time vessel monitoring and fleet overview

Vessel Bridge Dashboard

Vessel Bridge System - Engine monitoring with animated gauges

Sync Verification Dashboard

Sync Verification - Data integrity and compression metrics

🎯 Product Manager's Perspective

This project emerged from a product management exercise exploring edge computing benefits in maritime operations. Following the scientific method approach where every feature is an experiment, this platform demonstrates how offline-first architecture can revolutionize distributed systems.

Why EdgeFleet?

As a Product Manager, I identified several key problems in maritime operations:

  • Connectivity Challenges: Vessels operate in remote areas with unreliable internet
  • Data Costs: Satellite bandwidth is expensive ($50-100/MB)
  • Operational Continuity: Systems must function without cloud connectivity
  • Real-time Coordination: Fleet visibility is critical for operations

EdgeFleet serves as a proof-of-concept showing how edge computing can address these challenges while reducing operational costs and improving reliability.

Development Process

This project was built using a structured approach:

  1. Phase 1 Technical Specification - Detailed requirements for offline-first implementation
  2. Product Requirements Document (PRD) - Scientific experiment-based feature development
  3. Iterative Development - Built with Claude Code following test-driven development principles

The PRD as a Living Document

Our PRD follows the principle that product documentation should evolve with learnings. Unlike traditional waterfall specifications, this PRD:

  • Updates with Results: Each experiment section includes actual metrics alongside targets
  • Documents Failures: Failed hypotheses are as valuable as successful ones
  • Guides Future Work: Phase 2 experiments are based on Phase 1 learnings
  • Maintains History: Version control tracks how our understanding evolved

This approach ensures that the PRD remains a valuable reference throughout the product lifecycle, not just a planning artifact.

🌊 What is EdgeFleet?

EdgeFleet simulates a real-world maritime operations environment where vessels operate in remote areas with intermittent connectivity. It demonstrates:

  • Edge Computing: Vessels continue operating independently when offline
  • Offline-First Architecture: Data persistence and queue management using IndexedDB
  • Real-time Communication: WebSocket-based fleet coordination
  • Maritime Operations: Authentic vessel monitoring with engine systems, navigation, and fleet tracking

Perfect for testing edge computing scenarios, distributed systems patterns, and maritime industry workflows.

🚒 Architecture Overview

Fleet Command Center (Port 3000)
β”œβ”€β”€ Real-time vessel monitoring
β”œβ”€β”€ Fleet tracking map with live positions  
β”œβ”€β”€ Sync verification dashboard
└── Offline vessel detection with last-seen timestamps

Vessel Applications (Ports 3001-3003)
β”œβ”€β”€ Individual bridge control systems
β”œβ”€β”€ Engine monitoring with animated gauges
β”œβ”€β”€ Offline data persistence (IndexedDB)
β”œβ”€β”€ Automatic sync queue management
└── Maritime-themed dashboard UI

WebSocket Server (Port 3999)
β”œβ”€β”€ Real-time vessel-to-fleet communication
β”œβ”€β”€ Connection status broadcasting
β”œβ”€β”€ Offline notification handling
└── Message routing and relay

Shared Packages
β”œβ”€β”€ Dexie.js database with sync queue
β”œβ”€β”€ Offline manager with localStorage persistence
β”œβ”€β”€ Maritime simulation engine
└── Supabase client for cloud sync

πŸ›  Technology Stack

Frontend Technologies

  • React 18 with TypeScript for type-safe UI development
  • Vite for fast development and optimized builds
  • Tailwind CSS with maritime-themed design system
  • Lucide React for consistent iconography

Data & Storage

  • Dexie.js for IndexedDB management and offline data persistence
  • Supabase for cloud database and real-time features
  • LocalStorage for offline mode preferences
  • JSON for WebSocket message protocols

Communication & Architecture

  • WebSocket (ws) for real-time bidirectional communication
  • Turborepo for efficient monorepo management
  • TypeScript throughout for type safety and developer experience
  • Node.js for WebSocket server and tooling

Edge Computing Features

  • Offline-first data architecture with automatic sync queues
  • Data compression with bandwidth usage calculations
  • Connection status management with manual offline toggle
  • Persistent offline mode that survives page refreshes

πŸš€ Quick Start

Prerequisites

  • Node.js (v18 or higher)
  • npm (comes with Node.js)
  • Git for cloning the repository

1. Clone and Install

git clone https://github.com/ebarronh/edge-fleet.git
cd edge-fleet
npm install

2. Start the Complete Demo

./start-demo.sh

This launches all services simultaneously:

3. Test Edge Computing Scenarios

Offline Mode Testing

  1. Open any vessel app (ports 3001-3003)
  2. Click "Go Offline" to simulate connectivity loss
  3. Observe data continuing to be collected and stored locally
  4. Check Fleet Command to see vessel marked as offline with timestamp
  5. Click "Go Online" to restore connectivity and sync data

Data Persistence Testing

  1. Put a vessel offline
  2. Refresh the browser page
  3. Vessel remains in offline mode (persistent across sessions)
  4. Data collection continues seamlessly

Fleet Monitoring

  1. Open Fleet Command Center (port 3000)
  2. View real-time vessel positions on the tracking map
  3. Monitor vessel status with live engine metrics
  4. Use "Verify Sync" to inspect local vs cloud data integrity

πŸ”¬ Edge Computing Demonstrations

Offline-First Data Architecture

  • Persistent Storage: All vessel data stored in IndexedDB using Dexie.js
  • Sync Queue Management: Changes queued automatically when offline
  • Data Compression: Bandwidth savings calculated and displayed
  • Conflict Resolution: Automatic sync when connectivity restored

Real-time Communication Patterns

  • WebSocket Heartbeats: Connection monitoring and automatic reconnection
  • Message Broadcasting: Fleet-wide status updates and position sharing
  • Graceful Degradation: Seamless transition between online/offline modes
  • Status Propagation: Immediate notification of vessel connectivity changes

Maritime-Specific Features

  • Engine System Monitoring: RPM, fuel rate, temperature, oil pressure
  • Navigation Display: Speed, heading with animated compass
  • Fleet Tracking: Multi-vessel position visualization
  • Critical Threshold Alerts: Animated warnings for abnormal readings

πŸ“Š Features & Capabilities

βœ… Phase 1 Complete Features

  • True offline-first architecture with IndexedDB persistence
  • Animated engine gauges with critical threshold detection
  • Real-time vessel position tracking on fleet map
  • Sync verification dashboard with compression metrics
  • WebSocket communication with automatic reconnection
  • Maritime-themed UI with authentic vessel bridge aesthetics
  • Data compression with bandwidth and cost savings calculations
  • Offline status persistence across browser sessions
  • Multi-vessel simulation with different vessel types
  • Connection status indicators with last-seen timestamps

πŸ”„ Live Sync & Monitoring

  • Real-time position updates every 5 seconds when online
  • Sensor data collection every 2 seconds (engine metrics)
  • Automatic sync when returning online from offline mode
  • Sync queue visualization showing pending data items
  • Bandwidth usage tracking with data compression metrics

πŸ›‘ Edge Computing Resilience

  • Network outage simulation with manual offline toggle
  • Data integrity verification between local and cloud storage
  • Queue management with automatic retry mechanisms
  • Connection monitoring with graceful degradation

πŸ’» Development Guide

Individual Service Commands

# Build all packages
npm run build

# Start WebSocket server only
cd apps/websocket-server && npm start

# Start Fleet Command only  
cd apps/fleet-command && npm run dev

# Start individual vessels
cd apps/vessel-app && npm run dev        # Port 3001
cd apps/vessel-app && npm run dev:3002   # Port 3002
cd apps/vessel-app && npm run dev:3003   # Port 3003

Project Structure

edge-fleet/
β”œβ”€β”€ apps/
β”‚   β”œβ”€β”€ fleet-command/         # Fleet Command Center (React + Vite)
β”‚   β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”‚   β”œβ”€β”€ App.tsx        # Main fleet dashboard
β”‚   β”‚   β”‚   └── components/    # Sync verification, vessel cards
β”‚   β”‚   └── package.json
β”‚   β”œβ”€β”€ vessel-app/            # Vessel Bridge System (React + Vite)
β”‚   β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”‚   β”œβ”€β”€ App.tsx        # Vessel dashboard with engine monitoring
β”‚   β”‚   β”‚   └── components/    # Animated gauges, navigation displays
β”‚   β”‚   └── package.json
β”‚   └── websocket-server/      # Communication Hub (Node.js + ws)
β”‚       β”œβ”€β”€ src/
β”‚       β”‚   └── server.ts      # WebSocket server with message routing
β”‚       └── package.json
β”œβ”€β”€ packages/
β”‚   └── shared/                # Shared Libraries
β”‚       β”œβ”€β”€ src/
β”‚       β”‚   β”œβ”€β”€ db.ts          # Dexie.js database with sync queue
β”‚       β”‚   β”œβ”€β”€ offline.ts     # Offline manager with localStorage
β”‚       β”‚   β”œβ”€β”€ simulation.ts  # Vessel movement simulation
β”‚       β”‚   └── types.ts       # TypeScript interfaces
β”‚       └── package.json
β”œβ”€β”€ specs/                     # Documentation
β”‚   β”œβ”€β”€ phase-1.md            # Phase 1 requirements specification
β”‚   └── initial-setup.md      # Setup instructions
β”œβ”€β”€ start-demo.sh             # Complete demo launcher
β”œβ”€β”€ demo-phase-1.md           # Demo guide for product managers
└── CLAUDE.md                 # Development guidelines

Testing & Validation

# Run all builds (required before demo)
npm run build

# Run linting
npm run lint

# Run type checking  
npm run type-check

# Run tests
npm run test

🎯 Use Cases & Testing Scenarios

Maritime Operations Testing

  • Fleet Coordination: Multiple vessels operating with real-time position sharing
  • Emergency Scenarios: Vessel goes offline, fleet command tracks last known position
  • Data Synchronization: Large amounts of sensor data syncing efficiently when online
  • Bandwidth Optimization: Data compression reducing transmission costs

Edge Computing Validation

  • Offline Resilience: Applications continue functioning without internet
  • Data Persistence: Critical information never lost during connectivity issues
  • Automatic Recovery: Seamless sync when connectivity restored
  • Resource Efficiency: Minimal bandwidth usage through compression

Distributed Systems Patterns

  • Message Broadcasting: WebSocket communication patterns
  • State Management: Distributed state across multiple applications
  • Conflict Resolution: Handling data conflicts during sync
  • Connection Monitoring: Heartbeat and reconnection strategies

🌐 Cloud Integration (Optional)

EdgeFleet can optionally integrate with Supabase for cloud storage and real-time features:

  1. Create a Supabase project at https://supabase.com
  2. Set up tables using the SQL schema in specs/initial-setup.md
  3. Configure environment variables in .env files
  4. Enable real-time subscriptions for live fleet coordination

Note: The demo works fully offline without any cloud configuration required.

πŸ”§ Troubleshooting

Common Issues

  • Port conflicts: Ensure ports 3000-3003 and 3999 are available
  • WebSocket connection: Check that the WebSocket server (port 3999) is running
  • Build errors: Run npm run build before starting development servers
  • Browser storage: Clear IndexedDB if experiencing data sync issues

Reset Demo State

# Clear all local data and restart
./start-demo.sh --clean

πŸš€ Future Roadmap

Phase 2: Advanced Edge Computing

  • Mesh networking between vessels
  • Distributed consensus for fleet coordination
  • Edge AI for predictive maintenance
  • Satellite communication simulation

Phase 3: Enterprise Features

  • Multi-fleet management
  • Advanced analytics and reporting
  • Integration APIs for third-party systems
  • Enhanced security and authentication

EdgeFleet - Demonstrating the future of maritime edge computing with modern web technologies.

About

A comprehensive maritime operations platform demonstrating offline-first architecture, real-time WebSocket communication, and edge computing capabilities for fleet management.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •