aaqis-app Svelte Themes

Aaqis App

AAQIS - Africa Air Quality Information System: A modern, interactive web application for real-time air quality monitoring across African cities, built with Svelte 5 and SvelteKit.

AAQIS - Africa Air Quality Information System 🌍

A modern, interactive web application for real-time air quality monitoring across African cities, built with Svelte 5 and SvelteKit.

about data:

duckdb -c "SUMMARIZE TABLE 'static/data/african_cities_air_quality_2024_2026.parquet';"
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  column_name   β”‚ column_type β”‚         min         β”‚ … β”‚         q75          β”‚ count β”‚ null_percentage β”‚
β”‚    varchar     β”‚   varchar   β”‚       varchar       β”‚   β”‚       varchar        β”‚ int64 β”‚  decimal(9,2)   β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ station_id     β”‚ VARCHAR     β”‚ AA001               β”‚ … β”‚ NULL                 β”‚ 16440 β”‚            0.00 β”‚
β”‚ datetime       β”‚ TIMESTAMP   β”‚ 2024-01-01 01:52:43 β”‚ … β”‚ 2026-04-01 23:53:4…  β”‚ 16440 β”‚            0.00 β”‚
β”‚ city           β”‚ VARCHAR     β”‚ addis_ababa         β”‚ … β”‚ NULL                 β”‚ 16440 β”‚            0.00 β”‚
β”‚ station_name   β”‚ VARCHAR     β”‚ Bole Station        β”‚ … β”‚ NULL                 β”‚ 16440 β”‚            0.00 β”‚
β”‚ latitude       β”‚ DOUBLE      β”‚ -24.6589            β”‚ … β”‚ 0.33754575929203545  β”‚ 16440 β”‚            0.00 β”‚
β”‚ longitude      β”‚ DOUBLE      β”‚ 25.8541             β”‚ … β”‚ 36.836366123893804   β”‚ 16440 β”‚            0.00 β”‚
β”‚ pm2_5          β”‚ BIGINT      β”‚ 5                   β”‚ … β”‚ 30                   β”‚ 16440 β”‚            0.00 β”‚
β”‚ pm10           β”‚ BIGINT      β”‚ 10                  β”‚ … β”‚ 52                   β”‚ 16440 β”‚            0.00 β”‚
β”‚ o3             β”‚ BIGINT      β”‚ 10                  β”‚ … β”‚ 49                   β”‚ 16440 β”‚            0.00 β”‚
β”‚ no2            β”‚ BIGINT      β”‚ 5                   β”‚ … β”‚ 25                   β”‚ 16440 β”‚            0.00 β”‚
β”‚ so2            β”‚ BIGINT      β”‚ 3                   β”‚ … β”‚ 20                   β”‚ 16440 β”‚            0.00 β”‚
β”‚ co             β”‚ BIGINT      β”‚ 1                   β”‚ … β”‚ 2                    β”‚ 16440 β”‚            0.00 β”‚
β”‚ pm2_5_aqi      β”‚ DOUBLE      β”‚ 20.8                β”‚ … β”‚ 88.66394207562348    β”‚ 16440 β”‚            0.00 β”‚
β”‚ pm10_aqi       β”‚ DOUBLE      β”‚ 9.3                 β”‚ … β”‚ 48.072887323943654   β”‚ 16440 β”‚            0.00 β”‚
β”‚ o3_aqi         β”‚ DOUBLE      β”‚ 9.3                 β”‚ … β”‚ 45.39075837347373    β”‚ 16440 β”‚            0.00 β”‚
β”‚ no2_aqi        β”‚ DOUBLE      β”‚ 4.7                 β”‚ … β”‚ 23.46635412420165    β”‚ 16440 β”‚            0.00 β”‚
β”‚ so2_aqi        β”‚ DOUBLE      β”‚ 4.3                 β”‚ … β”‚ 28.6                 β”‚ 16440 β”‚            0.00 β”‚
β”‚ co_aqi         β”‚ DOUBLE      β”‚ 11.4                β”‚ … β”‚ 22.7                 β”‚ 16440 β”‚            0.00 β”‚
β”‚ overall_aqi    β”‚ DOUBLE      β”‚ 20.8                β”‚ … β”‚ 88.71476326057154    β”‚ 16440 β”‚            0.00 β”‚
β”‚ overall_rating β”‚ VARCHAR     β”‚ good                β”‚ … β”‚ NULL                 β”‚ 16440 β”‚            0.00 β”‚
β”‚ pm2_5_rating   β”‚ VARCHAR     β”‚ good                β”‚ … β”‚ NULL                 β”‚ 16440 β”‚            0.00 β”‚
β”‚ pm10_rating    β”‚ VARCHAR     β”‚ good                β”‚ … β”‚ NULL                 β”‚ 16440 β”‚            0.00 β”‚
β”‚ o3_rating      β”‚ VARCHAR     β”‚ good                β”‚ … β”‚ NULL                 β”‚ 16440 β”‚            0.00 β”‚
β”‚ no2_rating     β”‚ VARCHAR     β”‚ good                β”‚ … β”‚ NULL                 β”‚ 16440 β”‚            0.00 β”‚
β”‚ so2_rating     β”‚ VARCHAR     β”‚ good                β”‚ … β”‚ NULL                 β”‚ 16440 β”‚            0.00 β”‚
β”‚ co_rating      β”‚ VARCHAR     β”‚ good                β”‚ … β”‚ NULL                 β”‚ 16440 β”‚            0.00 β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ 26 rows                                                                            12 columns (6 shown) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

