# adamdkr/projet-1-edl architecture

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

- Interactive diagram: https://gitdiagram.com/adamdkr/projet-1-edl
- Repository: https://github.com/adamdkr/projet-1-edl

## Overview

Partage de frais is a Flask web application for tracking shared trip expenses and balances. A browser user can create accounts and trips, add members and shared expenses, then view balances and suggested repayments; the REST API exposes the same core operations. The graph separates request handling, business rules, persistence, and the web interface. The README documents major capabilities, while some implementation details (including templates, schema, and settlement call paths) were not sampled, so those links are omitted or marked unverified.

Main entry points: [`backend/app.py`](https://github.com/adamdkr/projet-1-edl/blob/main/backend/app.py) (Flask web app), [`backend/routes.py`](https://github.com/adamdkr/projet-1-edl/blob/main/backend/routes.py) (REST API), [`backend/services.py`](https://github.com/adamdkr/projet-1-edl/blob/main/backend/services.py) (Expense validation), [`backend/database.py`](https://github.com/adamdkr/projet-1-edl/blob/main/backend/database.py) (SQLite access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_web_ui["Web pages"]
  node_client_js["Client interactions<br/>[app.js]"]
end

subgraph group_requests["Request handling"]
  node_web_app["Flask web app<br/>[app.py]"]
  node_rest_api["REST API<br/>[routes.py]"]
end

subgraph group_domain["Expense domain"]
  node_trip_accounts["Trips and accounts<br/>[services.py]"]
  node_expense_rules["Expense validation<br/>[services.py]"]
  node_balances["Balance calculation<br/>[services.py]"]
  node_settlements["Repayment suggestions<br/>[services.py]"]
end

subgraph group_persistence["Persistence"]
  node_repository["SQL repository<br/>[repository.py]"]
  node_db_access["SQLite access<br/>[database.py]"]
  node_schema["Database schema<br/>[schema.sql]"]
end

node_user(("Browser user"))

node_user -->|"uses"| node_web_ui
node_web_app -->|"renders"| node_web_ui
node_web_app -->|"serves assets"| node_client_js
node_user -.->|"sends requests"| node_rest_api
node_web_app -->|"registers routes"| node_rest_api
node_web_app -->|"calls"| node_trip_accounts
node_web_app -->|"calls"| node_expense_rules
node_web_app -->|"calls"| node_balances
node_rest_api -->|"calls"| node_trip_accounts
node_rest_api -->|"calls"| node_expense_rules
node_rest_api -->|"opens transactions"| node_db_access
node_web_app -->|"opens transactions"| node_db_access
node_trip_accounts -->|"queries and writes"| node_repository
node_expense_rules -->|"writes expenses"| node_repository
node_balances -.->|"uses expense data"| node_expense_rules
node_db_access -->|"initializes from"| node_schema
node_repository -.->|"uses connection"| node_db_access
node_balances -.->|"feeds balances"| node_settlements

click node_web_ui "https://github.com/adamdkr/projet-1-edl/tree/main/frontend/templates"
click node_client_js "https://github.com/adamdkr/projet-1-edl/blob/main/frontend/static/js/app.js"
click node_web_app "https://github.com/adamdkr/projet-1-edl/blob/main/backend/app.py"
click node_rest_api "https://github.com/adamdkr/projet-1-edl/blob/main/backend/routes.py"
click node_trip_accounts "https://github.com/adamdkr/projet-1-edl/blob/main/backend/services.py"
click node_expense_rules "https://github.com/adamdkr/projet-1-edl/blob/main/backend/services.py"
click node_balances "https://github.com/adamdkr/projet-1-edl/blob/main/backend/services.py"
click node_settlements "https://github.com/adamdkr/projet-1-edl/blob/main/backend/services.py"
click node_repository "https://github.com/adamdkr/projet-1-edl/blob/main/backend/repository.py"
click node_db_access "https://github.com/adamdkr/projet-1-edl/blob/main/backend/database.py"
click node_schema "https://github.com/adamdkr/projet-1-edl/blob/main/db/schema.sql"

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_web_ui,node_client_js,node_user toneBlue
class node_web_app,node_rest_api toneAmber
class node_trip_accounts,node_expense_rules,node_balances,node_settlements toneMint
class node_repository,node_db_access,node_schema toneRose
```

## Components

### Web interface

- [Web pages](https://github.com/adamdkr/projet-1-edl/tree/main/frontend/templates): `frontend/templates`
- [Client interactions](https://github.com/adamdkr/projet-1-edl/blob/main/frontend/static/js/app.js): `frontend/static/js/app.js`

### Request handling

- [Flask web app](https://github.com/adamdkr/projet-1-edl/blob/main/backend/app.py): `backend/app.py`
- [REST API](https://github.com/adamdkr/projet-1-edl/blob/main/backend/routes.py): `backend/routes.py`

### Expense domain

- [Trips and accounts](https://github.com/adamdkr/projet-1-edl/blob/main/backend/services.py): `backend/services.py`
- [Expense validation](https://github.com/adamdkr/projet-1-edl/blob/main/backend/services.py): `backend/services.py`
- [Balance calculation](https://github.com/adamdkr/projet-1-edl/blob/main/backend/services.py): `backend/services.py`
- [Repayment suggestions](https://github.com/adamdkr/projet-1-edl/blob/main/backend/services.py): `backend/services.py`

### Persistence

- [SQL repository](https://github.com/adamdkr/projet-1-edl/blob/main/backend/repository.py): `backend/repository.py`
- [SQLite access](https://github.com/adamdkr/projet-1-edl/blob/main/backend/database.py): `backend/database.py`
- [Database schema](https://github.com/adamdkr/projet-1-edl/blob/main/db/schema.sql): `db/schema.sql`

### Other components

- **Browser user**

## Connections

- Browser user → Web pages: uses (evidence: `README.md`)
- Flask web app → Web pages: renders (evidence: `backend/app.py`)
- Flask web app → Client interactions: serves assets (evidence: `backend/app.py`)
- Browser user → REST API: sends requests
- Flask web app → REST API: registers routes (evidence: `backend/app.py`)
- Flask web app → Trips and accounts: calls (evidence: `backend/app.py`)
- Flask web app → Expense validation: calls (evidence: `backend/app.py`)
- Flask web app → Balance calculation: calls (evidence: `backend/app.py`)
- REST API → Trips and accounts: calls (evidence: `backend/routes.py`)
- REST API → Expense validation: calls (evidence: `backend/routes.py`)
- REST API → SQLite access: opens transactions (evidence: `backend/routes.py`)
- Flask web app → SQLite access: opens transactions (evidence: `backend/app.py`)
- Trips and accounts → SQL repository: queries and writes (evidence: `backend/services.py`)
- Expense validation → SQL repository: writes expenses (evidence: `backend/services.py`)
- Balance calculation → Expense validation: uses expense data (evidence: `backend/services.py`)
- SQLite access → Database schema: initializes from (evidence: `backend/database.py`)
- SQL repository → SQLite access: uses connection
- Balance calculation → Repayment suggestions: feeds balances (evidence: `backend/services.py`)
