How hirtik786/weather-dashboard works
This repository combines the README-described weather reporting dashboard with a backend product-management and marketplace-integration API. The main dashboard flow fetches fresh city weather or reads the latest cached snapshot, then renders metrics, charts, and a searchable table; separate pages inspect historical reports and configured cities. Product routes add authenticated catalog synchronization with Amazon and Sendbox. The README documents weather capabilities whose implementation is not sampled here; their nodes use paths confirmed by the tree, and uncertain internal wiring is omitted.
Main entry points: server.js Express application · weatherService.js Weather fetching · productController.js Product operations · api.js Weather API client
Components 29
Weather experience
- Dashboard view
frontend/js/app.js - Reports archive
frontend/js/reports.js - City directory
frontend/js/cities.js - Weather API client
frontend/js/api.js - Historical reports
frontend/js/reports.js
Weather services
- Weather routes
backend/routes/weatherRoutes.js - Weather controller
backend/controllers/weatherController.js - Weather fetching
backend/services/weatherService.js - City coordinates
backend/data/cities.js - Weather mapping
backend/utils/weatherCode.js - Cache and reports
backend/services/redisService.js - Redis
backend/config/redis.js - Express application
backend/server.js
Accounts and catalog
- Account interface
frontend/js/auth.js - Authentication routes
backend/routes/authRoutes.js - Authentication handlers
backend/controllers/authController.js - User authentication
backend/middleware/authMiddleware.js - Product interface
frontend/js/products.js - Product routes
backend/routes/productRoutes.js - Product operations
backend/controllers/productController.js - Product records
backend/models/productModel.js - Sync records
backend/models/productIntegrationModel.js
Marketplace integrations
- Product synchronizer
backend/services/productSyncService.js - Amazon adapter
backend/services/amazon/amazonService.js - Sendbox adapter
backend/services/sendbox/sendboxService.js
Other components
- Dashboard user
- Open-Meteo API
- Amazon services
- Sendbox services
Connections 30
- Dashboard user → Dashboard view: views or refreshes
- Dashboard user → Reports archive: opens reports
- Dashboard user → City directory: browses cities
- Dashboard view → Weather API client: requests weather
- Reports archive → Weather API client: requests reports
- City directory → Weather API client: requests cities
- Weather API client → Express application: sends REST requests
- Express application → Weather routes: mounts routes
- Weather routes → Weather controller: dispatches requests
- Weather controller → Weather fetching: fetches fresh data
- Weather fetching → Open-Meteo API: requests forecasts
- Weather fetching → City coordinates: uses city coordinates
- Weather fetching → Weather mapping: maps conditions
- Weather controller → Cache and reports: reads and saves
- Cache and reports → Redis: reads and writes
- Cache and reports → Historical reports: supplies snapshots
- Account interface → Express application: sends auth requests
- Express application → Authentication routes: mounts routes
- Authentication routes → Authentication handlers: dispatches requests
- Product interface → Express application: sends product requests
- Express application → Product routes: mounts routes
- Product routes → User authentication: protects routes
- Product routes → Product operations: dispatches requests
- Product operations → Product records: manages products
- Product operations → Sync records: reads integration state
- Product operations → Product synchronizer: requests synchronization
- Product synchronizer → Amazon adapter: syncs listings
- Product synchronizer → Sendbox adapter: syncs fulfillment
- Amazon adapter → Amazon services: calls marketplace API
- Sendbox adapter → Sendbox services: calls shipping API