# anoop-tech-ai/northstar architecture

> Architecture diagram of the GitHub repository anoop-tech-ai/northstar, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/anoop-tech-ai/northstar
- Repository: https://github.com/anoop-tech-ai/northstar

## Overview

Northstar Weather serves a browser dashboard and an Express API: users search for places or select map coordinates, then view weather and air-quality forecasts, with guest features available locally and account features synced through the API. The API also supports profiles, preferences, favorites, alert rules, and search history. The graph preserves those documented product branches; some route and controller wiring is based on the documented API and tree, since their source was not sampled.

Main entry points: [`server/server.js`](https://github.com/anoop-tech-ai/northstar/blob/main/server/server.js) (Express API and static serving), [`app.js`](https://github.com/anoop-tech-ai/northstar/blob/main/app.js) (Dashboard and interactions), [`server/routes`](https://github.com/anoop-tech-ai/northstar/tree/main/server/routes) (Other API routes), [`server/controllers`](https://github.com/anoop-tech-ai/northstar/tree/main/server/controllers) (Profile and preferences)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Browser experience"]
  node_client_app["Dashboard and interactions<br/>[app.js]"]
  node_client_shell["Page shell<br/>[index.html]"]
end

subgraph group_api["API and services"]
  node_api_server["Express API and static serving<br/>[server.js]"]
  node_auth_routes["Authentication routes<br/>[auth.routes.js]"]
  node_favorite_routes["Favorite routes<br/>[favorite.routes.js]"]
  node_alert_routes["Alert routes<br/>[alert.routes.js]"]
  node_other_routes["Other API routes"]
end

subgraph group_accounts["Accounts and saved data"]
  node_auth_controller["Authentication<br/>[auth.controller.js]"]
  node_favorite_controller["Favorite management"]
  node_alert_controller["Alert rules"]
  node_history_controller["Search history"]
  node_account_controllers["Profile and preferences"]
  node_user_model[("User records<br/>[User.js]")]
  node_favorite_model[("Favorite records<br/>[Favorite.js]")]
  node_alert_model[("Alert records<br/>[Alert.js]")]
  node_history_model[("History records<br/>[SearchHistory.js]")]
  node_other_models[("Preference records<br/>[Preference.js]")]
end

subgraph group_weather["Weather data"]
  node_weather_routes["Weather endpoint<br/>[weather.routes.js]"]
  node_weather_controller["Weather query handling"]
  node_weather_service["Forecast and AQI proxy<br/>[weather.service.js]"]
end

node_user(("Weather user"))
node_browser["Browser"]
node_open_meteo_geo["Open-Meteo geocoding"]
node_leaflet_osm["Leaflet and OSM maps"]
node_mongo[("MongoDB")]
node_open_meteo["Open-Meteo forecast and AQI"]
node_bigdata["BigDataCloud reverse geocoding"]

node_user -->|"uses"| node_browser
node_browser -->|"interacts"| node_client_app
node_client_shell -->|"renders"| node_browser
node_client_app -->|"requests API"| node_api_server
node_client_app -.->|"searches places"| node_open_meteo_geo
node_client_app -.->|"shows map"| node_leaflet_osm
node_api_server -->|"mounts"| node_auth_routes
node_api_server -->|"mounts"| node_favorite_routes
node_api_server -->|"mounts"| node_alert_routes
node_api_server -->|"mounts"| node_other_routes
node_api_server -->|"mounts"| node_weather_routes
node_auth_routes -->|"dispatches"| node_auth_controller
node_favorite_routes -->|"dispatches"| node_favorite_controller
node_alert_routes -->|"dispatches"| node_alert_controller
node_other_routes -->|"dispatches"| node_history_controller
node_auth_routes -->|"dispatches"| node_account_controllers
node_other_routes -->|"dispatches"| node_account_controllers
node_other_routes -->|"dispatches"| node_favorite_controller
node_other_routes -->|"dispatches"| node_alert_controller
node_weather_routes -->|"dispatches"| node_weather_controller
node_weather_controller -->|"fetches forecast"| node_weather_service
node_weather_service -->|"requests weather and AQI"| node_open_meteo
node_weather_service -->|"caches in memory"| node_mongo
node_auth_controller -->|"reads and writes"| node_user_model
node_auth_controller -->|"creates preferences"| node_other_models
node_favorite_controller -->|"reads and writes"| node_favorite_model
node_alert_controller -->|"reads and writes"| node_alert_model
node_history_controller -->|"reads and writes"| node_history_model
node_account_controllers -->|"accesses"| node_user_model
node_account_controllers -->|"accesses"| node_other_models
node_user_model -->|"persists"| node_mongo
node_favorite_model -->|"persists"| node_mongo
node_alert_model -->|"persists"| node_mongo
node_history_model -->|"persists"| node_mongo
node_other_models -->|"persists"| node_mongo
node_client_app -.->|"reverse geocodes"| node_bigdata

click node_client_app "https://github.com/anoop-tech-ai/northstar/blob/main/app.js"
click node_client_shell "https://github.com/anoop-tech-ai/northstar/blob/main/index.html"
click node_api_server "https://github.com/anoop-tech-ai/northstar/blob/main/server/server.js"
click node_auth_routes "https://github.com/anoop-tech-ai/northstar/blob/main/server/routes/auth.routes.js"
click node_favorite_routes "https://github.com/anoop-tech-ai/northstar/blob/main/server/routes/favorite.routes.js"
click node_alert_routes "https://github.com/anoop-tech-ai/northstar/blob/main/server/routes/alert.routes.js"
click node_other_routes "https://github.com/anoop-tech-ai/northstar/tree/main/server/routes"
click node_auth_controller "https://github.com/anoop-tech-ai/northstar/blob/main/server/controllers/auth.controller.js"
click node_favorite_controller "https://github.com/anoop-tech-ai/northstar/blob/main/server/controllers/favorite.controller.js"
click node_alert_controller "https://github.com/anoop-tech-ai/northstar/blob/main/server/controllers/alert.controller.js"
click node_history_controller "https://github.com/anoop-tech-ai/northstar/blob/main/server/controllers/searchHistory.controller.js"
click node_account_controllers "https://github.com/anoop-tech-ai/northstar/tree/main/server/controllers"
click node_user_model "https://github.com/anoop-tech-ai/northstar/blob/main/server/models/User.js"
click node_favorite_model "https://github.com/anoop-tech-ai/northstar/blob/main/server/models/Favorite.js"
click node_alert_model "https://github.com/anoop-tech-ai/northstar/blob/main/server/models/Alert.js"
click node_history_model "https://github.com/anoop-tech-ai/northstar/blob/main/server/models/SearchHistory.js"
click node_other_models "https://github.com/anoop-tech-ai/northstar/blob/main/server/models/Preference.js"
click node_weather_routes "https://github.com/anoop-tech-ai/northstar/blob/main/server/routes/weather.routes.js"
click node_weather_controller "https://github.com/anoop-tech-ai/northstar/blob/main/server/controllers/weather.controller.js"
click node_weather_service "https://github.com/anoop-tech-ai/northstar/blob/main/server/services/weather.service.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_client_app,node_client_shell,node_user,node_browser toneBlue
class node_api_server,node_auth_routes,node_favorite_routes,node_alert_routes,node_other_routes,node_mongo toneAmber
class node_auth_controller,node_favorite_controller,node_alert_controller,node_history_controller,node_account_controllers,node_user_model,node_favorite_model,node_alert_model,node_history_model,node_other_models toneMint
class node_weather_routes,node_weather_controller,node_weather_service toneRose
class node_open_meteo_geo,node_leaflet_osm,node_open_meteo,node_bigdata toneIndigo
```

## Components

### Browser experience

- [Dashboard and interactions](https://github.com/anoop-tech-ai/northstar/blob/main/app.js): `app.js`
- [Page shell](https://github.com/anoop-tech-ai/northstar/blob/main/index.html): `index.html`

### API and services

- [Express API and static serving](https://github.com/anoop-tech-ai/northstar/blob/main/server/server.js): `server/server.js`
- [Authentication routes](https://github.com/anoop-tech-ai/northstar/blob/main/server/routes/auth.routes.js): `server/routes/auth.routes.js`
- [Favorite routes](https://github.com/anoop-tech-ai/northstar/blob/main/server/routes/favorite.routes.js): `server/routes/favorite.routes.js`
- [Alert routes](https://github.com/anoop-tech-ai/northstar/blob/main/server/routes/alert.routes.js): `server/routes/alert.routes.js`
- [Other API routes](https://github.com/anoop-tech-ai/northstar/tree/main/server/routes): `server/routes`

### Accounts and saved data

- [Authentication](https://github.com/anoop-tech-ai/northstar/blob/main/server/controllers/auth.controller.js): `server/controllers/auth.controller.js`
- [Favorite management](https://github.com/anoop-tech-ai/northstar/blob/main/server/controllers/favorite.controller.js): `server/controllers/favorite.controller.js`
- [Alert rules](https://github.com/anoop-tech-ai/northstar/blob/main/server/controllers/alert.controller.js): `server/controllers/alert.controller.js`
- [Search history](https://github.com/anoop-tech-ai/northstar/blob/main/server/controllers/searchHistory.controller.js): `server/controllers/searchHistory.controller.js`
- [Profile and preferences](https://github.com/anoop-tech-ai/northstar/tree/main/server/controllers): `server/controllers`
- [User records](https://github.com/anoop-tech-ai/northstar/blob/main/server/models/User.js): `server/models/User.js`
- [Favorite records](https://github.com/anoop-tech-ai/northstar/blob/main/server/models/Favorite.js): `server/models/Favorite.js`
- [Alert records](https://github.com/anoop-tech-ai/northstar/blob/main/server/models/Alert.js): `server/models/Alert.js`
- [History records](https://github.com/anoop-tech-ai/northstar/blob/main/server/models/SearchHistory.js): `server/models/SearchHistory.js`
- [Preference records](https://github.com/anoop-tech-ai/northstar/blob/main/server/models/Preference.js): `server/models/Preference.js`

### Weather data

- [Weather endpoint](https://github.com/anoop-tech-ai/northstar/blob/main/server/routes/weather.routes.js): `server/routes/weather.routes.js`
- [Weather query handling](https://github.com/anoop-tech-ai/northstar/blob/main/server/controllers/weather.controller.js): `server/controllers/weather.controller.js`
- [Forecast and AQI proxy](https://github.com/anoop-tech-ai/northstar/blob/main/server/services/weather.service.js): `server/services/weather.service.js`

### Other components

- **Weather user**
- **Browser**
- **Open-Meteo geocoding**
- **Leaflet and OSM maps**
- **MongoDB**
- **Open-Meteo forecast and AQI**
- **BigDataCloud reverse geocoding**

## Connections

- Weather user → Browser: uses
- Browser → Dashboard and interactions: interacts
- Page shell → Browser: renders
- Dashboard and interactions → Express API and static serving: requests API
- Dashboard and interactions → Open-Meteo geocoding: searches places
- Dashboard and interactions → Leaflet and OSM maps: shows map
- Express API and static serving → Authentication routes: mounts
- Express API and static serving → Favorite routes: mounts
- Express API and static serving → Alert routes: mounts
- Express API and static serving → Other API routes: mounts
- Express API and static serving → Weather endpoint: mounts
- Authentication routes → Authentication: dispatches
- Favorite routes → Favorite management: dispatches
- Alert routes → Alert rules: dispatches
- Other API routes → Search history: dispatches
- Authentication routes → Profile and preferences: dispatches
- Other API routes → Profile and preferences: dispatches
- Other API routes → Favorite management: dispatches
- Other API routes → Alert rules: dispatches
- Weather endpoint → Weather query handling: dispatches
- Weather query handling → Forecast and AQI proxy: fetches forecast
- Forecast and AQI proxy → Open-Meteo forecast and AQI: requests weather and AQI
- Forecast and AQI proxy → MongoDB: caches in memory
- Authentication → User records: reads and writes
- Authentication → Preference records: creates preferences
- Favorite management → Favorite records: reads and writes
- Alert rules → Alert records: reads and writes
- Search history → History records: reads and writes
- Profile and preferences → User records: accesses
- Profile and preferences → Preference records: accesses
- User records → MongoDB: persists
- Favorite records → MongoDB: persists
- Alert records → MongoDB: persists
- History records → MongoDB: persists
- Preference records → MongoDB: persists
- Dashboard and interactions → BigDataCloud reverse geocoding: reverse geocodes
