Overview
Personal finance tools are either too heavy or too manual. I built a lightweight tracker that lets users add income and expenses fast,
tag categories, and immediately see where money goes. The app shows month-to-date burn-rate, budget progress, and a simple machine-learning
forecast for end-of-month spend. Everything runs on a clean Flask backend with a minimal HTML/CSS/JS frontend and Chart.js visuals.
Goals
- One-click add/edit of transactions with sensible defaults and keyboard shortcuts.
- Real-time dashboards: category breakdown, cashflow over time, and budget utilization.
- Lightweight ML to forecast month-end spend using recent history and burn-rate.
My Role
- Backend: Flask routes, services, validation, and transaction/budget logic.
- Frontend: HTML/CSS layout, JS fetch for async forms, Chart.js for visuals.
- Data/ML: SQLite schema, query layer, and a small regression model for forecasts.
Architecture
- Backend: Flask blueprints (
/transactions, /budgets, /analytics).
Service layer handles CRUD, summaries, and validation; responses as HTML or JSON for AJAX.
- Data: SQLite with tables:
users, transactions (amount, type, category, date, note),
budgets (category, month, limit), tags (optional). Indexed on date & category for fast reports.
- Logic: Budget utilization = spent / limit; burn-rate = month-to-date spend / elapsed days;
forecast = min( budget_limit, regression( recent_daily_spend ) × days_in_month ).
- Frontend: HTML templates (Jinja) with partials; JS uses
fetch to submit forms and refresh charts without page reloads;
Chart.js renders line (cashflow), bar (category totals), and doughnut (allocation).
- Security/Validation: CSRF tokens, server-side checks, amount/date sanitization. (Auth optional for personal demo.)
- Deployment: Gunicorn on Render (or Railway), SQLite persisted volume; environment variables for secrets.
Highlights
Fast Entry UX
Inline add/edit with default date = today, last-used category memory, and keyboard submit makes logging painless.
Insightful Analytics
Burn-rate and forecast make budgets actionable—users see if they’re likely to overshoot before it happens.
Clean Separation
Blueprint + service + DAO structure keeps views thin and makes it easy to swap storage or extend to users/auth.
What I Learned
- Designing APIs that return both HTML (for SSR) and JSON (for AJAX) simplifies progressive enhancement.
- How to structure small Flask apps for growth using blueprints, a service layer, and dependency-free validators.
- Turning simple statistics into useful features (burn-rate, linear regression) adds real value without heavy ML.
Next Steps
- CSV import/export and recurring transactions (rules engine for auto-categorization).
- User auth + roles; multi-budget support; Stripe webhook for automatic income logging.
- Forecast alternatives (exponential smoothing), savings goals, and monthly PDF summary.