How jav1689/outrisk-utp works
OutRisk UTP is a weather-aware outdoor activity planning dashboard for UTP and Seri Iskandar. A user selects a location, activity and forecast hour; the dashboard requests current conditions and a seven-day risk outlook, then presents an activity assessment, precautions and safer alternative times. The API obtains and preprocesses weather and air-quality data before applying shared risk rules and optional model scores. README capabilities include historical weather, sample-weather exploration and synthetic-data model training. Some route and UI internals were not excerpted, so uncertain links are omitted.
Main entry points: Dashboard.jsx Planning dashboard · fetch_weather.py Weather service · main.py FastAPI application · predict.py Prediction endpoints
Components 25
Planning dashboard
- React app shell
client/src/App.jsx - Planning dashboard
client/src/components/Dashboard.jsx - API client
client/src/api/client.js - Weather and time labels
client/src/weather.js - Current conditions
client/src/components/CurrentConditions.jsx - Activity selector
client/src/components/ActivityForm.jsx - Forecast chart
client/src/components/ForecastChart.jsx - Risk result
client/src/components/RiskResult.jsx - Recommendations view
client/src/components/Recommendations.jsx - Dashboard effects
client/src/components/ThreeBackground.jsx - Custom cursor
client/src/components/CustomCursor.jsx
API services
- FastAPI application
server/main.py - Weather endpoints
server/routes/weather.py - Prediction endpoints
server/routes/predict.py - Activity advice endpoint
server/routes/recommend.py
Weather data
- Weather service
server/data/fetch_weather.py - Sample conditions
server/data/sample.py - Weather preprocessing
server/data/preprocess.py
Risk assessment
- Risk thresholds
server/model/rules.py - Risk inference
server/model/predict.py
Model training
- Synthetic model training
server/model/train.py - Random Forest artifact
server/model/risk_model.pkl
Other components
- Outdoor planner
- Open-Meteo
- CAMS air-quality data
Connections 32
- Outdoor planner → Planning dashboard: plans activity
README.md - React app shell → Planning dashboard: renders
client/src/App.jsx - React app shell → Dashboard effects: renders
client/src/App.jsx - React app shell → Custom cursor: renders
client/src/App.jsx - Planning dashboard → API client: requests data
client/src/components/Dashboard.jsx - Planning dashboard → Current conditions: renders
client/src/components/Dashboard.jsx - Planning dashboard → Activity selector: renders
client/src/components/Dashboard.jsx - Planning dashboard → Forecast chart: renders
client/src/components/Dashboard.jsx - Planning dashboard → Risk result: renders
client/src/components/Dashboard.jsx - Planning dashboard → Recommendations view: renders
client/src/components/Dashboard.jsx - Planning dashboard → Weather and time labels: formats dates
client/src/components/Dashboard.jsx - API client → FastAPI application: HTTP requests
README.md - FastAPI application → Weather endpoints: registers routes
server/main.py - FastAPI application → Prediction endpoints: registers routes
server/main.py - FastAPI application → Activity advice endpoint: registers routes
server/main.py - FastAPI application → Weather service: initializes service
server/main.py - FastAPI application → Risk inference: loads model
server/main.py - Weather endpoints → Weather service: fetches conditions
server/routes/weather.py - Prediction endpoints → Weather service: fetches forecast
server/routes/predict.py - Prediction endpoints → Risk inference: scores forecast
server/routes/predict.py - Prediction endpoints → Weather endpoints: validates location
server/routes/predict.py - Activity advice endpoint → Prediction endpoints: assesses activity
server/routes/recommend.py - Weather service → Weather preprocessing: cleans readings
server/data/fetch_weather.py - Weather service → Open-Meteo: requests weather
README.md - Weather service → CAMS air-quality data: gets air quality
README.md - Weather service → Sample conditions: serves sample source
server/data/fetch_weather.py - Risk inference → Risk thresholds: applies thresholds
server/model/predict.py - Risk inference → Weather preprocessing: prepares features
server/model/predict.py - Synthetic model training → Risk thresholds: labels examples
server/model/train.py - Synthetic model training → Weather preprocessing: prepares features
server/model/train.py - Synthetic model training → Random Forest artifact: writes model
server/model/train.py - Risk inference → Random Forest artifact: loads model
server/model/predict.py