🌟 Overview

AAQIS (Africa Air Quality Information System) is a comprehensive platform designed to provide real-time air quality monitoring and analysis for major African cities. The system serves multiple stakeholders including:

  • πŸ‘₯ General Public: Health advice and daily air quality updates
  • 🏒 Government Officials: Policy-making insights and regulatory data
  • πŸ”¬ Researchers: Historical trends and data analysis tools
  • πŸ“Š Environmental Organizations: Monitoring and reporting capabilities

🎯 Key Features

πŸ“Š Real-Time Monitoring

  • Live air quality data from multiple monitoring stations
  • AQI (Air Quality Index) calculations for all major pollutants
  • Color-coded severity levels following international standards
  • Interactive station selection with detailed breakdowns

πŸ—ΊοΈ Interactive Mapping

  • MapLibre GL powered interactive maps
  • Custom station markers with real-time status indicators
  • Beautiful popup overlays with comprehensive data
  • Smooth pan and zoom functionality with city-specific views

πŸ“… Advanced Data Visualization

  • ECharts-powered calendar heatmap (GitHub contribution style)
  • Historical trends with daily, weekly, and monthly aggregation
  • Time series analysis with Chart.js integration
  • Professional legends and tooltips

🌍 Multi-City Coverage

Currently monitoring air quality in:

  • πŸ‡ͺπŸ‡Ή Addis Ababa - Ethiopia's capital and largest city
  • πŸ‡ΊπŸ‡¬ Kampala - Uganda's vibrant capital
  • πŸ‡°πŸ‡ͺ Nairobi - Kenya's bustling metropolis
  • πŸ‡·πŸ‡Ό Kigali - Rwanda's clean and green capital
  • πŸ‡§πŸ‡Ό Gaborone - Botswana's administrative center

πŸ”¬ Comprehensive Pollutant Monitoring

  • PMβ‚‚.β‚… - Fine particulate matter (most health-critical)
  • PM₁₀ - Coarse particulate matter
  • O₃ - Ground-level ozone
  • NOβ‚‚ - Nitrogen dioxide
  • SOβ‚‚ - Sulfur dioxide
  • CO - Carbon monoxide

πŸ› οΈ Technical Architecture

