How shubankar-sridhar/fintrack works
Purpose and Deployment
FinTrack is a single-user-session personal finance manager for accounts, transactions, budgets, savings, recurring obligations, loans, and reporting. The production shape is a React SPA served as compiled static assets by a Flask backend, with Render deployment configuration in render.yaml. Key runtime entry points are backend/app.py and src/main.jsx.
Frontend Application Shell
src/main.jsx mounts the React application; src/App.jsx owns authentication state, shared data refresh behavior, and section-level routing. Once authenticated, the shell combines navigation and user controls from src/components/Sidebar.jsx and src/components/Header.jsx; unauthenticated users are routed to src/components/AuthScreen.jsx.
API Boundary and Authentication
The browser uses a centralized fetch layer in src/utils/api.js to call Flask /api/* endpoints. backend/app.py is the REST and static-serving boundary: it handles registration, login/logout, session-based authentication, user-scoped authorization, CRUD operations, transactional finance actions, export/reset, and analytics aggregation. Passwords are SHA256-hashed; Flask sessions carry authenticated identity.
Persistence and Financial Domain
backend/database.py owns SQLite initialization and schema access. users is the tenancy root; accounts, categories, expenses, income sources, recurring payments, savings goals, and EMIs are associated with a user, with transaction-related records additionally referencing accounts/categories where relevant. The backend enforces business mutations such as account balance changes, transfers, income receipts, recurring processing, savings contributions, and EMI payments.
Transaction and Obligation Workflows
Expense, income, account, category, recurring, savings, and EMI screens each collect input and invoke corresponding APIs:
src/components/Expenses.jsx, src/components/Income.jsx, and src/components/Accounts.jsx manage core cash-flow records and account transfers.
src/components/Recurring.jsx, src/components/Emis.jsx, and src/components/Savings.jsx manage scheduled liabilities and goal allocation. Date/frequency handling is backed by Python dateutil, with due-payment state exposed to navigation and dashboard views.
Dashboard and Analytics Read Models
The dashboard consumes summary, recent activity, and monthly aggregate data to present the current financial state in src/components/Dashboard.jsx. Analytics requests backend-generated monthly income/expense, category-spend, and daily-spend aggregates, rendered through Chart.js in src/components/Analytics.jsx. This keeps aggregation and user-data filtering server-side while visualization remains client-side.
Build and Runtime Infrastructure
Development uses Vite/React from package.json and vite.config.js; its production build is committed/served under backend/static/index.html and backend/static/assets/. Backend dependencies and production WSGI hosting are defined by backend/requirements.txt, including Flask, SQLite access, date utilities, and Gunicorn. No separate queue, scheduler, or external database service is represented; due recurring work is initiated through application API actions.
Main entry points: App.jsx Application shell · api.js API client · app.py REST & static server · database.py Schema & database access
Components 18
React frontend
- React entry
src/main.jsx - Application shell · Owns auth state and shared refresh behavior.
src/App.jsx - Auth screen
src/components/AuthScreen.jsx - Navigation & header
src/components/Sidebar.jsx - API client
src/utils/api.js - Cash-flow views · Expenses, income, accounts, and transfers.
src/components/Expenses.jsx - Obligation views · Recurring payments, EMIs, and savings goals.
src/components/Recurring.jsx - Dashboard
src/components/Dashboard.jsx - Analytics charts
src/components/Analytics.jsx
Flask backend
- REST & static server · Serves SPA assets and user-scoped /api endpoints.
backend/app.py - Finance mutations · Applies balances, transfers, receipts, obligations, savings, and EMI payments.
backend/app.py - Analytics aggregation · Builds summary, activity, and spending aggregates.
backend/app.py
SQLite data
- Schema & database access
backend/database.py - User-scoped finance data · Users root accounts, categories, transactions, obligations, and goals.
Build & deployment
- Vite production build
vite.config.js - Compiled SPA assets
backend/static/index.html - Gunicorn backend runtime
backend/requirements.txt - Render deployment
render.yaml
Connections 22
- React entry → Application shell: mounts
- Application shell → Auth screen: unauthenticated
- Application shell → Navigation & header: authenticated shell
- Application shell → Cash-flow views: routes to
- Application shell → Obligation views: routes to
- Application shell → Dashboard: routes to
- Application shell → Analytics charts: routes to
- Auth screen → API client: auth requests
- Cash-flow views → API client: CRUD and transfers
- Obligation views → API client: payment actions
- Dashboard → API client: summary reads
- Analytics charts → API client: aggregate reads
- API client → REST & static server: /api/*
- REST & static server → Finance mutations: transactional actions
- REST & static server → Analytics aggregation: analytics requests
- Finance mutations → Schema & database access: persists changes
- Analytics aggregation → Schema & database access: queries aggregates
- Schema & database access → User-scoped finance data: reads and writes
- Vite production build → Compiled SPA assets: emits
- REST & static server → Compiled SPA assets: serves
- Gunicorn backend runtime → REST & static server: hosts
- Render deployment → Gunicorn backend runtime: deploys