How timothylee58/slackbot-project works
This is a three-region weather and traffic notification service with an Express API, interactive map, scheduled and manual Slack delivery, runtime credential settings, and Prometheus metrics. The main workflow is scheduled or user-triggered notification → regional data collection → message formatting → Slack. API routes expose weather, traffic, combined status, location metadata, settings, and a Maps key. Some modules are represented from the source index and README rather than inspected excerpts; uncertain frontend-to-API wiring is omitted.
Main entry points: slackService.js Message Builder and Sender · api.js API Routes · app.js Express App · weatherController.js Weather Controller
Components 23
Entry and API
- Express App
backend/app.js - API Routes
backend/routes/api.js - Page Routes
backend/routes/pages.js - Map UI
backend/public/app.js - Error Handler
backend/middleware/errorHandler.js
Regional Data
- Location Metadata
backend/config/locations.js - Weather Controller
backend/controllers/weatherController.js - Traffic Controller
backend/controllers/trafficController.js - Weather Fetch and Cache
backend/services/weatherService.js - Traffic Fetch
backend/services/trafficService.js - Maps Key Proxy
backend/controllers/weatherProxyController.js
Notifications
- Cron Scheduler
backend/cron-schedule.js - Manual Trigger
backend/controllers/slackController.js - Message Builder and Sender
backend/services/slackService.js
Settings and Metrics
- Settings Controller
backend/controllers/settingsController.js - Runtime Settings
backend/config/runtimeSettings.js - Prometheus Metrics
backend/services/metrics.js
Other components
- Operator
- Map User
- Government Weather APIs
- Transport Data APIs
- Google Maps
- Slack Channel
Connections 28
- Operator → Cron Scheduler: schedules updates
README.md - Operator → Manual Trigger: triggers manually
README.md - Map User → Map UI: views map
README.md - Express App → API Routes: mounts API
backend/app.js - Express App → Page Routes: mounts pages
backend/app.js - Express App → Prometheus Metrics: records requests
backend/app.js - Express App → Error Handler: handles errors
backend/app.js - API Routes → Weather Controller: routes weather/status
backend/routes/api.js - API Routes → Traffic Controller: routes traffic
backend/routes/api.js - API Routes → Manual Trigger: serves locations
backend/routes/api.js - API Routes → Maps Key Proxy: routes map key
backend/routes/api.js - API Routes → Settings Controller: routes settings
backend/routes/api.js - Weather Controller → Weather Fetch and Cache: fetches weather
backend/controllers/weatherController.js - Weather Controller → Traffic Fetch: fetches traffic
backend/controllers/weatherController.js - Weather Controller → Location Metadata: validates regions
backend/controllers/weatherController.js - Weather Fetch and Cache → Government Weather APIs: requests forecasts
backend/services/weatherService.js - Traffic Controller → Traffic Fetch: fetches incidents
backend/controllers/trafficController.js - Traffic Fetch → Transport Data APIs: requests incidents
backend/services/trafficService.js - Cron Scheduler → Message Builder and Sender: runs notifications
backend/cron-schedule.js - Manual Trigger → Message Builder and Sender: sends notification
backend/controllers/slackController.js - Message Builder and Sender → Weather Fetch and Cache: fetches regional weather
backend/services/slackService.js - Message Builder and Sender → Traffic Fetch: fetches regional traffic
backend/services/slackService.js - Message Builder and Sender → Location Metadata: formats regions
backend/services/slackService.js - Message Builder and Sender → Runtime Settings: reads credentials
backend/services/slackService.js - Message Builder and Sender → Prometheus Metrics: records durations
backend/services/slackService.js - Message Builder and Sender → Slack Channel: posts message
README.md - Settings Controller → Runtime Settings: reads and updates
backend/controllers/settingsController.js - Maps Key Proxy → Google Maps: provides map key
README.md