A real-time weather dashboard with environmental monitoring
Report Bug
·
Request Feature
Table of Contents
WeatherForge is a Rails 8.1+ advanced real-time weather dashboard that integrates multiple Open Meteo APIs and OpenAQ API v3 to provide comprehensive weather data, forecasts, marine conditions, air quality, flood risk information, and environmental monitoring with live updates using Hotwire (Turbo + Stimulus).
Weather Monitoring:
- Real-time weather data with automatic 5-minute updates via background jobs
- Interactive Chartkick charts for temperature, humidity, and wind speed trends
- 24-hour forecasts and 10-day historical weather data
- Marine weather conditions (wave height, period, water temperature)
- Air quality monitoring (PM2.5, PM10, O3, NO2, SO2) with AQI levels
- Flood risk assessment with severity indicators
- Location search with geocoding via Open Meteo API
- Turbo Streams for real-time updates without polling
Environmental Monitoring (GIS Extension):
- Real-time air quality sensor network with OpenAQ API v3 integration
- Interactive Leaflet.js maps with sensor markers and clustering
- PostgreSQL/PostGIS spatial queries for nearby sensors (ST_DWithin)
- Automated threshold alerts (PM2.5, PM10, O3, NO2, SO2, CO)
- Health level indicators (Good, Moderate, Unhealthy for Sensitive Groups, Unhealthy, Very Unhealthy, Hazardous)
- Time-series charts for 24-hour environmental readings
- GeoJSON API endpoints for custom map integrations
- Alert resolution tracking with timestamps and notes
| Weather Dashboard | Weather Trends |
|---|---|
![]() |
![]() |
| Weather Forecasts | Environmental Data |
|---|---|
![]() |
![]() |
| Sensors Dashboard | Environmental Alerts |
|---|---|
![]() |
![]() |
| Alert Details | Sensor Details |
|---|---|
![]() |
![]() |
- Ruby 3.4+
ruby --version
- Node.js 22+
node --version
- Docker & Docker Compose (for PostgreSQL with PostGIS and Redis)
docker --version docker compose version
-
Clone the repo
git clone https://github.com/vijethph/WeatherForge.git cd WeatherForge -
Run setup script
bin/docker-setup
The script will configure your environment automatically. Alternatively, manually set up:
cp .env.example .env # Get your user ID and group ID id -u # Add to USER_ID in .env id -g # Add to GROUP_ID in .env # Add your master key to RAILS_MASTER_KEY in .env
-
Build and start all services
docker compose build docker compose up -d
-
Check logs
docker compose logs -f web
-
Visit
http://localhost:3000
Docker Commands:
# View all logs
docker compose logs -f
# Rails console
docker compose exec web bin/rails console
# Run migrations
docker compose exec web bin/rails db:migrate
# Stop services
docker compose down
# Clean restart
docker compose down -v && docker compose up -d --build-
Clone the repo
git clone https://github.com/vijethph/WeatherForge.git cd WeatherForge -
Install dependencies
bundle install npm install
-
Setup environment variables
cp .env.example .env # Edit .env with your actual values (PostgreSQL credentials, OpenAQ API key, etc.) -
Start database and Redis services
docker compose up -d postgres redis
-
Setup database (creates and migrates with PostGIS extension)
rails db:setup
-
Start the server (starts Rails + JS build watcher)
bin/dev
-
Start Sidekiq (in separate terminal)
bundle exec sidekiq -
Visit
http://localhost:3000
Additional URLs:
- API Docs:
http://localhost:3000/api-docs - Sidekiq Dashboard:
http://localhost:3000/sidekiq
/- Main dashboard with current weather for all locations/dashboards/trends- 24-hour temperature, humidity, wind charts/dashboards/forecasts- Hourly forecasts and historical data/dashboards/environment- Marine weather, air quality, flood risk
Add Location:
- Navigate to Locations page
- Search for a city or enter coordinates
- Submit to add location
Sync Weather:
- Automatic: Every 5 minutes via Sidekiq
- Manual: Click "Sync All Weather" button
GET / # Main dashboard
GET /dashboards/trends # Trends page
GET /dashboards/forecasts # Forecasts page
GET /dashboards/environment # Environment page
POST /dashboards/sync_weather # Manual sync
GET /locations # List locations
GET /locations/search?query=city # Search locations
POST /locations # Create location
DELETE /locations/:id # Delete location
Interactive API documentation available at /api-docs.
# Run tests
bundle exec rspec
# Run with coverage
COVERAGE=true bundle exec rspec
# Code quality
bundle exec rubocop
bundle exec brakeman
bundle exec bundler-auditThe app includes render.yaml for one-click deployment with PostgreSQL and Redis.
- Push code to GitHub
- Connect repository to Render
- Set
RAILS_MASTER_KEYenvironment variable - Deploy automatically on push to main
# Build image
docker build -t weatherforge .
# Run with docker-compose
docker compose upRequired for production:
RAILS_MASTER_KEY=your_master_key
DATABASE_URL=postgresql://user:pass@host:5432/dbname
REDIS_URL=redis://host:6379/0
Contributions are welcome!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'feat: add amazing feature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the Apache License 2.0. See LICENSE for more information.
Vijeth P H - @vijethph
Project Link: https://github.com/vijethph/WeatherForge







