How arduia/proexpense works
Purpose and runtime
Pro Expense is a Kotlin/Android finance-note application (API 21+) for locally recording daily income and expenses, viewing logs, summaries, and category statistics. Privacy-oriented constraints exclude multi-account and cloud backup. The installable Android app is the app module; reusable Android/library modules provide backup, graph, currency, and shared primitives.
Key build roots: settings.gradle.kts, app/build.gradle.kts, app/src/main/AndroidManifest.xml.
Application bootstrap and navigation
ExpenseApplication is the process entry point and initializes the DI-backed application. MainActivity hosts the primary fragment-based UI; MainHost, the navigation drawer, and Navigation component graph establish screen transitions. Startup routes through splash/onboarding before the main experience, with persisted settings determining language, currency, and configuration state.
Paths:
• app/src/main/java/com/arduia/expense/ExpenseApplication.kt
• app/src/main/java/com/arduia/expense/ui/MainActivity.kt
• app/src/main/res/navigation/main_nav.xml
Presentation layer: MVVM feature flows
Feature fragments delegate state and actions to view models. Core flows are expense entry/editing, pageable/filterable expense logs, home/dashboard summaries, and statistics. UI-specific models and mappers isolate Android rendering from repository/domain representations. Home renders weekly spending through the graph library.
Paths:
• app/src/main/java/com/arduia/expense/ui/entry/ExpenseEntryViewModel.kt
• app/src/main/java/com/arduia/expense/ui/expenselogs/ExpenseViewModel.kt
• app/src/main/java/com/arduia/expense/ui/home/HomeViewModel.kt
• app/src/main/java/com/arduia/expense/ui/statistics/StatisticsViewModel.kt
• week-expense-graph/src/main/java/com/arduia/graph/SpendGraph.kt
Domain and repository boundary
Domain types model amounts, expense-store concerns, exchange-rate storage, and date/log filters. UI depends on repository interfaces; implementation classes coordinate persistence, settings, bundled currency data, backup records, and server interactions. Result wrappers provide operational/error boundaries between data and callers.
Paths:
• app/src/main/java/com/arduia/expense/domain/Amount.kt
• app/src/main/java/com/arduia/expense/data/ExpenseRepository.kt
• app/src/main/java/com/arduia/expense/data/ExpenseRepositoryImpl.kt
• app/src/main/java/com/arduia/expense/data/SettingsRepositoryImpl.kt
Local persistence and assets
Room is the authoritative store for expense and backup entities, with versioned schemas checked into the app. Preferences/DataStore-style DAO abstractions hold app settings and cached state. Currency definitions are packaged locally, supporting offline currency selection rather than a required exchange service.
Paths:
• app/src/main/java/com/arduia/expense/data/local/ProExpenseDatabase.kt
• app/src/main/java/com/arduia/expense/data/local/ExpenseEnt.kt
• app/src/main/java/com/arduia/expense/data/local/PreferenceFlowStorageDaoImpl.kt
• app/schemas/com.arduia.expense.data.local.ProExpenseDatabase/6.json
• app/src/main/assets/currencies.json
Backup/import-export pipeline
Backup is explicitly local file-based. App-specific backup sheets map expense and schema data into the generic Excel backup engine; WorkManager workers execute export/import off the UI thread and UI messaging reports outcomes. The expense-backup module defines portable backup metadata/schema, while backup supplies spreadsheet task abstractions.
Paths:
• app/src/main/java/com/arduia/expense/data/backup/ExportWorker.kt
• app/src/main/java/com/arduia/expense/data/backup/ImportWorker.kt
• app/src/main/java/com/arduia/expense/data/backup/ExpenseBackupSheet.kt
• backup/src/main/java/com/arduia/backup/ExcelBackup.kt
• expense-backup/src/main/java/com/arduia/expense/backup/schema/BackupSchema.kt
Background network integrations
Internet use is limited to feedback submission and app-version/update status. Repository DTOs define these network payload boundaries; WorkManager workers schedule feedback and update checks independently of foreground UI. There is no cloud sync/backup service.
Paths:
• app/src/main/java/com/arduia/expense/data/ProExpenseServerRepositoryImpl.kt
• app/src/main/java/com/arduia/expense/data/FeedbackWorker.kt
• app/src/main/java/com/arduia/expense/data/update/CheckAboutUpdateWorker.kt
• app/src/main/java/com/arduia/expense/data/network/FeedbackDto.kt
Dependency composition and shared modules
Dagger Hilt modules compose database, network, repositories, domain services, UI mappers, navigation, and background work dependencies. shared provides cross-cutting Android/core utilities; currency-store contains exchange-rate store types, though README limitations indicate mixed-currency expense handling is not active.
Paths:
• app/src/main/java/com/arduia/expense/di/DatabaseModule.kt
• app/src/main/java/com/arduia/expense/di/RepositoryModule.kt
• app/src/main/java/com/arduia/expense/di/NetworkModule.kt
• shared/src/main/java/com/arduia/core/arch/Mapper.kt
• currency-store/src/main/java/com/arduia/currencystore/Store.kt
Main entry points: main_nav.xml Main navigation graph · ExpenseRepositoryImpl.kt Repository implementations · ExpenseRepository.kt Repository boundary · RepositoryModule.kt Hilt composition
Components 21
Android app
- ExpenseApplication · Initializes the Hilt-backed application process.
app/src/main/java/com/arduia/expense/ExpenseApplication.kt - MainActivity · Hosts the fragment-based primary experience.
app/src/main/java/com/arduia/expense/ui/MainActivity.kt - Main navigation graph · Routes splash, onboarding, drawer, and main screens.
app/src/main/res/navigation/main_nav.xml - Expense entry VM
app/src/main/java/com/arduia/expense/ui/entry/ExpenseEntryViewModel.kt - Expense logs VM · Provides pageable and filterable expense logs.
app/src/main/java/com/arduia/expense/ui/expenselogs/ExpenseViewModel.kt - Home VM · Supplies dashboard and weekly spending state.
app/src/main/java/com/arduia/expense/ui/home/HomeViewModel.kt - Statistics VM
app/src/main/java/com/arduia/expense/ui/statistics/StatisticsViewModel.kt - Hilt composition · Composes database, repositories, network, UI, and worker dependencies.
app/src/main/java/com/arduia/expense/di/RepositoryModule.kt
Data and local storage
- Repository boundary · UI accesses expense data through repository contracts.
app/src/main/java/com/arduia/expense/data/ExpenseRepository.kt - Repository implementations · Coordinates expenses, settings, assets, backup, and server operations.
app/src/main/java/com/arduia/expense/data/ExpenseRepositoryImpl.kt - Settings repository · Persists language, currency, and onboarding configuration.
app/src/main/java/com/arduia/expense/data/SettingsRepositoryImpl.kt - ProExpenseDatabase · Authoritative local store for expenses and backup entities.
app/src/main/java/com/arduia/expense/data/local/ProExpenseDatabase.kt - Expense entity
app/src/main/java/com/arduia/expense/data/local/ExpenseEnt.kt - Preference flow storage · Stores settings and cached application state.
app/src/main/java/com/arduia/expense/data/local/PreferenceFlowStorageDaoImpl.kt - Currency definitions · Offline currency selection data.
app/src/main/assets/currencies.json
Background integrations
- Import / export workers · Run local file backup operations off the UI thread.
app/src/main/java/com/arduia/expense/data/backup/ExportWorker.kt - Expense backup sheet · Maps expense and schema data into backup sheets.
app/src/main/java/com/arduia/expense/data/backup/ExpenseBackupSheet.kt - Feedback and update workers · Independently submit feedback and check app version status.
app/src/main/java/com/arduia/expense/data/FeedbackWorker.kt - Server repository · Limited network boundary for feedback and update status.
app/src/main/java/com/arduia/expense/data/ProExpenseServerRepositoryImpl.kt
Reusable modules
- Excel backup engine · Generic spreadsheet task abstractions.
backup/src/main/java/com/arduia/backup/ExcelBackup.kt - Weekly spend graph
week-expense-graph/src/main/java/com/arduia/graph/SpendGraph.kt
Connections 25
- ExpenseApplication → Hilt composition: initializes
- ExpenseApplication → MainActivity: starts
- MainActivity → Main navigation graph: hosts
- Main navigation graph → Expense entry VM: expense entry
- Main navigation graph → Expense logs VM: expense logs
- Main navigation graph → Home VM: dashboard
- Main navigation graph → Statistics VM: statistics
- Expense entry VM → Repository boundary: uses
- Expense logs VM → Repository boundary: uses
- Home VM → Repository boundary: uses
- Statistics VM → Repository boundary: uses
- Home VM → Weekly spend graph: renders weekly spending
- Repository boundary → Repository implementations: implemented by
- Repository implementations → ProExpenseDatabase: persists expenses
- Repository implementations → Settings repository: uses settings
- Repository implementations → Currency definitions: loads currencies
- ProExpenseDatabase → Expense entity: stores
- Settings repository → Preference flow storage: persists through
- Import / export workers → Expense backup sheet: maps backup data
- Expense backup sheet → Excel backup engine: uses
- Import / export workers → ProExpenseDatabase: exports / imports
- Feedback and update workers → Server repository: calls
- Hilt composition → Repository implementations: provides
- Hilt composition → Import / export workers: injects
- Hilt composition → Feedback and update workers: injects