# pgh2005/tripsync architecture

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

## Overview

TripSync is a Flutter travel-collaboration app. A user authenticates, creates or joins a trip, then collaborates through trip maps and shared expenses; the app also calculates balances. The graph preserves the README’s documented profile, Persian-date, marker-media, and Supabase capabilities. Source excerpts cover only platform scaffolding, so feature-level relationships below are based on README statements rather than inspected feature implementations.

Main entry points: [`lib/features/trip/presentation/screens`](https://github.com/pgh2005/tripsync/tree/main/lib/features/trip/presentation/screens) (Trip screens), [`lib/features/trip_map/data/repositories/trip_map_repository.dart`](https://github.com/pgh2005/tripsync/blob/main/lib/features/trip_map/data/repositories/trip_map_repository.dart) (Map markers), [`lib/features/expenses/presentation/screens`](https://github.com/pgh2005/tripsync/tree/main/lib/features/expenses/presentation/screens) (Expense screens), [`lib/features/auth/data/services/auth_service.dart`](https://github.com/pgh2005/tripsync/blob/main/lib/features/auth/data/services/auth_service.dart) (Authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity &amp; app shell"]
  node_auth["Authentication<br/>[auth_service.dart]"]
  node_profile["Profile"]
  node_router["App routing<br/>[app_router.dart]"]
end

subgraph group_trips["Trips &amp; collaboration"]
  node_trip_ui["Trip screens"]
  node_trip_service["Trip management<br/>[trip_service.dart]"]
  node_trip_data["Trip records<br/>[trip_model.dart]"]
  node_members["Trip membership"]
end

subgraph group_mapping["Maps &amp; media"]
  node_map_ui["Trip map"]
  node_markers["Map markers"]
  node_media["Marker media"]
end

subgraph group_finances["Shared finances"]
  node_expenses_ui["Expense screens"]
  node_expense_repo["Expense records"]
  node_splits["Expense splits"]
  node_balance_ui["Balance overview"]
  node_calculator["Balance calculator"]
end

subgraph group_shared["Shared services"]
  node_persian_dates["Persian date picker"]
end

node_traveler(("Traveler"))
node_supabase[("Supabase backend")]

node_traveler -->|"authenticates"| node_auth
node_traveler -->|"manages trips"| node_trip_ui
node_traveler -->|"shares locations"| node_map_ui
node_traveler -->|"tracks costs"| node_expenses_ui
node_auth -->|"uses authentication"| node_supabase
node_profile -->|"uses backend"| node_supabase
node_trip_ui -->|"creates or joins"| node_trip_service
node_trip_service -->|"stores trip data"| node_supabase
node_trip_ui -->|"offers date selection"| node_persian_dates
node_map_ui -->|"manages markers"| node_markers
node_markers -->|"attaches media"| node_media
node_markers -->|"uses backend storage"| node_supabase
node_expenses_ui -->|"manages expenses"| node_expense_repo
node_expense_repo -->|"supports splitting"| node_splits
node_expenses_ui -->|"uses backend"| node_supabase
node_balance_ui -->|"shows calculations"| node_calculator

click node_auth "https://github.com/pgh2005/tripsync/blob/main/lib/features/auth/data/services/auth_service.dart"
click node_profile "https://github.com/pgh2005/tripsync/blob/main/lib/features/profile/presentation/profile_screen.dart"
click node_router "https://github.com/pgh2005/tripsync/blob/main/lib/core/router/app_router.dart"
click node_trip_ui "https://github.com/pgh2005/tripsync/tree/main/lib/features/trip/presentation/screens"
click node_trip_service "https://github.com/pgh2005/tripsync/blob/main/lib/features/trip/data/services/trip_service.dart"
click node_trip_data "https://github.com/pgh2005/tripsync/blob/main/lib/features/trip/data/models/trip_model.dart"
click node_members "https://github.com/pgh2005/tripsync/blob/main/lib/features/trip/data/models/trip_member_model.dart"
click node_map_ui "https://github.com/pgh2005/tripsync/blob/main/lib/features/trip_map/presentation/screens/trip_map_Screen.dart"
click node_markers "https://github.com/pgh2005/tripsync/blob/main/lib/features/trip_map/data/repositories/trip_map_repository.dart"
click node_media "https://github.com/pgh2005/tripsync/blob/main/lib/features/trip_map/data/services/marker_media_service.dart"
click node_expenses_ui "https://github.com/pgh2005/tripsync/tree/main/lib/features/expenses/presentation/screens"
click node_expense_repo "https://github.com/pgh2005/tripsync/blob/main/lib/features/expenses/data/repositories/expense_repository.dart"
click node_splits "https://github.com/pgh2005/tripsync/blob/main/lib/features/expenses/data/models/expense_split_model.dart"
click node_balance_ui "https://github.com/pgh2005/tripsync/blob/main/lib/features/balance_calculation/presentation/screens/balance_screen.dart"
click node_calculator "https://github.com/pgh2005/tripsync/blob/main/lib/features/balance_calculation/data/services/balance_calculator.dart"
click node_persian_dates "https://github.com/pgh2005/tripsync/blob/main/lib/features/trip/presentation/widget/date_picker/persian_date_picker_sheet.dart"

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_auth,node_profile,node_router toneBlue
class node_trip_ui,node_trip_service,node_trip_data,node_members,node_supabase toneAmber
class node_map_ui,node_markers,node_media toneMint
class node_expenses_ui,node_expense_repo,node_splits,node_balance_ui,node_calculator toneRose
class node_persian_dates,node_traveler toneIndigo
```

## Components

### Identity & app shell

- [Authentication](https://github.com/pgh2005/tripsync/blob/main/lib/features/auth/data/services/auth_service.dart): `lib/features/auth/data/services/auth_service.dart`
- [Profile](https://github.com/pgh2005/tripsync/blob/main/lib/features/profile/presentation/profile_screen.dart): `lib/features/profile/presentation/profile_screen.dart`
- [App routing](https://github.com/pgh2005/tripsync/blob/main/lib/core/router/app_router.dart): `lib/core/router/app_router.dart`

### Trips & collaboration

- [Trip screens](https://github.com/pgh2005/tripsync/tree/main/lib/features/trip/presentation/screens): `lib/features/trip/presentation/screens`
- [Trip management](https://github.com/pgh2005/tripsync/blob/main/lib/features/trip/data/services/trip_service.dart): `lib/features/trip/data/services/trip_service.dart`
- [Trip records](https://github.com/pgh2005/tripsync/blob/main/lib/features/trip/data/models/trip_model.dart): `lib/features/trip/data/models/trip_model.dart`
- [Trip membership](https://github.com/pgh2005/tripsync/blob/main/lib/features/trip/data/models/trip_member_model.dart): `lib/features/trip/data/models/trip_member_model.dart`

### Maps & media

- [Trip map](https://github.com/pgh2005/tripsync/blob/main/lib/features/trip_map/presentation/screens/trip_map_Screen.dart): `lib/features/trip_map/presentation/screens/trip_map_Screen.dart`
- [Map markers](https://github.com/pgh2005/tripsync/blob/main/lib/features/trip_map/data/repositories/trip_map_repository.dart): `lib/features/trip_map/data/repositories/trip_map_repository.dart`
- [Marker media](https://github.com/pgh2005/tripsync/blob/main/lib/features/trip_map/data/services/marker_media_service.dart): `lib/features/trip_map/data/services/marker_media_service.dart`

### Shared finances

- [Expense screens](https://github.com/pgh2005/tripsync/tree/main/lib/features/expenses/presentation/screens): `lib/features/expenses/presentation/screens`
- [Expense records](https://github.com/pgh2005/tripsync/blob/main/lib/features/expenses/data/repositories/expense_repository.dart): `lib/features/expenses/data/repositories/expense_repository.dart`
- [Expense splits](https://github.com/pgh2005/tripsync/blob/main/lib/features/expenses/data/models/expense_split_model.dart): `lib/features/expenses/data/models/expense_split_model.dart`
- [Balance overview](https://github.com/pgh2005/tripsync/blob/main/lib/features/balance_calculation/presentation/screens/balance_screen.dart): `lib/features/balance_calculation/presentation/screens/balance_screen.dart`
- [Balance calculator](https://github.com/pgh2005/tripsync/blob/main/lib/features/balance_calculation/data/services/balance_calculator.dart): `lib/features/balance_calculation/data/services/balance_calculator.dart`

### Shared services

- [Persian date picker](https://github.com/pgh2005/tripsync/blob/main/lib/features/trip/presentation/widget/date_picker/persian_date_picker_sheet.dart): `lib/features/trip/presentation/widget/date_picker/persian_date_picker_sheet.dart`

### Other components

- **Traveler**
- **Supabase backend**

## Connections

- Traveler → Authentication: authenticates (evidence: `README.md`)
- Traveler → Trip screens: manages trips (evidence: `README.md`)
- Traveler → Trip map: shares locations (evidence: `README.md`)
- Traveler → Expense screens: tracks costs (evidence: `README.md`)
- Authentication → Supabase backend: uses authentication (evidence: `README.md`)
- Profile → Supabase backend: uses backend (evidence: `README.md`)
- Trip screens → Trip management: creates or joins (evidence: `README.md`)
- Trip management → Supabase backend: stores trip data (evidence: `README.md`)
- Trip screens → Persian date picker: offers date selection (evidence: `README.md`)
- Trip map → Map markers: manages markers (evidence: `README.md`)
- Map markers → Marker media: attaches media (evidence: `README.md`)
- Map markers → Supabase backend: uses backend storage (evidence: `README.md`)
- Expense screens → Expense records: manages expenses (evidence: `README.md`)
- Expense records → Expense splits: supports splitting (evidence: `README.md`)
- Expense screens → Supabase backend: uses backend (evidence: `README.md`)
- Balance overview → Balance calculator: shows calculations (evidence: `README.md`)
