# hache231/hydroportail architecture

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

- Interactive diagram: https://gitdiagram.com/hache231/hydroportail
- Repository: https://github.com/hache231/hydroportail

## Overview

Hydroportail is a Django water-station geoportal with account registration and login, protected portal pages, geographic filtering, and station-data APIs. Users authenticate or register, then access the portal; map and API views query station and administrative-area models and return rendered pages or JSON. Separate catalog models capture station types, products, sources, and services, while Django admin provides import/export-enabled management. The graph follows the excerpted routes and calls; templates and project-level URL wiring are not shown, so their relationships are omitted.

Main entry points: [`accounts/views.py`](https://github.com/hache231/hydroportail/blob/main/accounts/views.py) (Account workflows), [`geoportal/admin.py`](https://github.com/hache231/hydroportail/blob/main/geoportal/admin.py) (Import/export admin), [`geoportal/views.py`](https://github.com/hache231/hydroportail/blob/main/geoportal/views.py) (Portal and API views), [`geoportal/models.py`](https://github.com/hache231/hydroportail/blob/main/geoportal/models.py) (Stations and geography)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_accounts["Accounts"]
  node_account_routes["Account routes<br/>[urls.py]"]
  node_account_views["Account workflows<br/>[views.py]"]
  node_account_forms["Account forms<br/>[forms.py]"]
  node_visitor_records[("Visitor profiles<br/>[models.py]")]
end

subgraph group_portal["Geoportal"]
  node_portal_routes["Geoportal routes<br/>[urls.py]"]
  node_portal_views["Portal and API views<br/>[views.py]"]
end

subgraph group_domain["Geo Data"]
  node_station_data[("Stations and geography<br/>[models.py]")]
  node_catalog_data[("Station catalogs<br/>[models.py]")]
end

subgraph group_management["Administration"]
  node_admin_site["Import/export admin<br/>[admin.py]"]
end

node_visitor(("Portal visitor"))
node_auth_framework["Django authentication"]
node_import_export["Import-export package"]

node_visitor -->|"opens account"| node_account_routes
node_account_routes -->|"routes requests"| node_account_views
node_account_views -->|"uses forms"| node_account_forms
node_account_views -->|"authenticates users"| node_auth_framework
node_account_views -->|"creates profile"| node_visitor_records
node_visitor -.->|"opens portal"| node_portal_routes
node_portal_routes -->|"routes requests"| node_portal_views
node_portal_views -->|"queries stations"| node_station_data
node_portal_views -->|"queries areas"| node_station_data
node_admin_site -->|"manages records"| node_station_data
node_admin_site -->|"manages catalogs"| node_catalog_data
node_admin_site -->|"uses package"| node_import_export

click node_account_routes "https://github.com/hache231/hydroportail/blob/main/accounts/urls.py"
click node_account_views "https://github.com/hache231/hydroportail/blob/main/accounts/views.py"
click node_account_forms "https://github.com/hache231/hydroportail/blob/main/accounts/forms.py"
click node_visitor_records "https://github.com/hache231/hydroportail/blob/main/accounts/models.py"
click node_portal_routes "https://github.com/hache231/hydroportail/blob/main/geoportal/urls.py"
click node_portal_views "https://github.com/hache231/hydroportail/blob/main/geoportal/views.py"
click node_station_data "https://github.com/hache231/hydroportail/blob/main/geoportal/models.py"
click node_catalog_data "https://github.com/hache231/hydroportail/blob/main/geoportal/models.py"
click node_admin_site "https://github.com/hache231/hydroportail/blob/main/geoportal/admin.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_account_routes,node_account_views,node_account_forms,node_visitor_records toneBlue
class node_portal_routes,node_portal_views toneAmber
class node_station_data,node_catalog_data toneMint
class node_admin_site toneRose
class node_visitor,node_auth_framework,node_import_export toneIndigo
```

## Components

### Accounts

- [Account routes](https://github.com/hache231/hydroportail/blob/main/accounts/urls.py): `accounts/urls.py`
- [Account workflows](https://github.com/hache231/hydroportail/blob/main/accounts/views.py): `accounts/views.py`
- [Account forms](https://github.com/hache231/hydroportail/blob/main/accounts/forms.py): `accounts/forms.py`
- [Visitor profiles](https://github.com/hache231/hydroportail/blob/main/accounts/models.py): `accounts/models.py`

### Geoportal

- [Geoportal routes](https://github.com/hache231/hydroportail/blob/main/geoportal/urls.py): `geoportal/urls.py`
- [Portal and API views](https://github.com/hache231/hydroportail/blob/main/geoportal/views.py): `geoportal/views.py`

### Geo Data

- [Stations and geography](https://github.com/hache231/hydroportail/blob/main/geoportal/models.py): `geoportal/models.py`
- [Station catalogs](https://github.com/hache231/hydroportail/blob/main/geoportal/models.py): `geoportal/models.py`

### Administration

- [Import/export admin](https://github.com/hache231/hydroportail/blob/main/geoportal/admin.py): `geoportal/admin.py`

### Other components

- **Portal visitor**
- **Django authentication**
- **Import-export package**

## Connections

- Portal visitor → Account routes: opens account (evidence: `accounts/urls.py`)
- Account routes → Account workflows: routes requests (evidence: `accounts/urls.py`)
- Account workflows → Account forms: uses forms (evidence: `accounts/views.py`)
- Account workflows → Django authentication: authenticates users (evidence: `accounts/views.py`)
- Account workflows → Visitor profiles: creates profile (evidence: `accounts/views.py`)
- Portal visitor → Geoportal routes: opens portal
- Geoportal routes → Portal and API views: routes requests (evidence: `geoportal/urls.py`)
- Portal and API views → Stations and geography: queries stations (evidence: `geoportal/views.py`)
- Portal and API views → Stations and geography: queries areas (evidence: `geoportal/views.py`)
- Import/export admin → Stations and geography: manages records (evidence: `geoportal/admin.py`)
- Import/export admin → Station catalogs: manages catalogs (evidence: `geoportal/admin.py`)
- Import/export admin → Import-export package: uses package (evidence: `geoportal/admin.py`)
