# nutellatn/projet-gabriel architecture

> Architecture diagram of the GitHub repository nutellatn/projet-gabriel, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nutellatn/projet-gabriel
- Repository: https://github.com/nutellatn/projet-gabriel

## Overview

Ice Breakup Monitor combines a river-status map, seasonal discharge/thermal-index charts, and a daily serverless data pipeline. Users select a river on the map or in the chart view; the chart controller loads its configuration, subscribes to the active Firestore season, and renders observed and predicted series against risk zones. The repository also includes a separate static diagram-export capability. Pipeline internals and some map wiring are only partially sampled; uncertain links are omitted or marked unverified.

Main entry points: [`src/map.js`](https://github.com/nutellatn/projet-gabriel/blob/main/src/map.js) (River Map), [`src/main.js`](https://github.com/nutellatn/projet-gabriel/blob/main/src/main.js) (Chart Controller), [`scripts/poll_daily.py`](https://github.com/nutellatn/projet-gabriel/blob/main/scripts/poll_daily.py) (Daily Poller), [`src/firestore-service.js`](https://github.com/nutellatn/projet-gabriel/blob/main/src/firestore-service.js) (Season Subscription)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["River Monitoring UI"]
  node_map["River Map<br/>[map.js]"]
  node_chart_controller["Chart Controller<br/>[main.js]"]
  node_chart["Risk Charts<br/>[chart.js]"]
  node_translations["Translations<br/>[i18n.js]"]
  node_geo_data["Map Layers"]
end

subgraph group_domain["River Analysis"]
  node_river_config["River Config<br/>[river-data.js]"]
  node_zone_logic["Risk Classification<br/>[zone-logic.js]"]
end

subgraph group_pipeline["Data Pipeline"]
  node_poller["Daily Poller<br/>[poll_daily.py]"]
  node_weather["Weather Data"]
  node_discharge["Discharge Data"]
  node_diagram_export["Diagram Export<br/>[export_diagrams.py]"]
end

subgraph group_platform["Data Services"]
  node_season_service["Season Subscription"]
  node_firebase["Firebase Setup<br/>[firebase-config.js]"]
  node_firestore[("Season Records")]
end

node_user(("Monitor"))
node_github_actions["Workflow Runner"]
node_github_api["GitHub Actions API"]

node_user -->|"opens map"| node_map
node_user -->|"selects river"| node_chart_controller
node_map -->|"opens river chart"| node_chart_controller
node_map -.->|"loads layers"| node_geo_data
node_map -->|"subscribes"| node_season_service
node_map -->|"classifies status"| node_zone_logic
node_map -->|"reads river settings"| node_river_config
node_chart_controller -->|"loads settings"| node_river_config
node_chart_controller -->|"subscribes"| node_season_service
node_chart_controller -->|"renders series"| node_chart
node_chart -->|"reads zones and limits"| node_river_config
node_chart -->|"labels chart"| node_translations
node_map -->|"translates UI"| node_translations
node_season_service -->|"uses database"| node_firebase
node_season_service -->|"reads season data"| node_firestore
node_poller -->|"fetches temperatures"| node_weather
node_poller -->|"fetches flow"| node_discharge
node_poller -->|"writes processed series"| node_firestore
node_github_actions -->|"runs daily"| node_poller
node_chart_controller -->|"starts and checks workflow"| node_github_api
node_diagram_export -->|"queries observations"| node_firestore

click node_map "https://github.com/nutellatn/projet-gabriel/blob/main/src/map.js"
click node_chart_controller "https://github.com/nutellatn/projet-gabriel/blob/main/src/main.js"
click node_chart "https://github.com/nutellatn/projet-gabriel/blob/main/src/chart.js"
click node_translations "https://github.com/nutellatn/projet-gabriel/blob/main/src/i18n.js"
click node_geo_data "https://github.com/nutellatn/projet-gabriel/tree/main/public/data"
click node_river_config "https://github.com/nutellatn/projet-gabriel/blob/main/src/river-data.js"
click node_zone_logic "https://github.com/nutellatn/projet-gabriel/blob/main/src/zone-logic.js"
click node_season_service "https://github.com/nutellatn/projet-gabriel/blob/main/src/firestore-service.js"
click node_firebase "https://github.com/nutellatn/projet-gabriel/blob/main/src/firebase-config.js"
click node_poller "https://github.com/nutellatn/projet-gabriel/blob/main/scripts/poll_daily.py"
click node_diagram_export "https://github.com/nutellatn/projet-gabriel/blob/main/scripts/export_diagrams.py"

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_map,node_chart_controller,node_chart,node_translations,node_geo_data toneBlue
class node_river_config,node_zone_logic toneAmber
class node_poller,node_weather,node_discharge,node_diagram_export,node_github_api toneMint
class node_season_service,node_firebase,node_firestore toneRose
class node_user,node_github_actions toneIndigo
```

## Components

### River Monitoring UI

- [River Map](https://github.com/nutellatn/projet-gabriel/blob/main/src/map.js): `src/map.js`
- [Chart Controller](https://github.com/nutellatn/projet-gabriel/blob/main/src/main.js): `src/main.js`
- [Risk Charts](https://github.com/nutellatn/projet-gabriel/blob/main/src/chart.js): `src/chart.js`
- [Translations](https://github.com/nutellatn/projet-gabriel/blob/main/src/i18n.js): `src/i18n.js`
- [Map Layers](https://github.com/nutellatn/projet-gabriel/tree/main/public/data): `public/data`

### River Analysis

- [River Config](https://github.com/nutellatn/projet-gabriel/blob/main/src/river-data.js): `src/river-data.js`
- [Risk Classification](https://github.com/nutellatn/projet-gabriel/blob/main/src/zone-logic.js): `src/zone-logic.js`

### Data Pipeline

- [Daily Poller](https://github.com/nutellatn/projet-gabriel/blob/main/scripts/poll_daily.py): `scripts/poll_daily.py`
- **Weather Data**
- **Discharge Data**
- [Diagram Export](https://github.com/nutellatn/projet-gabriel/blob/main/scripts/export_diagrams.py): `scripts/export_diagrams.py`

### Data Services

- [Season Subscription](https://github.com/nutellatn/projet-gabriel/blob/main/src/firestore-service.js): `src/firestore-service.js`
- [Firebase Setup](https://github.com/nutellatn/projet-gabriel/blob/main/src/firebase-config.js): `src/firebase-config.js`
- **Season Records**

### Other components

- **Monitor**
- **Workflow Runner**
- **GitHub Actions API**

## Connections

- Monitor → River Map: opens map (evidence: `src/map.js`)
- Monitor → Chart Controller: selects river (evidence: `src/main.js`)
- River Map → Chart Controller: opens river chart (evidence: `src/map.js`)
- River Map → Map Layers: loads layers
- River Map → Season Subscription: subscribes (evidence: `src/map.js`)
- River Map → Risk Classification: classifies status (evidence: `src/map.js`)
- River Map → River Config: reads river settings (evidence: `src/map.js`)
- Chart Controller → River Config: loads settings (evidence: `src/main.js`)
- Chart Controller → Season Subscription: subscribes (evidence: `src/main.js`)
- Chart Controller → Risk Charts: renders series (evidence: `src/main.js`)
- Risk Charts → River Config: reads zones and limits (evidence: `src/chart.js`)
- Risk Charts → Translations: labels chart (evidence: `src/chart.js`)
- River Map → Translations: translates UI (evidence: `src/map.js`)
- Season Subscription → Firebase Setup: uses database (evidence: `src/firestore-service.js`)
- Season Subscription → Season Records: reads season data (evidence: `src/firestore-service.js`)
- Daily Poller → Weather Data: fetches temperatures (evidence: `scripts/poll_daily.py`)
- Daily Poller → Discharge Data: fetches flow (evidence: `scripts/poll_daily.py`)
- Daily Poller → Season Records: writes processed series (evidence: `README.md`)
- Workflow Runner → Daily Poller: runs daily (evidence: `README.md`)
- Chart Controller → GitHub Actions API: starts and checks workflow (evidence: `src/main.js`)
- Diagram Export → Season Records: queries observations (evidence: `scripts/export_diagrams.py`)
