# rohitk-18/devsplit architecture

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

- Interactive diagram: https://gitdiagram.com/rohitk-18/devsplit
- Repository: https://github.com/rohitk-18/devsplit

## Overview

DevSplit is a no-signup group expense splitter. Participants create and join trips through shareable links, record expenses and equal splits, then view calculated settlements. Flask routes coordinate these stages and persist trip, participant, expense, and split records; a settlement helper derives balances from those records. The README documents persistent browser sessions, trip expiry, and PostgreSQL/SQLite support. Some route and template details were not sampled, so undocumented wiring is omitted.

Main entry points: [`routes.py`](https://github.com/rohitk-18/devsplit/blob/main/routes.py) (Trip creation and joining), [`app.py`](https://github.com/rohitk-18/devsplit/blob/main/app.py) (Flask application), [`models.py`](https://github.com/rohitk-18/devsplit/blob/main/models.py) (Trip and expense records), [`utils.py`](https://github.com/rohitk-18/devsplit/blob/main/utils.py) (Settlement algorithm)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Participant experience"]
  node_trip_dashboard["Trip dashboard<br/>[trip.html]"]
  node_join_page["Join page<br/>[join.html]"]
  node_home_page["Trip creation page<br/>[index.html]"]
  node_browser_helpers["Browser interactions<br/>[main.js]"]
  node_responsive_styles["Responsive styling<br/>[style.css]"]
end

subgraph group_workflow["Trip and expense workflow"]
  node_webapp["Flask application<br/>[app.py]"]
  node_trip_flow["Trip creation and joining<br/>[routes.py]"]
  node_session_identity["Persistent trip sessions<br/>[routes.py]"]
  node_expense_flow["Expense management<br/>[routes.py]"]
end

subgraph group_calculation["Settlement calculation"]
  node_settlement_calculator["Settlement algorithm<br/>[utils.py]"]
end

subgraph group_persistence["Persistence"]
  node_domain_models["Trip and expense records<br/>[models.py]"]
  node_relational_database[("SQL database")]
end

node_participant(("Trip participant"))

node_participant -->|"uses trip app"| node_webapp
node_webapp -->|"registers routes"| node_trip_flow
node_webapp -->|"initializes ORM"| node_domain_models
node_webapp -->|"configures database"| node_relational_database
node_trip_flow -->|"creates trips"| node_domain_models
node_trip_flow -->|"recognizes participants"| node_session_identity
node_participant -->|"joins by link"| node_trip_flow
node_participant -->|"records expenses"| node_expense_flow
node_expense_flow -->|"saves expense splits"| node_domain_models
node_trip_flow -->|"renders dashboard"| node_trip_dashboard
node_trip_flow -->|"renders join form"| node_join_page
node_participant -->|"starts trip"| node_home_page
node_webapp -.->|"serves interface"| node_home_page
node_trip_flow -->|"calculates settlements"| node_settlement_calculator
node_settlement_calculator -->|"queries balances"| node_domain_models
node_domain_models -->|"stores records"| node_relational_database
node_participant -.->|"uses trip controls"| node_browser_helpers
node_participant -->|"views responsive pages"| node_responsive_styles

click node_webapp "https://github.com/rohitk-18/devsplit/blob/main/app.py"
click node_trip_flow "https://github.com/rohitk-18/devsplit/blob/main/routes.py"
click node_session_identity "https://github.com/rohitk-18/devsplit/blob/main/routes.py"
click node_expense_flow "https://github.com/rohitk-18/devsplit/blob/main/routes.py"
click node_trip_dashboard "https://github.com/rohitk-18/devsplit/blob/main/templates/trip.html"
click node_join_page "https://github.com/rohitk-18/devsplit/blob/main/templates/join.html"
click node_home_page "https://github.com/rohitk-18/devsplit/blob/main/templates/index.html"
click node_browser_helpers "https://github.com/rohitk-18/devsplit/blob/main/static/js/main.js"
click node_responsive_styles "https://github.com/rohitk-18/devsplit/blob/main/static/css/style.css"
click node_settlement_calculator "https://github.com/rohitk-18/devsplit/blob/main/utils.py"
click node_domain_models "https://github.com/rohitk-18/devsplit/blob/main/models.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_trip_dashboard,node_join_page,node_home_page,node_browser_helpers,node_responsive_styles toneBlue
class node_webapp,node_trip_flow,node_session_identity,node_expense_flow toneAmber
class node_settlement_calculator toneMint
class node_domain_models,node_relational_database toneRose
class node_participant toneIndigo
```

## Components

### Participant experience

- [Trip dashboard](https://github.com/rohitk-18/devsplit/blob/main/templates/trip.html): `templates/trip.html`
- [Join page](https://github.com/rohitk-18/devsplit/blob/main/templates/join.html): `templates/join.html`
- [Trip creation page](https://github.com/rohitk-18/devsplit/blob/main/templates/index.html): `templates/index.html`
- [Browser interactions](https://github.com/rohitk-18/devsplit/blob/main/static/js/main.js): `static/js/main.js`
- [Responsive styling](https://github.com/rohitk-18/devsplit/blob/main/static/css/style.css): `static/css/style.css`

### Trip and expense workflow

- [Flask application](https://github.com/rohitk-18/devsplit/blob/main/app.py): `app.py`
- [Trip creation and joining](https://github.com/rohitk-18/devsplit/blob/main/routes.py): `routes.py`
- [Persistent trip sessions](https://github.com/rohitk-18/devsplit/blob/main/routes.py): `routes.py`
- [Expense management](https://github.com/rohitk-18/devsplit/blob/main/routes.py): `routes.py`

### Settlement calculation

- [Settlement algorithm](https://github.com/rohitk-18/devsplit/blob/main/utils.py): `utils.py`

### Persistence

- [Trip and expense records](https://github.com/rohitk-18/devsplit/blob/main/models.py): `models.py`
- **SQL database**

### Other components

- **Trip participant**

## Connections

- Trip participant → Flask application: uses trip app (evidence: `README.md`)
- Flask application → Trip creation and joining: registers routes (evidence: `app.py`)
- Flask application → Trip and expense records: initializes ORM (evidence: `app.py`)
- Flask application → SQL database: configures database (evidence: `app.py`)
- Trip creation and joining → Trip and expense records: creates trips (evidence: `routes.py`)
- Trip creation and joining → Persistent trip sessions: recognizes participants (evidence: `routes.py`)
- Trip participant → Trip creation and joining: joins by link (evidence: `README.md`)
- Trip participant → Expense management: records expenses (evidence: `README.md`)
- Expense management → Trip and expense records: saves expense splits (evidence: `routes.py`)
- Trip creation and joining → Trip dashboard: renders dashboard (evidence: `routes.py`)
- Trip creation and joining → Join page: renders join form (evidence: `routes.py`)
- Trip participant → Trip creation page: starts trip (evidence: `README.md`)
- Flask application → Trip creation page: serves interface
- Trip creation and joining → Settlement algorithm: calculates settlements (evidence: `routes.py`)
- Settlement algorithm → Trip and expense records: queries balances (evidence: `utils.py`)
- Trip and expense records → SQL database: stores records
- Trip participant → Browser interactions: uses trip controls
- Trip participant → Responsive styling: views responsive pages (evidence: `README.md`)
