Overview
Budgets help you control spending by setting limits for specific categories over defined time periods. FinAI tracks your progress automatically and alerts you when you’re close to or over budget.Database Schema
TheBudget model uses a many-to-many relationship with categories:
A single budget can track multiple categories, allowing flexible grouping like “Entertainment” (covering Movies, Concerts, Gaming).
Creating a Budget
Select Categories to Track
Choose which spending categories count toward this budget. For example:
- “Eating Out Budget” might include: Cafe, Restaurants, Fast Food
- “Transportation Budget” might include: Gas, Parking, Uber
System Creates Budget
The backend creates the budget and links categories (
app/routes/budget.py:66-82):Tracking Budget Progress
Retrieve all budgets with real-time spending data:Budget States
On Track
Progress < 80%
Safe spending level
Safe spending level
Warning
Progress 80-100%
Approaching limit
Approaching limit
Exceeded
Progress > 100%
Over budget
Over budget
is_exceeded flag indicates when spending surpasses the limit:
Progress Calculation
Progress is calculated as a percentage with a cap at 100% for display:The progress bar shows maximum 100%, but the
is_exceeded flag and actual spent amount reveal over-budget situations.Days Remaining
The system calculates days left in the budget period:Deleting a Budget
Remove a budget when no longer needed:Deleting a budget does NOT delete transactions or categories. It only removes the budget tracking structure.
Budget Workflows
Scenario: Monthly Food Budget
Identify Food Categories
Review your categories and identify all food-related ones:
- Ăn uống (Dining)
- Cafe
- Siêu thị (Groceries)
Set Realistic Limit
Check last month’s spending in Reports, then set a budget:
- Last month: 4,200,000 VND
- Target: 3,500,000 VND (reduce by 16%)
Scenario: Quarterly Entertainment Budget
3-month budget for discretionary spending
3-month budget for discretionary spending
Create a budget for Q1 (Jan 1 - Mar 31):This allows flexible month-to-month spending while controlling the quarterly total.Example progression:
- January: 1,800,000 VND (30%)
- February: 2,500,000 VND (41.7%)
- March: Stay under 1,700,000 VND to meet goal
Budget Best Practices
Use Multiple Targeted Budgets
Use Multiple Targeted Budgets
Instead of one large “All Expenses” budget, create specific budgets:
- Food & Dining: 3,500,000 VND
- Transportation: 1,200,000 VND
- Entertainment: 1,000,000 VND
Align Budget Periods with Income
Align Budget Periods with Income
If you’re paid monthly, create monthly budgets starting on payday:
- Payday: 5th of each month
- Budget period: 5th to 4th of following month
Review and Adjust Regularly
Review and Adjust Regularly
After each budget period:
- Check if you met, exceeded, or under-spent
- Analyze which categories drove spending
- Adjust limits for next period based on reality
- Celebrate successes to build momentum
Integration with Other Features
AI Chatbot Budget Queries
Ask the chatbot about your budgets:- “Am I on track with my food budget?”
- “How much budget do I have left for entertainment?”
- “Which budget am I closest to exceeding?”
Reports Integration
Use Reports to inform budget creation:- Generate report for last month
- Identify high-spending categories
- Set budgets for those categories
- Use historical data to set realistic limits
Error Handling
The budget system includes comprehensive error handling:Database Relationships
The many-to-many relationship enables flexible budget structures:- One budget can track multiple categories
- One category can be in multiple budgets
- The
budget_categoryjunction table manages the associations
- “Monthly Food Budget” (all food)
- “Dining Out Only” (restaurants, excluding groceries)
Performance Considerations
Budget calculations are optimized:API Reference
Get All Budgets
Create Budget
Delete Budget
Related Features
- Transactions - Budget tracking depends on transaction data
- Reports - Analyze spending to set realistic budgets
- Chatbot - Ask questions about budget progress
- AI Categorization - Accurate categorization ensures accurate budget tracking
