How mickunaru/balancr works
Balancr is a personal-finance web app: users sign in, link banks through Plaid or import CSVs, then review accounts, transactions, budgets, and financial summaries. Bank linking stores encrypted credentials and accounts; transaction sync updates categorized records and balances, while dashboard queries and budget views turn stored financial activity into results. The graph preserves documented capabilities such as reconnects, recurring-charge detection, and CSV de-duplication. Some feature internals are unsampled, so those relationships are shown only where the README or source index supports them.
Main entry points: db.ts Postgres database · sync.ts Transaction sync · route.ts Link exchange · page.tsx Dashboard summary
Components 21
Identity
- Authentication
auth.ts - Sign-in and signup
app/(auth)/actions.ts
Bank connections
- Plaid link routes
app/api/plaid/create-link-token/route.ts - Link exchange
app/api/plaid/exchange/route.ts - Plaid webhook
app/api/plaid/webhook/route.ts - Reconnect handling
app/api/plaid/reconnected/route.ts - Transaction sync
lib/sync.ts - Token encryption
lib/crypto.ts
Finance workflows
- Accounts view
app/dashboard/accounts/page.tsx - Transactions view
app/dashboard/transactions/page.tsx - Categories and rules
lib/categories.ts - Budget management
app/dashboard/budgets/page.tsx - CSV import workflow
app/dashboard/import/import-client.tsx - CSV normalization
lib/csv-import.ts
Financial insights
- Dashboard summary
app/dashboard/page.tsx - Financial aggregates
lib/dashboard-data.ts - Charts and trends
app/dashboard/charts.tsx - Recurring charges
lib/subscriptions.ts
Persistence
- Postgres database
lib/db.ts
Other components
- Finance user
- Plaid service
Connections 31
- Finance user → Sign-in and signup: signs in
app/(auth)/actions.ts - Sign-in and signup → Authentication: authenticates
app/(auth)/actions.ts - Authentication → Postgres database: reads users
auth.ts - Finance user → Plaid link routes: starts linking
README.md - Plaid link routes → Plaid service: requests link token
app/api/plaid/create-link-token/route.ts - Finance user → Link exchange: submits token
README.md - Link exchange → Plaid service: exchanges token
app/api/plaid/exchange/route.ts - Link exchange → Token encryption: encrypts credential
app/api/plaid/exchange/route.ts - Link exchange → Postgres database: stores accounts
app/api/plaid/exchange/route.ts - Link exchange → Transaction sync: starts initial sync
app/api/plaid/exchange/route.ts - Plaid webhook → Transaction sync: triggers sync
app/api/plaid/webhook/route.ts - Reconnect handling → Transaction sync: resumes sync
app/api/plaid/reconnected/route.ts - Transaction sync → Plaid service: fetches transactions
lib/sync.ts - Transaction sync → Token encryption: decrypts credential
lib/sync.ts - Transaction sync → Categories and rules: resolves categories
lib/sync.ts - Transaction sync → Postgres database: updates records
lib/sync.ts - Finance user → Accounts view: reviews accounts
README.md - Finance user → Transactions view: reviews transactions
README.md - Finance user → Budget management: sets limits
README.md - Transactions view → Postgres database: reads transactions
app/dashboard/transactions/page.tsx - Budget management → Postgres database: reads and writes budgets
app/dashboard/budgets/page.tsx - Budget management → Categories and rules: loads taxonomy
app/dashboard/budgets/page.tsx - Finance user → CSV import workflow: imports statement
README.md - CSV import workflow → CSV normalization: normalizes rows
- CSV import workflow → Postgres database: commits transactions
app/dashboard/import/import-client.tsx - Finance user → Dashboard summary: views finances
README.md - Dashboard summary → Financial aggregates: loads aggregates
app/dashboard/page.tsx - Dashboard summary → Charts and trends: renders trends
app/dashboard/page.tsx - Dashboard summary → Recurring charges: loads recurring charges
app/dashboard/page.tsx - Financial aggregates → Postgres database: queries finance data
lib/dashboard-data.ts - Accounts view → Postgres database: reads accounts
app/dashboard/accounts/page.tsx