Frontend Stack

  • ⚑ Svelte 5 - Latest reactive framework with runes
  • πŸ—οΈ SvelteKit - Full-stack framework with SSR/SPA capabilities
  • πŸ“˜ TypeScript - Type-safe development
  • 🎨 Tailwind CSS 4 - Modern utility-first styling
  • πŸ“Š ECharts - Professional data visualization library
  • πŸ—ΊοΈ MapLibre GL - High-performance mapping engine

Data Processing

  • πŸ—‚οΈ Apache Arrow - Efficient columnar data processing
  • πŸ“¦ Parquet-WASM - Client-side parquet file parsing
  • ⚑ WebAssembly - High-performance data operations
  • πŸ•’ Date-fns - Robust date/time manipulation

Development Tools

  • πŸš€ Bun - Fast JavaScript runtime and package manager
  • ⚑ Vite - Lightning-fast build tool
  • πŸ” Svelte Check - TypeScript integration for Svelte
  • πŸ“ ESLint & Prettier - Code quality and formatting

πŸš€ Quick Start

Prerequisites

  • Bun >= 1.0.0 (recommended package manager)
  • Node.js >= 18.0.0 (fallback)

Installation & Development

# Clone the repository
git clone https://github.com/cartologic/aaqis-app.git
cd aaqis-app

# Install dependencies using Bun (recommended)
bun install

# Start development server
bun run dev

# Alternative: Using npm/yarn
npm install && npm run dev

Build & Deploy

# Production build
bun run build

# Preview production build
bun run preview

# Type checking
bun run check

# Continuous type checking
bun run check:watch

The application will be available at http://localhost:5173

πŸ“ Project Structure

src/
β”œβ”€β”€ app.html                 # HTML template
β”œβ”€β”€ app.css                  # Global styles
β”œβ”€β”€ lib/                     # Shared library code
β”‚   β”œβ”€β”€ components/          # Reusable Svelte components
β”‚   β”‚   β”œβ”€β”€ AQIGauge.svelte         # Circular AQI indicator
β”‚   β”‚   β”œβ”€β”€ AirQualityHeatmap.svelte # ECharts calendar heatmap
β”‚   β”‚   β”œβ”€β”€ FilterBar.svelte        # Advanced filtering controls
β”‚   β”‚   β”œβ”€β”€ LineChart.svelte        # Time series charts
β”‚   β”‚   β”œβ”€β”€ MapComponent.svelte     # Interactive map with popups
β”‚   β”‚   └── DataDebugger.svelte     # Development debugging tool
β”‚   β”œβ”€β”€ dataUtils.ts         # Data processing and aggregation
β”‚   β”œβ”€β”€ locationService.ts   # Geolocation and station finding
β”‚   β”œβ”€β”€ messages.ts          # Stakeholder-specific messaging
β”‚   └── types.ts             # TypeScript type definitions
β”œβ”€β”€ routes/                  # SvelteKit file-based routing
β”‚   β”œβ”€β”€ +layout.svelte       # App-wide layout
β”‚   └── +page.svelte         # Main dashboard page
static/
β”œβ”€β”€ data/                    # Static data files
β”‚   └── *.parquet           # Air quality datasets
└── favicon.png             # App icon

🎨 Design System

Color Palette

The application uses a carefully curated color system based on international AQI standards:

  • 🟒 Good (0-50): #00e400 - Vibrant green indicating healthy air
  • 🟑 Moderate (51-100): #ffff00 - Yellow for acceptable conditions
  • 🟠 Unhealthy for Sensitive (101-150): #ff7e00 - Orange warning
  • πŸ”΄ Unhealthy (151-200): #ff0000 - Red alert level
  • 🟣 Very Unhealthy (201-300): #8f3f97 - Purple danger zone
  • ⚫ Hazardous (300+): #7e0023 - Maroon critical level

Typography

  • Primary Font: Ubuntu (Google Fonts)
  • UI Font Stack: Inter, SF Pro, system fonts
  • Monospace: SF Mono, Consolas, Monaco

