Building a MoneyForward-Beating AI Budget Advisor in Flutter Web (Supabase + Claude)
Why Build This
Amazon just launched "Rufus Buy for Me" β an AI that browses and purchases for you. The counter-move for a personal finance app? Make the AI work for your wallet, not against it.
I'm building θͺεζ ͺεΌδΌη€Ύ, an AI life management app that replaces 21 SaaS tools (Notion, Evernote, MoneyForward, Slack, etc.) with one integrated platform. Today's task: transform a 128-line stub budget page into a full AI-powered financial advisor.
What We Built
A 4-tab budget page:
- Overview β Income/expense KPIs + top 5 spending categories
- Budget β 15-category budget vs. actual with progress bars
- AI Savings Advice β Claude analyzes spending and generates 3 actionable tips
- Future Simulator β Compound interest calculator for wealth projection
The AI Savings Advisor
Instead of creating a new Edge Function, we reused the existing ai-assistant EF β just with a new prompt:
Future<void> _fetchAiAdvice() async {
final prompt = '''
Analyze this month's ($_selectedMonth) household data and suggest 3 specific saving tips.
Total income: Β₯${_fmt.format(totalIncome)}
Total expenses: Β₯${_fmt.format(totalExpense)}
Spending by category:
$breakdown
Provide exactly 3 practical, actionable saving suggestions.
''';
final response = await _supabase.functions.invoke(
'ai-assistant',
body: {'action': 'chat', 'message': prompt},
);
}
Prompt engineering notes:
- Pass structured monthly data (not raw transactions β the AI doesn't need every line item)
- Constrain to "exactly 3 tips" to keep responses concise and actionable
- Ask for "practical" suggestions to avoid generic advice like "spend less"
The ai-assistant EF routes this to Claude Sonnet and returns suggestions like:
- "Your dining out (Β₯45,000) is 23% over budget β try batch cooking 3 meals/week to cut this by Β₯15,000"
- "Switch your streaming subscriptions to annual billing β saves ~Β₯8,400/year"
- "Your transport costs suggest frequent taxis β a monthly pass would save Β₯12,000"
Compound Interest Simulator
Pure Dart implementation (no packages needed):
void _runSimulation() {
final principal = double.tryParse(_initialAmountCtrl.text) ?? 0;
final monthly = double.tryParse(_monthlyAddCtrl.text) ?? 0;
final rate = (double.tryParse(_returnRateCtrl.text) ?? 0) / 100 / 12;
final months = (int.tryParse(_yearsCtrl.text) ?? 0) * 12;
double result = principal;
for (int i = 0; i < months; i++) {
result = result * (1 + rate) + monthly;
}
setState(() => _simResult = result);
}
Example: Β₯1M initial + Β₯30K/month + 5% annual return + 20 years = Β₯15.4M
Principal contributed: Β₯8.2M β Interest earned: Β₯7.2M β compound interest does the heavy lifting.
Edge Function Pattern: Reuse app_analytics for Multi-Purpose Storage
Rather than creating a dedicated budget_data table, we use app_analytics with a source column as a discriminator:
// In budget-financial-planner EF
await supabase.from('app_analytics').upsert({
user_id: userId,
source: 'budget', // discriminator
category: budgetCategory,
amount: budgetAmount,
month: targetMonth,
metadata: { breakdown: categories }
});
Why this works: The app_analytics table already has user_id, category, amount, metadata columns. For budget data, we just add source: 'budget' and query with .eq('source', 'budget'). No new migration needed.
This pattern scales well when you have many feature-specific datasets that don't need complex relational queries.
Competing with MoneyForward
MoneyForward's strengths: bank account sync, automatic categorization, long history.
Our approach: AI-first, not data-first. Instead of syncing every transaction, users input monthly summaries and the AI does the analysis. Less friction, more insight.
What we added that MoneyForward doesn't have:
- Natural language AI advice (not just charts)
- Integrated with the rest of your life data (tasks, goals, habits)
- Future wealth projection tied to your actual budget
Key Takeaways
- Reuse existing Edge Functions β adding a new prompt is cheaper than a new EF
- Constrain your AI prompts β "exactly 3 tips" beats "give me advice"
-
Generic tables > specific tables β
app_analyticswith asourcecolumn handles dozens of use cases - Compound interest is powerful β build a simulator and show users the math
Try it: θͺεζ ͺεΌδΌη€Ύ









