# krawmire/profitocracy architecture

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

- Interactive diagram: https://gitdiagram.com/krawmire/profitocracy
- Repository: https://github.com/krawmire/profitocracy

## Overview

Profitocracy is a local-first budgeting app for applying the 50-30-20 rule, tracking transactions and category budgets, and reviewing spending across billing periods. The usual user journey is to enter income or expenses, then inspect actual-versus-planned amounts and historical summaries; profiles, currencies, recurring entries, settings, and backup/import-export extend that journey. The graph distinguishes the mobile app, domain services, and SQLite persistence. Some feature wiring is not shown in the sampled source, so uncertain UI-to-service connections are omitted.

Main entry points: [`src/Profitocracy.Core/Domain/Services/CalculationService.cs`](https://github.com/krawmire/profitocracy/blob/main/src/Profitocracy.Core/Domain/Services/CalculationService.cs) (Budget calculations), [`src/Profitocracy.Mobile/App.xaml.cs`](https://github.com/krawmire/profitocracy/blob/main/src/Profitocracy.Mobile/App.xaml.cs) (App startup), [`src/Profitocracy.Core/Domain/Services/TransactionService.cs`](https://github.com/krawmire/profitocracy/blob/main/src/Profitocracy.Core/Domain/Services/TransactionService.cs) (Transaction operations), [`src/Profitocracy.Infrastructure/Persistence/Sqlite/Repositories/TransactionRepository.cs`](https://github.com/krawmire/profitocracy/blob/main/src/Profitocracy.Infrastructure/Persistence/Sqlite/Repositories/TransactionRepository.cs) (Transaction repository)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mobile["Mobile app"]
  node_app["App startup<br/>[App.xaml.cs]"]
  node_auth["Authentication screen<br/>[AuthPage.xaml.cs]"]
  node_shell["App navigation<br/>[AppShell.xaml.cs]"]
  node_home["Budget home"]
  node_transactions_ui["Transaction screens"]
  node_overview["Spending overview"]
  node_profile_ui["Profile settings"]
  node_settings_ui["App settings"]
end

subgraph group_domain["Budget domain"]
  node_calculation["Budget calculations"]
  node_transaction_service["Transaction operations"]
  node_profile_domain["Profiles and budgets<br/>[Profile.cs]"]
  node_transaction_domain["Transactions<br/>[Transaction.cs]"]
  node_summary["Period summaries<br/>[Summary.cs]"]
  node_category_domain["Categories<br/>[Category.cs]"]
end

subgraph group_storage["Local persistence"]
  node_profile_repo["Profile repository"]
  node_transaction_repo["Transaction repository"]
  node_category_repo["Category repository"]
  node_sqlite[("SQLite database<br/>[DbConnection.cs]")]
end

subgraph group_integrations["Device integrations"]
  node_recurring_worker["Recurring worker"]
  node_notifications["Local notifications"]
  node_backup["Backup provider<br/>[BackupProvider.cs]"]
end

node_user(("Budget user"))

node_user -->|"starts app"| node_app
node_app -->|"requires authentication"| node_auth
node_app -->|"opens navigation"| node_shell
node_auth -->|"authentication passed"| node_shell
node_calculation -->|"loads and updates"| node_profile_repo
node_calculation -->|"reads transactions"| node_transaction_repo
node_calculation -->|"reads categories"| node_category_repo
node_transaction_service -->|"loads current profile"| node_profile_repo
node_transaction_service -->|"reads and writes"| node_transaction_repo
node_transaction_repo -->|"queries and persists"| node_sqlite
node_recurring_worker -->|"creates recurring entries"| node_transaction_service
node_recurring_worker -->|"requests notification"| node_notifications

click node_app "https://github.com/krawmire/profitocracy/blob/main/src/Profitocracy.Mobile/App.xaml.cs"
click node_auth "https://github.com/krawmire/profitocracy/blob/main/src/Profitocracy.Mobile/Views/Auth/AuthPage.xaml.cs"
click node_shell "https://github.com/krawmire/profitocracy/blob/main/src/Profitocracy.Mobile/AppShell.xaml.cs"
click node_home "https://github.com/krawmire/profitocracy/blob/main/src/Profitocracy.Mobile/ViewModels/Home/HomePageViewModel.cs"
click node_transactions_ui "https://github.com/krawmire/profitocracy/blob/main/src/Profitocracy.Mobile/ViewModels/Transactions/TransactionsPageViewModel.cs"
click node_overview "https://github.com/krawmire/profitocracy/blob/main/src/Profitocracy.Mobile/ViewModels/Overview/OverviewPageViewModel.cs"
click node_profile_ui "https://github.com/krawmire/profitocracy/blob/main/src/Profitocracy.Mobile/ViewModels/Profiles/ProfileSettingsPageViewModel.cs"
click node_settings_ui "https://github.com/krawmire/profitocracy/blob/main/src/Profitocracy.Mobile/ViewModels/Settings/ImportExportSettingsPageViewModel.cs"
click node_calculation "https://github.com/krawmire/profitocracy/blob/main/src/Profitocracy.Core/Domain/Services/CalculationService.cs"
click node_transaction_service "https://github.com/krawmire/profitocracy/blob/main/src/Profitocracy.Core/Domain/Services/TransactionService.cs"
click node_profile_domain "https://github.com/krawmire/profitocracy/blob/main/src/Profitocracy.Core/Domain/Model/Profiles/Profile.cs"
click node_transaction_domain "https://github.com/krawmire/profitocracy/blob/main/src/Profitocracy.Core/Domain/Model/Transactions/Transaction.cs"
click node_summary "https://github.com/krawmire/profitocracy/blob/main/src/Profitocracy.Core/Domain/Model/Summaries/Summary.cs"
click node_category_domain "https://github.com/krawmire/profitocracy/blob/main/src/Profitocracy.Core/Domain/Model/Categories/Category.cs"
click node_profile_repo "https://github.com/krawmire/profitocracy/blob/main/src/Profitocracy.Infrastructure/Persistence/Sqlite/Repositories/ProfileRepository.cs"
click node_transaction_repo "https://github.com/krawmire/profitocracy/blob/main/src/Profitocracy.Infrastructure/Persistence/Sqlite/Repositories/TransactionRepository.cs"
click node_category_repo "https://github.com/krawmire/profitocracy/blob/main/src/Profitocracy.Infrastructure/Persistence/Sqlite/Repositories/CategoryRepository.cs"
click node_sqlite "https://github.com/krawmire/profitocracy/blob/main/src/Profitocracy.Infrastructure/Persistence/Sqlite/Configuration/DbConnection.cs"
click node_recurring_worker "https://github.com/krawmire/profitocracy/blob/main/src/Profitocracy.Mobile/Platforms/Android/Work/RecurringTransactionWorker.cs"
click node_notifications "https://github.com/krawmire/profitocracy/blob/main/src/Profitocracy.Mobile/Services/Static/NotificationService.cs"
click node_backup "https://github.com/krawmire/profitocracy/blob/main/src/Profitocracy.Infrastructure/Integrations/BackupProvider.cs"

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_auth,node_shell,node_home,node_transactions_ui,node_overview,node_profile_ui,node_settings_ui,node_user toneBlue
class node_calculation,node_transaction_service,node_profile_domain,node_transaction_domain,node_summary,node_category_domain toneAmber
class node_profile_repo,node_transaction_repo,node_category_repo,node_sqlite toneMint
class node_recurring_worker,node_notifications,node_backup toneRose
```

## Components

### Mobile app

- [App startup](https://github.com/krawmire/profitocracy/blob/main/src/Profitocracy.Mobile/App.xaml.cs): `src/Profitocracy.Mobile/App.xaml.cs`
- [Authentication screen](https://github.com/krawmire/profitocracy/blob/main/src/Profitocracy.Mobile/Views/Auth/AuthPage.xaml.cs): `src/Profitocracy.Mobile/Views/Auth/AuthPage.xaml.cs`
- [App navigation](https://github.com/krawmire/profitocracy/blob/main/src/Profitocracy.Mobile/AppShell.xaml.cs): `src/Profitocracy.Mobile/AppShell.xaml.cs`
- [Budget home](https://github.com/krawmire/profitocracy/blob/main/src/Profitocracy.Mobile/ViewModels/Home/HomePageViewModel.cs): `src/Profitocracy.Mobile/ViewModels/Home/HomePageViewModel.cs`
- [Transaction screens](https://github.com/krawmire/profitocracy/blob/main/src/Profitocracy.Mobile/ViewModels/Transactions/TransactionsPageViewModel.cs): `src/Profitocracy.Mobile/ViewModels/Transactions/TransactionsPageViewModel.cs`
- [Spending overview](https://github.com/krawmire/profitocracy/blob/main/src/Profitocracy.Mobile/ViewModels/Overview/OverviewPageViewModel.cs): `src/Profitocracy.Mobile/ViewModels/Overview/OverviewPageViewModel.cs`
- [Profile settings](https://github.com/krawmire/profitocracy/blob/main/src/Profitocracy.Mobile/ViewModels/Profiles/ProfileSettingsPageViewModel.cs): `src/Profitocracy.Mobile/ViewModels/Profiles/ProfileSettingsPageViewModel.cs`
- [App settings](https://github.com/krawmire/profitocracy/blob/main/src/Profitocracy.Mobile/ViewModels/Settings/ImportExportSettingsPageViewModel.cs): `src/Profitocracy.Mobile/ViewModels/Settings/ImportExportSettingsPageViewModel.cs`

### Budget domain

- [Budget calculations](https://github.com/krawmire/profitocracy/blob/main/src/Profitocracy.Core/Domain/Services/CalculationService.cs): `src/Profitocracy.Core/Domain/Services/CalculationService.cs`
- [Transaction operations](https://github.com/krawmire/profitocracy/blob/main/src/Profitocracy.Core/Domain/Services/TransactionService.cs): `src/Profitocracy.Core/Domain/Services/TransactionService.cs`
- [Profiles and budgets](https://github.com/krawmire/profitocracy/blob/main/src/Profitocracy.Core/Domain/Model/Profiles/Profile.cs): `src/Profitocracy.Core/Domain/Model/Profiles/Profile.cs`
- [Transactions](https://github.com/krawmire/profitocracy/blob/main/src/Profitocracy.Core/Domain/Model/Transactions/Transaction.cs): `src/Profitocracy.Core/Domain/Model/Transactions/Transaction.cs`
- [Period summaries](https://github.com/krawmire/profitocracy/blob/main/src/Profitocracy.Core/Domain/Model/Summaries/Summary.cs): `src/Profitocracy.Core/Domain/Model/Summaries/Summary.cs`
- [Categories](https://github.com/krawmire/profitocracy/blob/main/src/Profitocracy.Core/Domain/Model/Categories/Category.cs): `src/Profitocracy.Core/Domain/Model/Categories/Category.cs`

### Local persistence

- [Profile repository](https://github.com/krawmire/profitocracy/blob/main/src/Profitocracy.Infrastructure/Persistence/Sqlite/Repositories/ProfileRepository.cs): `src/Profitocracy.Infrastructure/Persistence/Sqlite/Repositories/ProfileRepository.cs`
- [Transaction repository](https://github.com/krawmire/profitocracy/blob/main/src/Profitocracy.Infrastructure/Persistence/Sqlite/Repositories/TransactionRepository.cs): `src/Profitocracy.Infrastructure/Persistence/Sqlite/Repositories/TransactionRepository.cs`
- [Category repository](https://github.com/krawmire/profitocracy/blob/main/src/Profitocracy.Infrastructure/Persistence/Sqlite/Repositories/CategoryRepository.cs): `src/Profitocracy.Infrastructure/Persistence/Sqlite/Repositories/CategoryRepository.cs`
- [SQLite database](https://github.com/krawmire/profitocracy/blob/main/src/Profitocracy.Infrastructure/Persistence/Sqlite/Configuration/DbConnection.cs): `src/Profitocracy.Infrastructure/Persistence/Sqlite/Configuration/DbConnection.cs`

### Device integrations

- [Recurring worker](https://github.com/krawmire/profitocracy/blob/main/src/Profitocracy.Mobile/Platforms/Android/Work/RecurringTransactionWorker.cs): `src/Profitocracy.Mobile/Platforms/Android/Work/RecurringTransactionWorker.cs`
- [Local notifications](https://github.com/krawmire/profitocracy/blob/main/src/Profitocracy.Mobile/Services/Static/NotificationService.cs): `src/Profitocracy.Mobile/Services/Static/NotificationService.cs`
- [Backup provider](https://github.com/krawmire/profitocracy/blob/main/src/Profitocracy.Infrastructure/Integrations/BackupProvider.cs): `src/Profitocracy.Infrastructure/Integrations/BackupProvider.cs`

### Other components

- **Budget user**

## Connections

- Budget user → App startup: starts app
- App startup → Authentication screen: requires authentication
- App startup → App navigation: opens navigation
- Authentication screen → App navigation: authentication passed
- Budget calculations → Profile repository: loads and updates
- Budget calculations → Transaction repository: reads transactions
- Budget calculations → Category repository: reads categories
- Transaction operations → Profile repository: loads current profile
- Transaction operations → Transaction repository: reads and writes
- Transaction repository → SQLite database: queries and persists
- Recurring worker → Transaction operations: creates recurring entries
- Recurring worker → Local notifications: requests notification
