# datanfr/datan architecture

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

- Interactive diagram: https://gitdiagram.com/datanfr/datan
- Repository: https://github.com/datanfr/datan

## Overview

Datan is a public website for exploring and understanding French MPs’ voting behaviour. A visitor follows pages for MPs, groups and votes; the product also exposes election results, search, rankings and civic information, with authenticated dashboards and API endpoints as supporting capabilities. The file tree identifies the application’s MVC areas, while sampled framework code shows the request bootstrap and routing layers. Most application controller-to-model and controller-to-view calls were not excerpted, so those links are marked unverified rather than asserted as observed.

Main entry points: [`application/controllers`](https://github.com/datanfr/datan/tree/master/application/controllers) (Page controllers), [`application/controllers/Groupes.php`](https://github.com/datanfr/datan/blob/master/application/controllers/Groupes.php) (Group analysis), [`application/controllers/Votes.php`](https://github.com/datanfr/datan/blob/master/application/controllers/Votes.php) (Vote analysis), [`application/core/Auth_Controller.php`](https://github.com/datanfr/datan/blob/master/application/core/Auth_Controller.php) (Authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_analysis["Parliament analysis"]
  node_controllers["Page controllers"]
  node_mp["MP profiles<br/>[Deputes.php]"]
  node_groups["Group analysis<br/>[Groupes.php]"]
  node_votes["Vote analysis<br/>[Votes.php]"]
  node_vote_data[("Vote data<br/>[Votes_model.php]")]
  node_rankings["Rankings<br/>[index.php]"]
  node_search["Cross-site search<br/>[Search.php]"]
  node_search_data[("Search queries<br/>[Search_model.php]")]
  node_public_views["Public pages"]
end

subgraph group_elections["Elections and geography"]
  node_election_pages["Election results<br/>[Elections.php]"]
  node_election_data[("Election records")]
  node_places["Place browsing<br/>[Departement.php]"]
end

subgraph group_access["Accounts and access"]
  node_auth["Authentication"]
  node_accounts["Account pages<br/>[Users.php]"]
  node_dashboard["Admin dashboard<br/>[Admin.php]"]
  node_api["Votes API<br/>[Votes.php]"]
end

subgraph group_framework["CodeIgniter runtime"]
  node_front["HTTP entry<br/>[index.php]"]
  node_bootstrap["Runtime bootstrap<br/>[CodeIgniter.php]"]
  node_router["URI router<br/>[Router.php]"]
  node_session["Session handling<br/>[Session.php]"]
  node_session_store[("Session database driver")]
end

node_visitor(("Website visitor"))
node_database[("Application database")]

node_visitor -->|"requests page"| node_front
node_front -->|"starts runtime"| node_bootstrap
node_bootstrap -->|"loads router"| node_router
node_router -.->|"resolves route"| node_controllers
node_controllers -.->|"dispatches MP pages"| node_mp
node_controllers -.->|"dispatches group pages"| node_groups
node_controllers -.->|"dispatches vote pages"| node_votes
node_groups -.->|"queries votes"| node_vote_data
node_votes -.->|"queries votes"| node_vote_data
node_groups -.->|"renders rankings"| node_rankings
node_mp -.->|"renders profiles"| node_public_views
node_votes -.->|"renders vote pages"| node_public_views
node_search -.->|"runs search"| node_search_data
node_search_data -.->|"reads records"| node_database
node_election_pages -.->|"loads results"| node_election_data
node_places -.->|"loads local results"| node_election_data
node_auth -->|"loads session"| node_session
node_accounts -.->|"uses auth base"| node_auth
node_dashboard -.->|"uses auth base"| node_auth
node_api -.->|"serves vote data"| node_database
node_session -->|"selects driver"| node_session_store
node_session_store -->|"reads and writes"| node_database

click node_front "https://github.com/datanfr/datan/blob/master/index.php"
click node_bootstrap "https://github.com/datanfr/datan/blob/master/system/core/CodeIgniter.php"
click node_router "https://github.com/datanfr/datan/blob/master/system/core/Router.php"
click node_controllers "https://github.com/datanfr/datan/tree/master/application/controllers"
click node_mp "https://github.com/datanfr/datan/blob/master/application/controllers/Deputes.php"
click node_groups "https://github.com/datanfr/datan/blob/master/application/controllers/Groupes.php"
click node_votes "https://github.com/datanfr/datan/blob/master/application/controllers/Votes.php"
click node_vote_data "https://github.com/datanfr/datan/blob/master/application/models/Votes_model.php"
click node_rankings "https://github.com/datanfr/datan/blob/master/application/views/classements/index.php"
click node_search "https://github.com/datanfr/datan/blob/master/application/controllers/Search.php"
click node_search_data "https://github.com/datanfr/datan/blob/master/application/models/Search_model.php"
click node_election_pages "https://github.com/datanfr/datan/blob/master/application/controllers/Elections.php"
click node_election_data "https://github.com/datanfr/datan/blob/master/application/models/Elections_model.php"
click node_places "https://github.com/datanfr/datan/blob/master/application/controllers/Departement.php"
click node_public_views "https://github.com/datanfr/datan/tree/master/application/views"
click node_auth "https://github.com/datanfr/datan/blob/master/application/core/Auth_Controller.php"
click node_accounts "https://github.com/datanfr/datan/blob/master/application/controllers/Users.php"
click node_dashboard "https://github.com/datanfr/datan/blob/master/application/controllers/Admin.php"
click node_api "https://github.com/datanfr/datan/blob/master/application/controllers/api/Votes.php"
click node_session "https://github.com/datanfr/datan/blob/master/system/libraries/Session/Session.php"
click node_session_store "https://github.com/datanfr/datan/blob/master/system/libraries/Session/drivers/Session_database_driver.php"

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_controllers,node_mp,node_groups,node_votes,node_vote_data,node_rankings,node_search,node_search_data,node_public_views toneBlue
class node_election_pages,node_election_data,node_places,node_database toneAmber
class node_auth,node_accounts,node_dashboard,node_api toneMint
class node_front,node_bootstrap,node_router,node_session,node_session_store toneRose
class node_visitor toneIndigo
```

## Components

### Parliament analysis

- [Page controllers](https://github.com/datanfr/datan/tree/master/application/controllers): `application/controllers`
- [MP profiles](https://github.com/datanfr/datan/blob/master/application/controllers/Deputes.php): `application/controllers/Deputes.php`
- [Group analysis](https://github.com/datanfr/datan/blob/master/application/controllers/Groupes.php): `application/controllers/Groupes.php`
- [Vote analysis](https://github.com/datanfr/datan/blob/master/application/controllers/Votes.php): `application/controllers/Votes.php`
- [Vote data](https://github.com/datanfr/datan/blob/master/application/models/Votes_model.php): `application/models/Votes_model.php`
- [Rankings](https://github.com/datanfr/datan/blob/master/application/views/classements/index.php): `application/views/classements/index.php`
- [Cross-site search](https://github.com/datanfr/datan/blob/master/application/controllers/Search.php): `application/controllers/Search.php`
- [Search queries](https://github.com/datanfr/datan/blob/master/application/models/Search_model.php): `application/models/Search_model.php`
- [Public pages](https://github.com/datanfr/datan/tree/master/application/views): `application/views`

### Elections and geography

- [Election results](https://github.com/datanfr/datan/blob/master/application/controllers/Elections.php): `application/controllers/Elections.php`
- [Election records](https://github.com/datanfr/datan/blob/master/application/models/Elections_model.php): `application/models/Elections_model.php`
- [Place browsing](https://github.com/datanfr/datan/blob/master/application/controllers/Departement.php): `application/controllers/Departement.php`

### Accounts and access

- [Authentication](https://github.com/datanfr/datan/blob/master/application/core/Auth_Controller.php): `application/core/Auth_Controller.php`
- [Account pages](https://github.com/datanfr/datan/blob/master/application/controllers/Users.php): `application/controllers/Users.php`
- [Admin dashboard](https://github.com/datanfr/datan/blob/master/application/controllers/Admin.php): `application/controllers/Admin.php`
- [Votes API](https://github.com/datanfr/datan/blob/master/application/controllers/api/Votes.php): `application/controllers/api/Votes.php`

### CodeIgniter runtime

- [HTTP entry](https://github.com/datanfr/datan/blob/master/index.php): `index.php`
- [Runtime bootstrap](https://github.com/datanfr/datan/blob/master/system/core/CodeIgniter.php): `system/core/CodeIgniter.php`
- [URI router](https://github.com/datanfr/datan/blob/master/system/core/Router.php): `system/core/Router.php`
- [Session handling](https://github.com/datanfr/datan/blob/master/system/libraries/Session/Session.php): `system/libraries/Session/Session.php`
- [Session database driver](https://github.com/datanfr/datan/blob/master/system/libraries/Session/drivers/Session_database_driver.php): `system/libraries/Session/drivers/Session_database_driver.php`

### Other components

- **Website visitor**
- **Application database**

## Connections

- Website visitor → HTTP entry: requests page
- HTTP entry → Runtime bootstrap: starts runtime (evidence: `index.php`)
- Runtime bootstrap → URI router: loads router (evidence: `system/core/CodeIgniter.php`)
- URI router → Page controllers: resolves route
- Page controllers → MP profiles: dispatches MP pages
- Page controllers → Group analysis: dispatches group pages
- Page controllers → Vote analysis: dispatches vote pages
- Group analysis → Vote data: queries votes
- Vote analysis → Vote data: queries votes
- Group analysis → Rankings: renders rankings
- MP profiles → Public pages: renders profiles
- Vote analysis → Public pages: renders vote pages
- Cross-site search → Search queries: runs search
- Search queries → Application database: reads records
- Election results → Election records: loads results
- Place browsing → Election records: loads local results
- Authentication → Session handling: loads session (evidence: `application/core/Auth_Controller.php`)
- Account pages → Authentication: uses auth base
- Admin dashboard → Authentication: uses auth base
- Votes API → Application database: serves vote data
- Session handling → Session database driver: selects driver (evidence: `system/libraries/Session/Session.php`)
- Session database driver → Application database: reads and writes (evidence: `system/libraries/Session/drivers/Session_database_driver.php`)
