Personal Product • Financial Systems
GoalFlow 70/30
A local-first personal financial ledger enforcing the strict 70/30 budget allocation rule, an automated self-debt freeze engine, and offline schema migration guards.
The Operational Friction: The Illusion of Budgeting & Financial App Bloat
Most modern personal finance and budgeting mobile apps fall into one of two traps:
- The Invasive Cloud Aggregator Trap: They mandate linking external bank accounts through third-party data aggregators (like Plaid or Yodlee). This creates serious privacy liabilities, exposes personal spending patterns to data brokers, and introduces persistent connection breakages whenever banking institutions update their security headers.
- The Passive Expense Logger Trap: They operate as glorified spreadsheets that passively record deficits after the money is already spent. They display retrospective pie charts and colorful bar graphs, but do nothing systematically to prevent impulsive purchases or enforce savings discipline.
When individuals encounter unexpected lifestyle expenses, standard budgeting apps merely mark a negative balance. There is no structural accountability mechanism preventing the user from spending future income on discretionary luxury goals before repairing their financial safety net.
I engineered GoalFlow 70/30 to replace passive expense logging with an active, rule-enforcing financial state machine. Operating completely offline with zero bank account linkages or cloud telemetry, GoalFlow enforces a mathematical budget model: every single income deposit is rigidly split into 30% locked savings and 70% spendable capital, protected by an automated Self-Debt enforcement engine.
The Financial State Machine: Mathematical Invariants
In GoalFlow, every financial transaction modifies a centralized state machine governed by deterministic mathematical invariants.
The system evaluates incoming cash flows through the useFinancialStore state module:
- The 70/30 Partition: When an income entry is created (categorized across Freelancing, Consulting, Salary, or Trading), the state machine computes the exact 30/70 split immediately, updating spendable balances and savings reserves synchronously.
- Monthly Surplus Tracking: Core living expenses are deducted from the 70% spendable pool, calculating real-time monthly surplus and generating accurate time-to-goal projections for active savings targets.
The Self-Debt Engine & Purchase Eligibility Gates
The defining technical feature of GoalFlow is its Self-Debt state gate. In real life, emergencies happen—car repairs, medical bills, or urgent travel—that necessitate withdrawing funds from locked savings.
In traditional apps, this simply depletes the savings figure. In GoalFlow, withdrawing from savings initiates a transactional debt against oneself:
// hooks/useFinancialStore.ts - Emergency Withdrawal & Debt Creation
export function handleEmergencyWithdrawal(amount: number, reason: string) {
set((state) => {
if (amount > state.savingsBalance) {
throw new Error("Insufficient savings reserve for withdrawal.");
}
return {
savingsBalance: state.savingsBalance - amount,
selfDebtBalance: state.selfDebtBalance + amount,
debtLogs: [
...state.debtLogs,
{
id: generateUUID(),
timestamp: new Date().toISOString(),
amount,
reason,
status: 'UNPAID',
},
],
// Enforce immediate state lock across goal purchase actions
isPurchaseLocked: true,
};
});
}Whenever selfDebtBalance > 0, the state machine transitions into DEBT_LOCKED mode:
- Purchase Gate Lockout: All "Purchase Goal" and "Release Funds" triggers across the UI are physically disabled. Even if an individual savings goal has accumulated 100% of its target cost, the user is barred from completing the purchase.
- Restitution Workflows: The UI surfaces a contextual Debt Repayment Banner on the dashboard. Future deposits into the 70% spendable pool must be allocated to debt repayment before discretionary goals can be executed.
- Emergency Fund Threshold: To ensure long-term resilience, goal purchases require a secondary check: the emergency fund must hold a minimum reserve equivalent to 3 months of estimated core living expenses before goal purchases unlock.
Local Schema Migrations & Zero-Trace Persistence
GoalFlow functions 100% client-side without a remote backend database. Financial records are persisted using Zustand paired with @react-native-async-storage/async-storage.
Because users store vital financial records on their device, updating the app or importing older backups could cause state deserialization failures if the schema evolves.
To prevent data corruption, I engineered an offline migration runner within the data import module:
- JSON Schema Versioning: Every export file contains a metadata header with a strict
schemaVersiontag. - Incremental Migration Pipeline: When a backup file is selected via
expo-document-picker, the import handler parses the payload and applies sequential migrations (e.g., migrating v1 flat expense objects into v2 categorized ledger arrays, adding missing self-debt fields, and recalculating running surpluses) before writing to persistent storage.
// utils/data-import.ts - Automated Offline Schema Migration
export function migrateFinancialPayload(rawBackup: unknown): FinancialStoreState {
const parsed = validateBackupStructure(rawBackup);
let state = parsed.data;
// Migration V1 -> V2: Add Self-Debt ledger arrays if missing
if (parsed.schemaVersion < 2) {
state = {
...state,
selfDebtBalance: 0,
debtLogs: [],
schemaVersion: 2,
};
}
// Migration V2 -> V3: Normalize multi-currency records
if (parsed.schemaVersion < 3) {
state = {
...state,
currencyLocale: state.currencyLocale || 'en-US',
schemaVersion: 3,
};
}
return state;
}Biometrics & Verification
- Hardware Biometrics (
expo-local-authentication): Financial data is shielded from physical snooping. Face ID or fingerprint authentication is required upon cold boot and when resuming the app from the background task switcher. - Test Verification: The financial mathematics engine is backed by unit tests written in Vitest, verifying 70/30 split accuracy, surplus deductions, and debt-lock state transitions across edge cases. The UI is verified using Playwright end-to-end test runners.
Production Outcomes
- Google Play Production Release: Successfully deployed and maintained on the Google Play Store (
com.fasilu.goalflow7030, version 1.2.3, versionCode: 4). - Zero Third-Party Telemetry: Operates with 100% offline autonomy; no personal banking data or transaction ledgers ever touch remote servers.
- Deterministic Financial Invariants: Enforces rigid behavioral accountability, successfully preventing discretionary goal purchases during active self-debt periods.
Key Achievements & Metrics
Engineered a local-first financial planning app published on Google Play Store (com.fasilu.goalflow7030).
Built an automated 70/30 income partitioning engine splitting deposits into 30% locked savings and 70% spendable pools.
Designed a Self-Debt state machine that locks all goal purchases whenever emergency savings withdrawals occur until debts are repaid.
Implemented an offline data recovery pipeline with automated schema migrations during JSON backup imports.