How waitasecant/air-pollution-dashboard works
Project Type and Purpose
• This is a data‐driven interactive dashboard built with R Shiny (“myApp/app.R”) that visualizes ambient air quality in Delhi. It incorporates Python scripts (“checkRealTime.py” and “realTimeDelhi.py”) to fetch and preprocess real‐time data, plus precomputed monthly‐average maps stored under “myApp/www/monthlyAvg.”
High-Level Architectural Components
a. External Data Sources
• Government or third-party air-quality APIs (e.g., CPCB feeds)
• Historical datasets (e.g., monthly station data)
b. Data Ingestion & Processing Layer (Python)
• checkRealTime.py – scheduled ETL for last-24h data
• realTimeDelhi.py – fetch current readings, update “realTimeDelhi.csv”
• DTAQI.pkl – pickled DataFrame of processed AQI values
c. Data Storage
• Raw/processed CSV files in “myApp/data” (“dailyDataAQI.csv”, “realTimeDelhi.csv”)
• Precomputed choropleth map tiles/images in “myApp/www/monthlyAvg”
d. Backend & Business Logic (R Shiny)
• app.R – loads CSV/PKL, computes time-series plots, renders choropleth
• Uses inverse-distance interpolation over a 10×10 km grid
e. Frontend UI & Static Assets
• myApp/www – static assets (CSS, JS, prebuilt maps/images)
• Shiny UI elements (leaflet maps, ggplot2 time series)
f. Deployment & CI/CD
• GitHub Actions (/.github/workflows/main.yml) for linting/tests or build triggers
• Deployment target: https://waitasecant.shinyapps.io/myapp
Interactions & Data Flow
2. Python ETL → “myApp/data” CSV/PKL storage
5. R Shiny → renders maps & plots → browser (end user)
Architectural Patterns & Principles
• Separation of concerns: Python handles data ingestion/processing; R Shiny handles visualization.
• “Files as database”: flat‐file storage for small/medium data (CSV, PKL).
• Precomputation of heavy map tiles to speed up serving.
• Use of CI/CD (GitHub Actions) to automate testing/deployment.
Detail Checklist
• Every directory with its role (data/, www/, workflows/)
• Which file holds which piece of functionality
• Both real‐time time series and choropleth generation paths