An intelligent amateur radio propagation reporting service that generates comprehensive daily reports by analyzing real-time solar and geomagnetic data using AI. The service provides detailed band-by-band propagation forecasts with interactive visualizations to help amateur radio operators optimize their communications.
Visit the production service at radio-propagation.net to see live reports with:
- Real-time solar activity analysis
- Interactive propagation charts
- Band-by-band recommendations
- 3-day forecasts
- DX opportunity predictions
This service addresses the amateur radio community's need for:
- Intelligent Analysis: AI-powered interpretation of complex space weather data
- Actionable Insights: Clear recommendations for each amateur radio band (10m-80m)
- Visual Data: Interactive charts showing trends and forecasts
- Accessibility: Easy-to-understand reports for operators of all experience levels
- Automation: Daily reports generated without manual intervention
graph LR
A[NOAA SWPC] --> D[Data Fetcher]
B[N0NBH API] --> D
C[SIDC RSS] --> D
E[Helioviewer] --> D
D --> F[OpenAI GPT-4]
F --> G[Report Generator]
G --> H[Interactive Charts]
G --> I[HTML Reports]
H --> J[Cloud Storage]
I --> J
J --> K[Daily Reports]
Data Flow:
- Collection: Fetch solar/geomagnetic data from multiple authoritative sources
- Analysis: OpenAI GPT-4 analyzes conditions and generates insights
- Visualization: Create interactive charts using go-echarts
- Generation: Combine analysis and charts into comprehensive HTML reports
- Storage: Deploy reports to cloud storage with automated scheduling
- Go 1.21+ - Programming language runtime
- OpenAI API Key - For AI-powered analysis (get one here)
- Google Cloud Project - For production deployment (optional for local testing)
- Clone and setup:
git clone https://github.com/vpoluyaktov/radiocast.git
cd radiocast/service
go mod download- Set your OpenAI API key:
export OPENAI_API_KEY='sk-your-openai-key-here'- Run the local server (from the
service/directory):
./run_local.sh serverThis will:
- β Kill any existing process on port 8981
- π‘ Fetch real data from NOAA, N0NBH, and SIDC
- π€ Generate a report using OpenAI GPT-4
- π Download Sun images from Helioviewer
- π Create HTML with interactive charts
- π Start server on http://localhost:8981
- Test the service:
# Health check
curl http://localhost:8981/health
# Generate a new report (no API key required by default)
curl -X POST http://localhost:8981/generate
# View reports in browser
open http://localhost:8981For rapid development without API calls:
./run_local.sh server --mockupGenerated reports include comprehensive analysis with:
- Solar Activity: Real-time solar flux, sunspot numbers, and K-index
- K-index Trend: 72-hour history with exponential moving average
- Band Conditions: Heatmap showing day/night conditions for all amateur bands
- 3-Day Forecast: Predicted K-index and propagation quality
- Propagation Timeline: Dual-axis charts showing solar flux and geomagnetic activity
- Executive Summary - Current conditions overview
- Solar Activity Analysis - SFI, sunspot numbers, flare activity
- Geomagnetic Conditions - K-index, A-index, storm levels
- Band-by-Band Analysis - Specific recommendations for each amateur band (10m-80m)
- 3-Day Forecast - Predicted conditions and operating recommendations
- DX Opportunities - Enhanced propagation paths and timing
- Technical Explanation - Educational content for new operators
Note: All ./run_local.sh commands must be run from the service/ directory.
# Run complete local test with real data
./run_local.sh server
# Fast testing with mock data (no API calls)
./run_local.sh server --mockup
# Test all external API endpoints
./run_local.sh debug-apis
# Run unit tests
./run_local.sh unit-tests
# Show help
./run_local.sh helpThe project includes comprehensive unit tests with high coverage:
- Config Package: ~85% coverage
- Models Package: ~90% coverage
- Storage Package: 55.6% coverage
- Charts Package: 92.2% coverage
# Run all tests
go test -v ./...
# Run tests with coverage
go test -v -cover ./...- Displays the latest report or auto-generates one if none exist
- Shows loading page with spinner during generation
- Auto-refreshes every 10 seconds until report is ready
Health check endpoint for monitoring and load balancers.
Generates a new propagation report with concurrency protection.
API Key Protection: If the API_KEY environment variable is set, this endpoint requires authentication via the Authorization header.
Authentication (when API_KEY is configured):
# With API key
curl -X POST http://localhost:8981/generate \
-H "Authorization: Bearer your-api-key-here"Response (Success):
{
"status": "success",
"report_url": "https://radio-propagation.net/2024/01/15/index.html",
"timestamp": "2024-01-15T12:00:00Z",
"duration_ms": 45000,
"data_summary": {
"solar_flux": 150.2,
"k_index": 2.3,
"sunspot_number": 45,
"activity_level": "Moderate"
}
}Response (Concurrent Request):
{
"error": "Report generation already in progress",
"status": "conflict"
}HTTP 409 Conflict - Only one report can be generated at a time
Response (Unauthorized - when API_KEY is configured):
{
"error": "Missing Authorization header",
"message": "This endpoint requires an API key. Please provide it in the Authorization header as 'Bearer <your-api-key>'",
"status": "unauthorized"
}HTTP 401 Unauthorized - API key required but not provided or invalid
Lists recent reports with metadata and direct links.
| Variable | Description | Default | Required |
|---|---|---|---|
OPENAI_API_KEY |
OpenAI API key for GPT-4 | - | β |
OPENAI_MODEL |
OpenAI model to use | gpt-4.1 |
β |
PORT |
HTTP server port | 8981 |
β |
ENVIRONMENT |
Deployment environment | local |
β |
GCP_PROJECT_ID |
GCP project (production only) | - | β |
GCS_BUCKET |
GCS bucket (production only) | - | β |
RADIOCAST_API_KEY |
API key for /generate endpoint protection |
- | β |
The /generate endpoint can be protected with an API key to prevent unauthorized report generation.
Set the RADIOCAST_API_KEY environment variable to enable protection:
export RADIOCAST_API_KEY="your-secret-api-key-here"
./run_local.sh serverWhen API key protection is enabled, include the key in the Authorization header:
# Correct usage with API key
curl -X POST http://localhost:8981/generate \
-H "Authorization: Bearer your-secret-api-key-here"
# This will be rejected with HTTP 401
curl -X POST http://localhost:8981/generate- No RADIOCAST_API_KEY configured: The
/generateendpoint works without authentication (default behavior) - RADIOCAST_API_KEY configured: The
/generateendpoint requires theAuthorization: Bearer <key>header - Other endpoints: All other endpoints (
/health,/reports,/, etc.) remain unprotected
- Use a strong, randomly generated API key (minimum 32 characters)
- Store the API key securely (environment variables, secret managers)
- Rotate API keys regularly in production environments
- Monitor logs for unauthorized access attempts
The service integrates with multiple authoritative space weather data sources:
- Website: swpc.noaa.gov
- K-index Data: Real-time planetary geomagnetic activity
- Solar Cycle Data: Solar flux index and sunspot numbers
- Reliability: Primary government source for space weather
- Website: hamqsl.com
- Band Conditions: Real-time HF propagation conditions for all amateur bands
- Formatted Data: Pre-processed amateur radio specific metrics
- Update Frequency: Multiple times per day
- Website: sidc.be
- Solar Events: Flare reports and space weather events
- International Data: European Space Agency collaboration
- RSS Feed: Real-time event notifications
- Website: helioviewer.org
- Solar Images: Real-time Sun imagery from SDO/AIA instruments
- Visual Context: Provides visual representation of solar activity
- NASA Data: Direct integration with space-based solar observatories
radiocast/
βββ service/ # Go application
β βββ main.go # HTTP server entry point
β βββ internal/
β β βββ config/ # Configuration management
β β βββ fetchers/ # Data source integrations
β β βββ llm/ # OpenAI GPT-4 integration
β β βββ models/ # Data structures & types
β β βββ reports/ # HTML generation & templates
β β βββ charts/ # Interactive chart generation
β β βββ storage/ # Local & cloud storage
β β βββ server/ # HTTP handlers & middleware
β β βββ imagery/ # Solar image processing
β βββ templates/ # HTML & CSS templates
β βββ run_local.sh # Development runner script
β βββ Dockerfile # Container build
βββ terraform/ # Infrastructure as Code
β βββ stage/ # Staging environment
β βββ prod/ # Production environment
βββ .github/workflows/ # CI/CD automation
The service runs on Google Cloud Platform with automated CI/CD:
- Production URL: radio-propagation.net
- Staging Environment: Automatic deployment from
stagebranch - Production Environment: Automatic deployment from
mainbranch - Infrastructure: Managed via Terraform
- Scheduling: Daily report generation via Cloud Scheduler
- Storage: Reports stored in Google Cloud Storage
- Monitoring: Cloud Run metrics and custom alerts
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Add tests for new functionality
- Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Maintain high test coverage (aim for >80%)
- Follow Go best practices and conventions
- Add unit tests for new packages/functions
- Update documentation for API changes
This project is licensed under the MIT License - see the LICENSE file for details.
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Live Example: radio-propagation.net
73! Happy DXing! π‘π