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) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
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:
Currently monitoring air quality in:
# 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
# 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
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
The application uses a carefully curated color system based on international AQI standards:
#00e400
- Vibrant green indicating healthy air#ffff00
- Yellow for acceptable conditions#ff7e00
- Orange warning#ff0000
- Red alert level#8f3f97
- Purple danger zone#7e0023
- Maroon critical level# Development
VITE_API_BASE_URL=https://api.aaqis.org
VITE_MAP_STYLE=your-mapbox-style-url
# Analytics (optional)
VITE_ANALYTICS_ID=your-analytics-id
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: []
}
};
bun run build
# Deploy the `build/` directory to any static host
@sveltejs/adapter-vercel
@sveltejs/adapter-netlify
@sveltejs/adapter-cloudflare
@sveltejs/adapter-node
# Type checking
bun run check
# Linting (when configured)
bun run lint
# Testing (when configured)
bun run test
We welcome contributions to improve AAQIS! Please see our contributing guidelines:
git checkout -b feature/amazing-feature
)git commit -m 'Add amazing feature'
)git push origin feature/amazing-feature
)This project is licensed under the MIT License - see the LICENSE file for details.
π Built with β€οΈ for a cleaner, healthier Africa
Empowering communities with actionable air quality information