# martinerwan/property_purchase architecture

> Architecture diagram of the GitHub repository martinerwan/property_purchase, 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/martinerwan/property_purchase
- Repository: https://github.com/martinerwan/property_purchase

## Overview

The repository combines a reproducible Île-de-France housing-data pipeline with a developing PWA for exploring neighborhoods, affordability, and commute times. The documented pipeline gathers and transforms DVF sales, transit, income, and QPV data, then exports map and app datasets. In the app, users load those datasets, filter and color IRIS areas, inspect neighborhood details, and compare travel times; optional account features synchronize preferences. Edges between pipeline stages reflect the README’s documented sequence. Some app modules were not sampled, so uncertain internal connections are omitted.

Main entry points: [`app/src/App.tsx`](https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/app/src/App.tsx) (PWA application), [`app/src/carte/useSynchroCarte.ts`](https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/app/src/carte/useSynchroCarte.ts) (Map synchronization), [`app/src/panneaux`](https://github.com/martinerwan/property_purchase/tree/claude/new-session-42buis/app/src/panneaux) (Map and filter panels), [`app/src/compte/useSynchroCompte.ts`](https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/app/src/compte/useSynchroCompte.ts) (Preference sync)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_pipeline["Data pipeline"]
  node_dvf_download["Download DVF<br/>[01_download_dvf.py]"]
  node_dvf_clean["Clean sales<br/>[02_clean_dvf.py]"]
  node_transit_download["Download transit"]
  node_transit_build["Build transit"]
  node_socio_download["Download socio data"]
  node_iris_build["Build IRIS and QPV"]
  node_iris_metrics["IRIS indicators"]
  node_journeys["Journey matrices<br/>[08_temps_trajet.py]"]
  node_gis_export["GIS exports<br/>[09_export_carte.py]"]
  node_html_map["Interactive HTML map<br/>[10_carte_html.py]"]
  node_app_export["App data export<br/>[11_export_app.py]"]
  node_quality["App data checks<br/>[12_controle_app.py]"]
end

subgraph group_appdata["App data"]
  node_loader["Data loader<br/>[chargement.ts]"]
  node_resources[("Shared resources<br/>[store.ts]")]
  node_state[("App state<br/>[etat.ts]")]
end

subgraph group_maplogic["Map and analysis"]
  node_map["Map rendering<br/>[couches.ts]"]
  node_map_sync["Map synchronization<br/>[useSynchroCarte.ts]"]
  node_travel["Travel-time analysis<br/>[trajet.ts]"]
  node_selection["Neighborhood filters<br/>[selection.ts]"]
  node_finance["Financing estimates<br/>[financement.ts]"]
end

subgraph group_interface["User interface"]
  node_app["PWA application<br/>[App.tsx]"]
  node_panels["Map and filter panels"]
  node_details["Neighborhood details<br/>[FicheQuartier.tsx]"]
end

subgraph group_accounts["Accounts"]
  node_account_panel["Account panel<br/>[PanneauCompte.tsx]"]
  node_account_sync["Preference sync"]
end

node_sources(("Data providers"))
node_supabase[("Supabase")]

node_sources -->|"provides sales"| node_dvf_download
node_sources -->|"provides transit"| node_transit_download
node_sources -->|"provides socio data"| node_socio_download
node_dvf_download -->|"cleans sales"| node_dvf_clean
node_dvf_clean -->|"next pipeline step"| node_transit_download
node_transit_download -->|"builds transit"| node_transit_build
node_transit_build -->|"next pipeline step"| node_socio_download
node_socio_download -->|"builds geography"| node_iris_build
node_iris_build -->|"adds indicators"| node_iris_metrics
node_iris_metrics -->|"next pipeline step"| node_journeys
node_journeys -->|"exports layers"| node_gis_export
node_gis_export -->|"builds HTML map"| node_html_map
node_html_map -->|"exports app data"| node_app_export
node_app_export -->|"checks publication"| node_quality
node_app -->|"loads datasets"| node_loader
node_loader -->|"returns data"| node_resources
node_app -->|"initializes state"| node_state
node_app -->|"synchronizes map"| node_map_sync
node_map_sync -->|"updates layers"| node_map
node_map_sync -->|"computes journeys"| node_travel
node_map_sync -->|"builds filters"| node_selection
node_map_sync -->|"calculates budgets"| node_finance
node_app -->|"shows panels"| node_panels
node_app -->|"shows selected IRIS"| node_details
node_panels -->|"configures filters"| node_selection
node_panels -->|"edits financing"| node_finance
node_account_panel -.->|"uses account features"| node_account_sync
node_account_sync -->|"reads and writes"| node_supabase
node_account_sync -->|"syncs profile"| node_state

click node_dvf_download "https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/scripts/01_download_dvf.py"
click node_dvf_clean "https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/scripts/02_clean_dvf.py"
click node_transit_download "https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/scripts/03_download_transports.py"
click node_transit_build "https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/scripts/04_build_transports.py"
click node_socio_download "https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/scripts/05_download_socio.py"
click node_iris_build "https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/scripts/06_build_iris_qpv.py"
click node_iris_metrics "https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/scripts/07_indicateurs_iris.py"
click node_journeys "https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/scripts/08_temps_trajet.py"
click node_gis_export "https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/scripts/09_export_carte.py"
click node_html_map "https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/scripts/10_carte_html.py"
click node_app_export "https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/scripts/11_export_app.py"
click node_quality "https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/scripts/12_controle_app.py"
click node_app "https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/app/src/App.tsx"
click node_loader "https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/app/src/donnees/chargement.ts"
click node_resources "https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/app/src/donnees/store.ts"
click node_map "https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/app/src/carte/couches.ts"
click node_map_sync "https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/app/src/carte/useSynchroCarte.ts"
click node_travel "https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/app/src/logique/trajet.ts"
click node_selection "https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/app/src/logique/selection.ts"
click node_finance "https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/app/src/logique/financement.ts"
click node_state "https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/app/src/etat.ts"
click node_panels "https://github.com/martinerwan/property_purchase/tree/claude/new-session-42buis/app/src/panneaux"
click node_details "https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/app/src/panneaux/FicheQuartier.tsx"
click node_account_panel "https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/app/src/panneaux/PanneauCompte.tsx"
click node_account_sync "https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/app/src/compte/useSynchroCompte.ts"

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_dvf_download,node_dvf_clean,node_transit_download,node_transit_build,node_socio_download,node_iris_build,node_iris_metrics,node_journeys,node_gis_export,node_html_map,node_app_export,node_quality toneBlue
class node_loader,node_resources,node_state,node_supabase toneAmber
class node_map,node_map_sync,node_travel,node_selection,node_finance toneMint
class node_app,node_panels,node_details toneRose
class node_account_panel,node_account_sync,node_sources toneIndigo
```

## Components

### Data pipeline

- [Download DVF](https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/scripts/01_download_dvf.py): `scripts/01_download_dvf.py`
- [Clean sales](https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/scripts/02_clean_dvf.py): `scripts/02_clean_dvf.py`
- [Download transit](https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/scripts/03_download_transports.py): `scripts/03_download_transports.py`
- [Build transit](https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/scripts/04_build_transports.py): `scripts/04_build_transports.py`
- [Download socio data](https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/scripts/05_download_socio.py): `scripts/05_download_socio.py`
- [Build IRIS and QPV](https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/scripts/06_build_iris_qpv.py): `scripts/06_build_iris_qpv.py`
- [IRIS indicators](https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/scripts/07_indicateurs_iris.py): `scripts/07_indicateurs_iris.py`
- [Journey matrices](https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/scripts/08_temps_trajet.py): `scripts/08_temps_trajet.py`
- [GIS exports](https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/scripts/09_export_carte.py): `scripts/09_export_carte.py`
- [Interactive HTML map](https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/scripts/10_carte_html.py): `scripts/10_carte_html.py`
- [App data export](https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/scripts/11_export_app.py): `scripts/11_export_app.py`
- [App data checks](https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/scripts/12_controle_app.py): `scripts/12_controle_app.py`

### App data

- [Data loader](https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/app/src/donnees/chargement.ts): `app/src/donnees/chargement.ts`
- [Shared resources](https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/app/src/donnees/store.ts): `app/src/donnees/store.ts`
- [App state](https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/app/src/etat.ts): `app/src/etat.ts`

### Map and analysis

- [Map rendering](https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/app/src/carte/couches.ts): `app/src/carte/couches.ts`
- [Map synchronization](https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/app/src/carte/useSynchroCarte.ts): `app/src/carte/useSynchroCarte.ts`
- [Travel-time analysis](https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/app/src/logique/trajet.ts): `app/src/logique/trajet.ts`
- [Neighborhood filters](https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/app/src/logique/selection.ts): `app/src/logique/selection.ts`
- [Financing estimates](https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/app/src/logique/financement.ts): `app/src/logique/financement.ts`

### User interface

- [PWA application](https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/app/src/App.tsx): `app/src/App.tsx`
- [Map and filter panels](https://github.com/martinerwan/property_purchase/tree/claude/new-session-42buis/app/src/panneaux): `app/src/panneaux`
- [Neighborhood details](https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/app/src/panneaux/FicheQuartier.tsx): `app/src/panneaux/FicheQuartier.tsx`

### Accounts

- [Account panel](https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/app/src/panneaux/PanneauCompte.tsx): `app/src/panneaux/PanneauCompte.tsx`
- [Preference sync](https://github.com/martinerwan/property_purchase/blob/claude/new-session-42buis/app/src/compte/useSynchroCompte.ts): `app/src/compte/useSynchroCompte.ts`

### Other components

- **Data providers**
- **Supabase**

## Connections

- Data providers → Download DVF: provides sales (evidence: `README.md`)
- Data providers → Download transit: provides transit (evidence: `README.md`)
- Data providers → Download socio data: provides socio data (evidence: `README.md`)
- Download DVF → Clean sales: cleans sales (evidence: `README.md`)
- Clean sales → Download transit: next pipeline step (evidence: `README.md`)
- Download transit → Build transit: builds transit (evidence: `README.md`)
- Build transit → Download socio data: next pipeline step (evidence: `README.md`)
- Download socio data → Build IRIS and QPV: builds geography (evidence: `README.md`)
- Build IRIS and QPV → IRIS indicators: adds indicators (evidence: `README.md`)
- IRIS indicators → Journey matrices: next pipeline step (evidence: `README.md`)
- Journey matrices → GIS exports: exports layers (evidence: `README.md`)
- GIS exports → Interactive HTML map: builds HTML map (evidence: `README.md`)
- Interactive HTML map → App data export: exports app data (evidence: `README.md`)
- App data export → App data checks: checks publication (evidence: `README.md`)
- PWA application → Data loader: loads datasets (evidence: `app/src/App.tsx`)
- Data loader → Shared resources: returns data (evidence: `app/src/App.tsx`)
- PWA application → App state: initializes state (evidence: `app/src/App.tsx`)
- PWA application → Map synchronization: synchronizes map (evidence: `app/src/App.tsx`)
- Map synchronization → Map rendering: updates layers (evidence: `app/src/carte/useSynchroCarte.ts`)
- Map synchronization → Travel-time analysis: computes journeys (evidence: `app/src/carte/useSynchroCarte.ts`)
- Map synchronization → Neighborhood filters: builds filters (evidence: `app/src/carte/useSynchroCarte.ts`)
- Map synchronization → Financing estimates: calculates budgets (evidence: `app/src/carte/useSynchroCarte.ts`)
- PWA application → Map and filter panels: shows panels (evidence: `app/src/App.tsx`)
- PWA application → Neighborhood details: shows selected IRIS (evidence: `app/src/App.tsx`)
- Map and filter panels → Neighborhood filters: configures filters (evidence: `app/src/panneaux/PanneauFiltres.tsx`)
- Map and filter panels → Financing estimates: edits financing (evidence: `app/src/panneaux/PanneauFinancement.tsx`)
- Account panel → Preference sync: uses account features
- Preference sync → Supabase: reads and writes (evidence: `app/src/compte/useSynchroCompte.ts`)
- Preference sync → App state: syncs profile (evidence: `app/src/compte/useSynchroCompte.ts`)
