How rithickkumar308/ai-weatherwise- works
Weatherwise is a backend API for city weather lookup, AI-generated summaries and recommendations, user accounts, and per-user favorite locations. The main workflow is an API request routed through Express to a controller, which fetches weather or invokes AI generation and returns a result; account and favorites operations use authentication and user/location models. The excerpts show controller, route, and service relationships, but no README description or frontend. Database wiring is indexed but its implementation was not excerpted.
Main entry points: app.js Express app · authMiddleware.js Token protection · authRoutes.js Auth routes · aiRoutes.js AI routes
Components 19
API runtime
- Server startup
AI-Weatherwise/Backend/src/server.js - Express app
AI-Weatherwise/Backend/src/app.js - DB connection
AI-Weatherwise/Backend/src/config/db.js
Accounts and access
- Auth routes
AI-Weatherwise/Backend/src/routes/authRoutes.js - Account controller
AI-Weatherwise/Backend/src/controllers/authController.js - Token protection
AI-Weatherwise/Backend/src/middleware/authMiddleware.js - User model
AI-Weatherwise/Backend/src/models/User.js
Weather lookup
- Weather routes
AI-Weatherwise/Backend/src/routes/weatherRoutes.js - Weather controller
AI-Weatherwise/Backend/src/controllers/weatherController.js - Weather service
AI-Weatherwise/Backend/src/services/weatherService.js - OpenWeatherMap
AI guidance
- AI routes
AI-Weatherwise/Backend/src/routes/aiRoutes.js - AI controller
AI-Weatherwise/Backend/src/controllers/aiController.js - AI service
AI-Weatherwise/Backend/src/services/aiService.js - Gemini API
Favorite locations
- Favorite routes
AI-Weatherwise/Backend/src/routes/locationRoutes.js - Favorite controller
AI-Weatherwise/Backend/src/controllers/locationController.js - Location model
AI-Weatherwise/Backend/src/models/Location.js
Other components
- API client
Connections 21
- API client → Express app: sends requests
- Server startup → Express app: starts
AI-Weatherwise/Backend/src/server.js - Server startup → DB connection: connects database
AI-Weatherwise/Backend/src/server.js - Express app → Auth routes: mounts
AI-Weatherwise/Backend/src/app.js - Express app → Weather routes: mounts
AI-Weatherwise/Backend/src/app.js - Express app → AI routes: mounts
AI-Weatherwise/Backend/src/app.js - Express app → Favorite routes: mounts
AI-Weatherwise/Backend/src/app.js - Auth routes → Account controller: dispatches
AI-Weatherwise/Backend/src/routes/authRoutes.js - Auth routes → Token protection: protects profile
AI-Weatherwise/Backend/src/routes/authRoutes.js - Account controller → User model: queries
AI-Weatherwise/Backend/src/controllers/authController.js - Token protection → User model: loads user
AI-Weatherwise/Backend/src/middleware/authMiddleware.js - Weather routes → Weather controller: dispatches
AI-Weatherwise/Backend/src/routes/weatherRoutes.js - Weather controller → Weather service: fetches weather
AI-Weatherwise/Backend/src/controllers/weatherController.js - Weather service → OpenWeatherMap: requests weather
AI-Weatherwise/Backend/src/services/weatherService.js - AI routes → AI controller: dispatches
AI-Weatherwise/Backend/src/routes/aiRoutes.js - AI routes → Token protection: protects endpoints
AI-Weatherwise/Backend/src/routes/aiRoutes.js - AI controller → AI service: generates guidance
AI-Weatherwise/Backend/src/controllers/aiController.js - AI service → Gemini API: generates content
AI-Weatherwise/Backend/src/services/aiService.js - Favorite routes → Favorite controller: dispatches
AI-Weatherwise/Backend/src/routes/locationRoutes.js - Favorite routes → Token protection: protects endpoints
AI-Weatherwise/Backend/src/routes/locationRoutes.js - Favorite controller → Location model: manages favorites
AI-Weatherwise/Backend/src/controllers/locationController.js