Complete multi-source Beast format implementation

Major features implemented:
- Beast binary format parser with full Mode S/ADS-B decoding
- Multi-source data merger with intelligent signal-based fusion
- Advanced web frontend with 5 view modes (Map, Table, Stats, Coverage, 3D)
- Real-time WebSocket updates with sub-second latency
- Signal strength analysis and coverage heatmaps
- Debian packaging with systemd integration
- Production-ready deployment with security hardening

Technical highlights:
- Concurrent TCP clients with auto-reconnection
- CPR position decoding and aircraft identification
- Historical flight tracking with position trails
- Range circles and receiver location visualization
- Mobile-responsive design with professional UI
- REST API and WebSocket real-time updates
- Comprehensive build system and documentation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Ole-Morten Duesund 2025-08-23 23:51:37 +02:00
commit 7340a9d6eb
15 changed files with 2332 additions and 238 deletions

279
README.md
View file

@ -1,112 +1,247 @@
# SkyView - ADS-B Aircraft Tracker
# SkyView - Multi-Source ADS-B Aircraft Tracker
A modern web frontend for dump1090 ADS-B data with real-time aircraft tracking, statistics, and mobile-responsive design.
A high-performance, multi-source ADS-B aircraft tracking application that connects to multiple dump1090 Beast format TCP streams and provides a modern web interface with advanced visualization capabilities.
## Features
## Features
- **Real-time Aircraft Tracking**: Live map with aircraft positions and flight paths
- **Interactive Map**: Leaflet-based map with aircraft markers and optional trails
- **Aircraft Table**: Sortable and filterable table view with detailed aircraft information
- **Statistics Dashboard**: Real-time statistics and charts for signal strength, aircraft counts
- **WebSocket Updates**: Real-time data updates without polling
### Multi-Source Data Fusion
- **Beast Binary Format**: Native support for dump1090 Beast format (port 30005)
- **Multiple Receivers**: Connect to unlimited dump1090 sources simultaneously
- **Intelligent Merging**: Smart data fusion with signal strength-based source selection
- **Real-time Processing**: High-performance concurrent message processing
### Advanced Web Interface
- **Interactive Maps**: Leaflet.js-based mapping with aircraft tracking
- **Real-time Updates**: WebSocket-powered live data streaming
- **Mobile Responsive**: Optimized for desktop, tablet, and mobile devices
- **Single Binary**: Embedded static files for easy deployment
- **Multi-view Dashboard**: Map, Table, Statistics, Coverage, and 3D Radar views
## Configuration
### Professional Visualization
- **Signal Analysis**: Signal strength heatmaps and coverage analysis
- **Range Circles**: Configurable range rings for each receiver
- **Flight Trails**: Historical aircraft movement tracking
- **3D Radar View**: Three.js-powered 3D visualization (optional)
- **Statistics Dashboard**: Real-time charts and metrics
### Environment Variables
### Aircraft Data
- **Complete Mode S Decoding**: Position, velocity, altitude, heading
- **Aircraft Identification**: Callsign, category, country, registration
- **Multi-source Tracking**: Signal strength from each receiver
- **Historical Data**: Position history and trail visualization
- `SKYVIEW_ADDRESS`: Server listen address (default: ":8080")
- `SKYVIEW_PORT`: Server port (default: 8080)
- `DUMP1090_HOST`: dump1090 host address (default: "localhost")
- `DUMP1090_DATA_PORT`: dump1090 SBS-1 data port (default: 30003)
- `ORIGIN_LATITUDE`: Receiver latitude for distance calculations (default: 37.7749)
- `ORIGIN_LONGITUDE`: Receiver longitude for distance calculations (default: -122.4194)
- `ORIGIN_NAME`: Name/description of receiver location (default: "Default Location")
- `SKYVIEW_CONFIG`: Path to JSON configuration file
## 🚀 Quick Start
### Configuration File
### Using Command Line
SkyView automatically loads `config.json` from the current directory, or you can specify a path with `SKYVIEW_CONFIG`.
```bash
# Single source
./skyview -sources "primary:Local:localhost:30005:51.47:-0.46"
Create a `config.json` file (see `config.json.example`):
# Multiple sources
./skyview -sources "site1:North:192.168.1.100:30005:51.50:-0.46,site2:South:192.168.1.101:30005:51.44:-0.46"
# Using configuration file
./skyview -config config.json
```
### Using Debian Package
```bash
# Install
sudo dpkg -i skyview_2.0.0_amd64.deb
# Configure
sudo nano /etc/skyview/config.json
# Start service
sudo systemctl start skyview
sudo systemctl enable skyview
```
## ⚙️ Configuration
### Configuration File Structure
```json
{
"server": {
"address": ":8080",
"host": "",
"port": 8080
},
"dump1090": {
"host": "192.168.1.100",
"data_port": 30003
"sources": [
{
"id": "primary",
"name": "Primary Receiver",
"host": "localhost",
"port": 30005,
"latitude": 51.4700,
"longitude": -0.4600,
"altitude": 50.0,
"enabled": true
}
],
"settings": {
"history_limit": 1000,
"stale_timeout": 60,
"update_rate": 1
}
}
```
### Data Source
SkyView uses **SBS-1/BaseStation format** (Port 30003) which provides decoded aircraft information including:
- Aircraft position (latitude/longitude)
- Altitude, ground speed, vertical rate
- Flight number/callsign
- Squawk code and emergency status
## Building and Running
### Build
### Command Line Options
```bash
go build -o skyview .
skyview [options]
Options:
-config string
Configuration file path
-server string
Server address (default ":8080")
-sources string
Comma-separated Beast sources (id:name:host:port:lat:lon)
-verbose
Enable verbose logging
```
### Run
## 🗺️ Web Interface
Access the web interface at `http://localhost:8080`
### Views Available:
- **Map View**: Interactive aircraft tracking with receiver locations
- **Table View**: Sortable aircraft data with multi-source information
- **Statistics**: Real-time metrics and historical charts
- **Coverage**: Signal strength analysis and heatmaps
- **3D Radar**: Three-dimensional aircraft visualization
## 🔧 Building
### Prerequisites
- Go 1.21 or later
- Make
### Build Commands
```bash
# Foreground (default) - Press Ctrl+C to stop
DUMP1090_HOST=192.168.1.100 ./skyview
# Daemon mode (background process)
DUMP1090_HOST=192.168.1.100 ./skyview -daemon
# With custom origin location
DUMP1090_HOST=192.168.1.100 ORIGIN_LATITUDE=59.3293 ORIGIN_LONGITUDE=18.0686 ORIGIN_NAME="Stockholm" ./skyview
# Using config file
SKYVIEW_CONFIG=config.json ./skyview
# Default (localhost:30003)
./skyview
make build # Build binary
make deb # Create Debian package
make docker-build # Build Docker image
make test # Run tests
make clean # Clean artifacts
```
### Development
## 🐳 Docker
```bash
go run main.go
# Build
make docker-build
# Run
docker run -p 8080:8080 -v $(pwd)/config.json:/app/config.json skyview
```
## Usage
## 📊 API Reference
1. Start your dump1090 instance
2. Configure SkyView to point to your dump1090 host
3. Run SkyView
4. Open your browser to `http://localhost:8080`
### REST Endpoints
- `GET /api/aircraft` - All aircraft data
- `GET /api/sources` - Data source information
- `GET /api/stats` - System statistics
- `GET /api/coverage/{sourceId}` - Coverage analysis
- `GET /api/heatmap/{sourceId}` - Signal heatmap
## API Endpoints
### WebSocket
- `ws://localhost:8080/ws` - Real-time updates
- `GET /`: Main web interface
- `GET /api/aircraft`: Aircraft data (parsed from dump1090 TCP stream)
- `GET /api/stats`: Statistics data (calculated from aircraft data)
- `GET /ws`: WebSocket endpoint for real-time updates
## 🛠️ Development
## Data Sources
### Project Structure
```
skyview/
├── cmd/skyview/ # Main application
├── internal/
│ ├── beast/ # Beast format parser
│ ├── modes/ # Mode S decoder
│ ├── merger/ # Multi-source merger
│ ├── client/ # TCP clients
│ └── server/ # HTTP/WebSocket server
├── debian/ # Debian packaging
└── scripts/ # Build scripts
```
SkyView connects to dump1090's **SBS-1/BaseStation format** via TCP port 30003 to receive decoded aircraft data in real-time.
### Development Commands
```bash
make dev # Run in development mode
make format # Format code
make lint # Run linter
make check # Run all checks
```
The application maintains an in-memory aircraft database with automatic cleanup of stale aircraft (older than 2 minutes).
## 📦 Deployment
## Views
### Systemd Service (Debian/Ubuntu)
```bash
# Install package
sudo dpkg -i skyview_2.0.0_amd64.deb
- **Map View**: Interactive map with aircraft positions and trails
- **Table View**: Sortable table with aircraft details and search
- **Stats View**: Dashboard with real-time statistics and charts
# Configure sources in /etc/skyview/config.json
# Start service
sudo systemctl start skyview
sudo systemctl enable skyview
# Check status
sudo systemctl status skyview
sudo journalctl -u skyview -f
```
### Manual Installation
```bash
# Build binary
make build
# Create user and directories
sudo useradd -r -s /bin/false skyview
sudo mkdir -p /etc/skyview /var/lib/skyview /var/log/skyview
sudo chown skyview:skyview /var/lib/skyview /var/log/skyview
# Install binary and config
sudo cp build/skyview /usr/bin/
sudo cp config.example.json /etc/skyview/config.json
sudo chown root:skyview /etc/skyview/config.json
sudo chmod 640 /etc/skyview/config.json
# Create systemd service
sudo cp debian/lib/systemd/system/skyview.service /lib/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable skyview
sudo systemctl start skyview
```
## 🔒 Security
The application includes security hardening:
- Runs as unprivileged user
- Restricted filesystem access
- Network isolation where possible
- Systemd security features enabled
## 📄 License
MIT License - see [LICENSE](LICENSE) file for details.
## 🤝 Contributing
1. Fork the repository
2. Create feature branch
3. Make changes with tests
4. Submit pull request
## 🆘 Support
- [GitHub Issues](https://github.com/skyview/skyview/issues)
- [Documentation](https://github.com/skyview/skyview/wiki)
- [Configuration Examples](https://github.com/skyview/skyview/tree/main/examples)
---
**SkyView** - Professional multi-source ADS-B tracking with Beast format support.