# mokhib/acciroute architecture

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

## Overview

AcciRoute IDF is a Shiny decision-support dashboard for analyzing road accidents in Île-de-France from 2016–2024. The documented workflow loads a consolidated accident dataset, presents an interactive interface, and updates analyses and visualizations; users can also regenerate the dataset from annual BAAC tables. The README documents data cleaning and merging, INSEE cross-referencing, K-Means analysis, and dynamic plotting. Source excerpts were unavailable, so relationships below rely only on the README; undocumented runtime details are omitted.

Main entry points: [`global.R`](https://github.com/mokhib/acciroute/blob/main/global.R) (App entry point), [`R/fonctions_data.R`](https://github.com/mokhib/acciroute/blob/main/R/fonctions_data.R) (Data preparation), [`ui.R`](https://github.com/mokhib/acciroute/blob/main/ui.R) (Dashboard interface), [`server.R`](https://github.com/mokhib/acciroute/blob/main/server.R) (Reactive server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Shiny application"]
  node_global["App entry point<br/>[global.R]"]
  node_ui["Dashboard interface<br/>[ui.R]"]
  node_server["Reactive server<br/>[server.R]"]
end

subgraph group_data["Accident data"]
  node_annual["Annual BAAC tables"]
  node_insee[("INSEE data")]
  node_data_functions["Data preparation<br/>[fonctions_data.R]"]
  node_master[("Consolidated accidents")]
end

subgraph group_analysis["Analysis and visuals"]
  node_models["K-Means analysis<br/>[fonctions_model.R]"]
  node_plots["Dynamic visualizations<br/>[fonctions_plots.R]"]
end

node_user(("Decision-maker"))

node_user -->|"uses dashboard"| node_ui
node_global -->|"loads dataset"| node_master
node_global -->|"calls data functions"| node_data_functions
node_data_functions -->|"merges annual tables"| node_annual
node_data_functions -->|"cross-references"| node_insee
node_data_functions -->|"builds dataset"| node_master
node_ui -->|"pairs with"| node_server
node_server -->|"updates graphs"| node_plots
node_global -->|"calls analysis functions"| node_models
node_global -->|"calls plotting functions"| node_plots

click node_global "https://github.com/mokhib/acciroute/blob/main/global.R"
click node_ui "https://github.com/mokhib/acciroute/blob/main/ui.R"
click node_server "https://github.com/mokhib/acciroute/blob/main/server.R"
click node_annual "https://github.com/mokhib/acciroute/tree/main/data/brutes"
click node_data_functions "https://github.com/mokhib/acciroute/blob/main/R/fonctions_data.R"
click node_master "https://github.com/mokhib/acciroute/blob/main/data/trait%C3%A9/base_accidents_IDF_2016_2024.rds"
click node_models "https://github.com/mokhib/acciroute/blob/main/R/fonctions_model.R"
click node_plots "https://github.com/mokhib/acciroute/blob/main/R/fonctions_plots.R"

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_global,node_ui,node_server toneBlue
class node_annual,node_insee,node_data_functions,node_master toneAmber
class node_models,node_plots toneMint
class node_user toneIndigo
```

## Components

### Shiny application

- [App entry point](https://github.com/mokhib/acciroute/blob/main/global.R): `global.R`
- [Dashboard interface](https://github.com/mokhib/acciroute/blob/main/ui.R): `ui.R`
- [Reactive server](https://github.com/mokhib/acciroute/blob/main/server.R): `server.R`

### Accident data

- [Annual BAAC tables](https://github.com/mokhib/acciroute/tree/main/data/brutes): `data/brutes`
- **INSEE data**
- [Data preparation](https://github.com/mokhib/acciroute/blob/main/R/fonctions_data.R): `R/fonctions_data.R`
- [Consolidated accidents](https://github.com/mokhib/acciroute/blob/main/data/trait%C3%A9/base_accidents_IDF_2016_2024.rds): `data/traité/base_accidents_IDF_2016_2024.rds`

### Analysis and visuals

- [K-Means analysis](https://github.com/mokhib/acciroute/blob/main/R/fonctions_model.R): `R/fonctions_model.R`
- [Dynamic visualizations](https://github.com/mokhib/acciroute/blob/main/R/fonctions_plots.R): `R/fonctions_plots.R`

### Other components

- **Decision-maker**

## Connections

- Decision-maker → Dashboard interface: uses dashboard (evidence: `README.md`)
- App entry point → Consolidated accidents: loads dataset (evidence: `README.md`)
- App entry point → Data preparation: calls data functions (evidence: `README.md`)
- Data preparation → Annual BAAC tables: merges annual tables (evidence: `README.md`)
- Data preparation → INSEE data: cross-references (evidence: `README.md`)
- Data preparation → Consolidated accidents: builds dataset (evidence: `README.md`)
- Dashboard interface → Reactive server: pairs with (evidence: `README.md`)
- Reactive server → Dynamic visualizations: updates graphs (evidence: `README.md`)
- App entry point → K-Means analysis: calls analysis functions (evidence: `README.md`)
- App entry point → Dynamic visualizations: calls plotting functions (evidence: `README.md`)
