Weather Notification Slackbot for DeliveryOps — a single Node.js/Express backend that fetches real-time weather data for Klang Valley (Malaysia), Singapore, and Hong Kong, and sends formatted updates to Slack. It also serves an interactive weather map UI.
All application code lives under backend/. There is no monorepo structure and no database.
cd backend && node index.jsThe server starts on port 3000. It requires a backend/.env file (see README → Configuration). For local development without a real Slack workspace, use placeholder values for SLACK_BOT_TOKEN and SLACK_CHANNEL_ID — the server starts fine and all non-Slack endpoints work.
GET /— homepage with interactive weather mapGET /api/locations— location metadataGET /api/weather/:locationKey— live weather data (singapore,hong-kong,klang-valley)GET /api/status/:locationKey— combined weather + trafficGET /send-notification— triggers Slack message (requires valid Slack credentials)
Without Slack secrets: Copy backend/.env.example to backend/.env with placeholder SLACK_BOT_TOKEN / SLACK_CHANNEL_ID. Weather and map endpoints work. /send-notification builds the full Slack payload but returns HTTP 500 with invalid_auth when Slack rejects placeholder tokens (configure real credentials via .env, Cursor secrets, or the in-app Slack Settings panel, which persists to backend/config/runtime-settings.json).
Google Maps: Set GOOGLE_MAPS_API_KEY in .env for the interactive map on /; without it the homepage still loads but the map shows a Google Maps load error.
- No linter is configured (no ESLint/Prettier).
- Jest + Supertest:
cd backend && npm testruns suites underbackend/__tests__/. Tests importappfromapp.jsdirectly (notindex.js), so they do not bind port 3000. Some tests may fail if they drift from current API behavior (status codes, traffic URLs, error messages). - First-time env:
cp backend/.env.example backend/.envbefore starting the server.
- The
body-parserpackage is used but not listed inpackage.jsondependencies — it works because Express v4 bundles it, but imports may produce warnings in some environments. - Puppeteer (for map screenshots) requires Chromium system dependencies. It is not needed for core weather/API functionality.