🌍 Data Sources & Processing

Data Pipeline

  1. πŸ“₯ Data Ingestion: Parquet files containing historical and real-time measurements
  2. πŸ”„ Processing: Apache Arrow for efficient columnar operations
  3. πŸ“Š Aggregation: Daily, weekly, monthly summaries with statistical analysis
  4. 🎯 Filtering: Station-specific, city-wide, and temporal filtering
  5. πŸ“‘ Real-time Updates: Simulated live data feed for demonstration

Data Quality

  • Comprehensive data validation and error handling
  • Missing data interpolation and flagging
  • Quality assurance metrics and reporting
  • Temporal consistency checks

🎯 Stakeholder Features

πŸ‘₯ Public Interface

  • Simple, intuitive AQI readings with health advice
  • Location-based recommendations
  • Easy-to-understand visual indicators
  • Mobile-responsive design

🏒 Government Dashboard

  • Policy-relevant data aggregations
  • Regulatory compliance monitoring
  • Trend analysis for decision-making
  • Export capabilities for reporting

πŸ”¬ Research Tools

  • Historical data access and analysis
  • Statistical trend identification
  • Data export in multiple formats
  • API access for programmatic use

πŸ”§ Configuration & Customization

Environment Variables

# Development
VITE_API_BASE_URL=https://api.aaqis.org
VITE_MAP_STYLE=your-mapbox-style-url

# Analytics (optional)
VITE_ANALYTICS_ID=your-analytics-id

Customizing Cities

Update src/lib/types.ts to add new cities:

export const CITY_INFO: Record<string, CityInfo> = {
    your_city: {
        name: 'your_city',
        displayName: 'Your City',
        country: 'your_country',
        emoji: 'πŸ™οΈ',
        center: [longitude, latitude],
        zoom: 11,
        stations: []
    }
};

πŸš€ Deployment Options

Static Deployment

bun run build
# Deploy the `build/` directory to any static host

SvelteKit Adapters

  • Vercel: @sveltejs/adapter-vercel
  • Netlify: @sveltejs/adapter-netlify
  • Cloudflare: @sveltejs/adapter-cloudflare
  • Node.js: @sveltejs/adapter-node

πŸ” Performance Optimizations

  • ⚑ Code Splitting: Automatic route-based code splitting
  • πŸ—œοΈ Asset Optimization: Vite's built-in minification and tree-shaking
  • πŸ“Š Lazy Loading: Charts and maps load on demand
  • πŸ’Ύ Efficient Data Structures: Columnar data processing with Apache Arrow
  • 🎯 Smart Caching: Browser and CDN caching strategies

πŸ§ͺ Testing & Quality Assurance

# Type checking
bun run check

# Linting (when configured)
bun run lint

# Testing (when configured)
bun run test

🀝 Contributing

We welcome contributions to improve AAQIS! Please see our contributing guidelines:

  1. 🍴 Fork the repository
  2. 🌿 Create a feature branch (git checkout -b feature/amazing-feature)
  3. πŸ’Ύ Commit your changes (git commit -m 'Add amazing feature')
  4. πŸ“€ Push to the branch (git push origin feature/amazing-feature)
  5. πŸ”„ Open a Pull Request

Development Guidelines

  • Follow TypeScript best practices
  • Use Svelte 5 runes for reactivity
  • Maintain consistent code formatting
  • Add proper documentation for new features
  • Ensure mobile responsiveness

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • 🌍 Environmental Data Providers for crucial air quality measurements
  • πŸ›οΈ African Governments for supporting environmental monitoring
  • πŸ‘¨β€πŸ’» Open Source Community for the amazing tools and libraries
  • 🎨 Design Inspiration from modern environmental dashboards

πŸ“ž Contact & Support


🌍 Built with ❀️ for a cleaner, healthier Africa

Empowering communities with actionable air quality information

Top categories

Loading Svelte Themes