Live app → https://baq-frontend.streamlit.app/
BAQ Frontend is a web-based dashboard built with Streamlit to visualize and forecast air quality and weather conditions in Bangkok.
Key functionalities include:
- 🔮 PM2.5 prediction (1-step and multi-step up to 48 hours)
- 📊 Trend, distribution, and correlation visualizations
- 🕒 Time-based heatmaps and insights
- 🧾 Historical data browsing from S3 or API
- ☁️ Hosted via Streamlit Cloud
BAQ-FRONTEND/
├── .streamlit/
│ └── secrets.toml # 🔒 API keys & credentials (not pushed to GitHub)
├── app/
│ ├── components/
│ │ └── sidebar.py # Sidebar layout
│ ├── services/
│ │ ├── api_client.py # REST API client for predictions
│ │ └── data_loader.py # S3 data loader
│ ├── utils/
│ │ ├── dashboard.py # All dashboard visualizations
│ │ └── plot.py # Common plotting utilities
│ └── main.py # 🚀 Streamlit app entry point
├── .gitignore
├── requirements.txt
└── README.md
- Clone the repository:
git clone https://github.com/tawayahc/baq-frontend.git
cd baq-frontend- Create and activate a virtual environment:
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate- Install dependencies:
pip install -r requirements.txtCreate .streamlit/secrets.toml (do NOT push this file):
AWS_S3_BUCKET = "your-bucket"
AWS_ACCESS_KEY_ID = "your-access-key"
AWS_SECRET_ACCESS_KEY = "your-secret"
AWS_REGION = "ap-southeast-1"
API_BASE_URL = "http://your-api-url"
API_TOKEN = "optional-token"
On Streamlit Cloud, go to App → Settings → Secrets and paste your credentials there.
streamlit run app/main.pyThen open http://localhost:8501 in your browser.
- Push your code to GitHub (excluding .env and secrets.toml)
- Go to https://share.streamlit.io
- Connect your repo and configure Secrets in the UI
- Done 🎉