# ayushshende2679/splitmate architecture

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

- Interactive diagram: https://gitdiagram.com/ayushshende2679/splitmate
- Repository: https://github.com/ayushshende2679/splitmate

## Overview

SplitMate is a cross-platform personal and group expense tracker. Its main user journey is entering personal or shared expenses, with budgets and reports providing tracking and review; offline storage and Firebase sync support that journey. The README documents these capabilities and the app’s main data layers, but the sampled source does not include the Dart implementations, so links between individual screens and services are limited to documented wiring. The callable parent-link function is a separate integration.

Main entry points: [`lib/main.dart`](https://github.com/ayushshende2679/splitmate/blob/main/lib/main.dart) (App startup), [`lib/screens/login_page.dart`](https://github.com/ayushshende2679/splitmate/blob/main/lib/screens/login_page.dart) (Sign-in and signup), [`lib/screens/groups_page.dart`](https://github.com/ayushshende2679/splitmate/blob/main/lib/screens/groups_page.dart) (Group expenses), [`lib/presentation/providers/budget_provider.dart`](https://github.com/ayushshende2679/splitmate/blob/main/lib/presentation/providers/budget_provider.dart) (Budget state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["App experience"]
  node_app["App startup<br/>[main.dart]"]
  node_home["Home dashboard"]
  node_auth["Sign-in and signup<br/>[login_page.dart]"]
  node_profile["User profile<br/>[profile_page.dart]"]
  node_notifications["Notifications"]
end

subgraph group_expense["Expense workflows"]
  node_personal["Personal expenses"]
  node_groups["Group expenses<br/>[groups_page.dart]"]
  node_group_service["Group service<br/>[group_service.dart]"]
  node_budgets["Budget state"]
  node_budget_ui["Budget insights"]
  node_reports["PDF reports<br/>[reports_page.dart]"]
end

subgraph group_data["Data and sync"]
  node_repository["Budget repository"]
  node_hive[("Local Hive storage<br/>[hive_service.dart]")]
  node_sync["Firestore sync"]
end

subgraph group_services["Firebase services"]
  node_firebase_auth["Firebase Auth"]
  node_firestore[("Cloud Firestore")]
  node_rules["Access rules<br/>[firestore.rules]"]
  node_parent_link["Parent-link function<br/>[index.js]"]
  node_dynamic_links["Firebase Dynamic Links"]
end

node_user(("User"))

node_user -->|"opens"| node_app
node_app -->|"starts"| node_home
node_app -->|"restores session"| node_auth
node_auth -->|"authenticates"| node_firebase_auth
node_user -->|"records expenses"| node_personal
node_user -->|"manages splits"| node_groups
node_groups -->|"uses"| node_group_service
node_user -->|"reviews budgets"| node_budget_ui
node_budget_ui -->|"reads updates"| node_budgets
node_budgets -->|"uses"| node_repository
node_repository -->|"reads and writes"| node_hive
node_user -->|"requests report"| node_reports
node_user -->|"views"| node_notifications
node_sync -->|"syncs data"| node_firestore
node_firestore -->|"access governed by"| node_rules
node_parent_link -.->|"creates link"| node_dynamic_links

click node_app "https://github.com/ayushshende2679/splitmate/blob/main/lib/main.dart"
click node_home "https://github.com/ayushshende2679/splitmate/blob/main/lib/SplitMateHomeScreen.dart"
click node_auth "https://github.com/ayushshende2679/splitmate/blob/main/lib/screens/login_page.dart"
click node_profile "https://github.com/ayushshende2679/splitmate/blob/main/lib/screens/profile_page.dart"
click node_personal "https://github.com/ayushshende2679/splitmate/blob/main/lib/screens/add_edit_expense_screen.dart"
click node_groups "https://github.com/ayushshende2679/splitmate/blob/main/lib/screens/groups_page.dart"
click node_group_service "https://github.com/ayushshende2679/splitmate/blob/main/lib/screens/services/group_service.dart"
click node_budgets "https://github.com/ayushshende2679/splitmate/blob/main/lib/presentation/providers/budget_provider.dart"
click node_budget_ui "https://github.com/ayushshende2679/splitmate/blob/main/lib/presentation/widgets/budget_insights_card.dart"
click node_reports "https://github.com/ayushshende2679/splitmate/blob/main/lib/screens/reports_page.dart"
click node_notifications "https://github.com/ayushshende2679/splitmate/blob/main/lib/screens/notification_page.dart"
click node_repository "https://github.com/ayushshende2679/splitmate/blob/main/lib/data/repositories/budget_repository.dart"
click node_hive "https://github.com/ayushshende2679/splitmate/blob/main/lib/data/datasources/local/hive_service.dart"
click node_sync "https://github.com/ayushshende2679/splitmate/blob/main/lib/screens/services/firestore_sync_service.dart"
click node_rules "https://github.com/ayushshende2679/splitmate/blob/main/firestore.rules"
click node_parent_link "https://github.com/ayushshende2679/splitmate/blob/main/functions/index.js"

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_app,node_home,node_auth,node_profile,node_notifications,node_user toneBlue
class node_personal,node_groups,node_group_service,node_budgets,node_budget_ui,node_reports toneAmber
class node_repository,node_hive,node_sync toneMint
class node_firebase_auth,node_firestore,node_rules,node_parent_link,node_dynamic_links toneRose
```

## Components

### App experience

- [App startup](https://github.com/ayushshende2679/splitmate/blob/main/lib/main.dart): `lib/main.dart`
- [Home dashboard](https://github.com/ayushshende2679/splitmate/blob/main/lib/SplitMateHomeScreen.dart): `lib/SplitMateHomeScreen.dart`
- [Sign-in and signup](https://github.com/ayushshende2679/splitmate/blob/main/lib/screens/login_page.dart): `lib/screens/login_page.dart`
- [User profile](https://github.com/ayushshende2679/splitmate/blob/main/lib/screens/profile_page.dart): `lib/screens/profile_page.dart`
- [Notifications](https://github.com/ayushshende2679/splitmate/blob/main/lib/screens/notification_page.dart): `lib/screens/notification_page.dart`

### Expense workflows

- [Personal expenses](https://github.com/ayushshende2679/splitmate/blob/main/lib/screens/add_edit_expense_screen.dart): `lib/screens/add_edit_expense_screen.dart`
- [Group expenses](https://github.com/ayushshende2679/splitmate/blob/main/lib/screens/groups_page.dart): `lib/screens/groups_page.dart`
- [Group service](https://github.com/ayushshende2679/splitmate/blob/main/lib/screens/services/group_service.dart): `lib/screens/services/group_service.dart`
- [Budget state](https://github.com/ayushshende2679/splitmate/blob/main/lib/presentation/providers/budget_provider.dart): `lib/presentation/providers/budget_provider.dart`
- [Budget insights](https://github.com/ayushshende2679/splitmate/blob/main/lib/presentation/widgets/budget_insights_card.dart): `lib/presentation/widgets/budget_insights_card.dart`
- [PDF reports](https://github.com/ayushshende2679/splitmate/blob/main/lib/screens/reports_page.dart): `lib/screens/reports_page.dart`

### Data and sync

- [Budget repository](https://github.com/ayushshende2679/splitmate/blob/main/lib/data/repositories/budget_repository.dart): `lib/data/repositories/budget_repository.dart`
- [Local Hive storage](https://github.com/ayushshende2679/splitmate/blob/main/lib/data/datasources/local/hive_service.dart): `lib/data/datasources/local/hive_service.dart`
- [Firestore sync](https://github.com/ayushshende2679/splitmate/blob/main/lib/screens/services/firestore_sync_service.dart): `lib/screens/services/firestore_sync_service.dart`

### Firebase services

- **Firebase Auth**
- **Cloud Firestore**
- [Access rules](https://github.com/ayushshende2679/splitmate/blob/main/firestore.rules): `firestore.rules`
- [Parent-link function](https://github.com/ayushshende2679/splitmate/blob/main/functions/index.js): `functions/index.js`
- **Firebase Dynamic Links**

### Other components

- **User**

## Connections

- User → App startup: opens
- App startup → Home dashboard: starts
- App startup → Sign-in and signup: restores session
- Sign-in and signup → Firebase Auth: authenticates
- User → Personal expenses: records expenses
- User → Group expenses: manages splits
- Group expenses → Group service: uses
- User → Budget insights: reviews budgets
- Budget insights → Budget state: reads updates
- Budget state → Budget repository: uses
- Budget repository → Local Hive storage: reads and writes
- User → PDF reports: requests report
- User → Notifications: views
- Firestore sync → Cloud Firestore: syncs data
- Cloud Firestore → Access rules: access governed by
- Parent-link function → Firebase Dynamic Links: creates link
