A small, personal expense tracker for iOS. Log expenses in a couple of taps, set budgets per category or for the whole month, and see at a glance how the month is going. Everything lives in a local SQLite database on the device — no accounts, no sync, no network.
Amounts are stored as integer øre and displayed in NOK.
- Home — monthly overview with a summary card and per-category cards showing spend vs. budget. Tap a category to quick-log an expense; long-press to edit it, set its budget, view its expenses, or delete it. Browse back through previous months.
- Ledger — the full expense list, with editing.
- Wishlist — things you're considering buying, filed under a category.
- Subs — recurring subscriptions (monthly or yearly), with monthly-equivalent cost.
- Categories — user-defined, with optional emoji icon and color, one level of subcategories, and manual reordering. Deleting a category that still has expenses, subscriptions, or wishlist items archives it instead of destroying history.
- Budgets — a default budget per category plus per-month overrides, and an overall month budget with the same default/override scheme.
- SwiftUI, single-module app, no view models — screens observe the database directly
- GRDB for SQLite access;
ValueObservationstreams keep every screen live-updated as data changes - Schema is created and seeded via
DatabaseMigratormigrations (in DEBUG the database is erased on schema change, so migrations can be edited freely during development)
Fafnir/
├── FafnirApp.swift # entry point, injects database + router
├── ContentView.swift # tab bar
├── Router.swift # tab selection & cross-tab navigation
├── Database/
│ ├── AppDatabase.swift # connection, migrations, seed data, write API
│ ├── Models.swift # Category, Expense, Budget, Subscription, …
│ ├── Queries.swift # read queries used by the screens
│ └── AppDatabase+Environment.swift
├── Screens/ # HomeView, LedgerView, WishlistView, SubscriptionsView
├── Sheets/ # quick entry, category form, budget, reorder
└── Components/ # shared views & helpers
Open Fafnir.xcodeproj in Xcode and run the Fafnir scheme (iOS 27+). GRDB is resolved automatically via Swift Package Manager. The database file is created under Application Support (Database/fafnir.sqlite); in DEBUG builds its path is printed to the console on launch.