Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

34 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

FinTrack

Personal finance management β€” track expenses, lent & debt, and investments with AI-powered insights.

Live Demo Version Built with React TypeScript Supabase License: MIT


What is FinTrack?

FinTrack is an open-source personal finance app built for the Bangladeshi context but usable by anyone. It combines expense tracking, a lent & debt ledger, an investment portfolio tracker, and a full AI assistant β€” all in a premium dark UI (muted Emerald & Gold) with smooth animations.

Everything is yours. Your data lives in your own Supabase project. You can export it anytime, delete it anytime, and self-host the app in under 10 minutes.

Installable as an app. FinTrack is a PWA β€” on mobile, open the site and choose "Add to Home Screen" (Android Chrome / iOS Safari) to install it like a native app, complete with its own icon and no browser address bar.


Features

πŸ’Έ Expenses

  • Add, edit, delete transactions (Expense / Income)
  • Smart category system with main groups and sub-categories
  • AI-powered category suggestion β€” type a description, Groq auto-suggests the category
  • Search, filter by category, type, payment method, and month
  • Budget limits per category with visual indicators (amber at 80%, red at 100%)
  • No-spend streak tracker with calendar heatmap
  • CSV import with column preview and Supabase bulk insert
  • Export to Excel (multi-sheet) or CSV
  • Inline expression amount field β€” type 60*4 directly into the Amount field and it evaluates live as you type
  • Floating calculator β€” a global, draggable calculator reachable from every page, with copy-to-clipboard

🏦 Lent & Debt

  • Track money you've lent and owe across people
  • Full payment history per entry with running remaining balance
  • Tabs: All Β· Lent Β· Debt Β· Summary Β· Payment Logs
  • Summary view: Total / Paid back / Remaining per person per type
  • Two-step delete confirmation on all entries

πŸ“ˆ Investments

  • Track committed capital, installment payments, and returns
  • ROI %, P&L, and portfolio total computed live
  • Return types: Profit / Capital Return / Dividend / Rent
  • Payment method + account picker on every payment and return form
  • Detail page per investment with payments and returns tabs

πŸ€– AI Insights (Powered by Groq β€” free)

All features use your own free Groq API key (14,400 requests/day, no credit card):

Feature What it does
Smart Categorization Auto-suggests category while you type the description
Anomaly Detection Flags spending spikes vs your 3-month average
Weekly Digest Friendly 7-day summary with highlights and tips
Budget vs Actual Analysis Explains WHY you're over/under budget
Spending Patterns Identifies expensive habits over 6 months
Natural Language Chat Ask "How much did I spend on food?" in plain English
Budget Recommendations Suggests realistic budgets from your actual spending
Goal-Based Plan Enter a savings goal β†’ get a month-by-month spending plan
Benchmarking Compares your spending vs typical Bangladesh household
Debt Payoff Strategy Snowball vs Avalanche analysis from your ledger data

βš™οΈ Settings & Preferences

  • Data Preferences β€” full CRUD for categories (tree view), payment methods, and accounts
  • Payment method smart picker: Cash β†’ auto account Β· MFS β†’ bKash/Nagad/Rocket Β· Card/Bank Transfer β†’ bank selector
  • Add custom payment methods and bank accounts
  • Budget limits management
  • CSV import with drag-and-drop
  • Full data export + account deletion (30-day soft-delete recovery)

πŸ“Š Analytics

  • Monthly trend (12 months, expense + income lines)
  • Category donut for selected month
  • Daily spending bars
  • Payment method split
  • Budget vs actual horizontal bars
  • No-spend calendar heatmap with streak counter
  • 6 KPI cards: Spent Β· Income Β· Net Β· Daily avg Β· Yearly total Β· No-spend streak

Tech Stack

Layer Tech
Framework React 19 + Vite 6
Language TypeScript 5.7 (strict, .tsx/.ts only)
Styling Tailwind CSS v4 (CSS-first, no config file)
Routing TanStack Router v2 (type-safe)
Data fetching TanStack Query v5
State Zustand
Animations Framer Motion v12
Forms React Hook Form v8 + Zod v4
Charts Recharts
Icons Lucide React
Backend Supabase (PostgreSQL 16 + Auth + RLS)
AI Groq API (llama-3.1-8b-instant, browser-direct BYOK)
Export SheetJS (Excel) + Papa Parse (CSV)
PWA vite-plugin-pwa (installable, offline app-shell caching)
Hosting Vercel
Package manager pnpm

Self-Hosting in 10 Minutes

Prerequisites

  • Node.js 18+, pnpm
  • A Supabase account (free tier works)
  • A Vercel account (free tier works)

1. Clone and install

git clone https://github.com/isttiiak/FinTrack.git
cd FinTrack
pnpm install

2. Set up Supabase

  1. Create a new Supabase project
  2. Go to SQL Editor β†’ paste and run supabase/migrations/001_initial_schema.sql
  3. Copy your project URL and anon key from Settings β†’ API

3. Configure environment

cp .env.example .env.local

Edit .env.local:

VITE_SUPABASE_URL=https://your-project.supabase.co
VITE_SUPABASE_ANON_KEY=your-anon-key

4. Run locally

pnpm dev

Visit http://localhost:5173

5. Deploy to Vercel

pnpm build   # verify it builds cleanly

Then import the GitHub repo in Vercel and add the two environment variables.


Setting up AI Features

  1. Go to console.groq.com β†’ sign up free β†’ API Keys β†’ Create API key
  2. In FinTrack: Settings β†’ AI Insights β†’ paste your key β†’ Save
  3. Navigate to Analytics β†’ ✨ AI Insights

Your key is stored only in your browser's localStorage β€” never sent to any server other than Groq directly.


Project Structure

src/
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ ai/           ← AIHub (all 10 AI features)
β”‚   β”œβ”€β”€ common/       ← DeleteButton, ConfirmDialog, PaymentMethodPicker, Logo, ToastContainer
β”‚   β”œβ”€β”€ expenses/     ← ExpenseForm, ExpenseCard, CategoryCombobox, CategoryManagerModal
β”‚   β”œβ”€β”€ investments/  ← InvestmentForm, ReturnForm, InvestmentPaymentForm
β”‚   β”œβ”€β”€ layout/       ← AppShell, Sidebar, MobileNav
β”‚   └── ledger/       ← PersonCard, LedgerSummaryTab, LedgerPaymentLogs
β”œβ”€β”€ hooks/
β”‚   β”œβ”€β”€ useAICategorySuggest.ts  ← Smart categorization
β”‚   β”œβ”€β”€ useExpenses.ts
β”‚   β”œβ”€β”€ useInvestments.ts
β”‚   β”œβ”€β”€ useLedger.ts
β”‚   β”œβ”€β”€ useCategories.ts
β”‚   β”œβ”€β”€ useNoSpendStreak.ts
β”‚   └── useDemoGuard.ts          ← Blocks writes in demo mode with a friendly toast
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ groq.ts        ← Groq API client
β”‚   β”œβ”€β”€ aiContext.ts   ← AI prompt data builders
β”‚   β”œβ”€β”€ constants.ts   ← Payment methods, accounts, categories
β”‚   β”œβ”€β”€ export.ts      ← Excel + CSV export
β”‚   └── utils.ts
β”œβ”€β”€ pages/
β”‚   β”œβ”€β”€ AnalyticsPage.tsx
β”‚   β”œβ”€β”€ DataSettingsPage.tsx   ← Category/method/account CRUD
β”‚   β”œβ”€β”€ DashboardPage.tsx
β”‚   β”œβ”€β”€ ExpensesPage.tsx
β”‚   β”œβ”€β”€ InvestmentDetailPage.tsx
β”‚   β”œβ”€β”€ InvestmentsPage.tsx
β”‚   β”œβ”€β”€ LedgerPage.tsx
β”‚   β”œβ”€β”€ PersonDetailPage.tsx
β”‚   └── SettingsPage.tsx
β”œβ”€β”€ stores/
β”‚   β”œβ”€β”€ authStore.ts
β”‚   β”œβ”€β”€ confirmStore.ts  ← Two-step delete confirmation
β”‚   β”œβ”€β”€ demoStore.ts
β”‚   └── uiStore.ts
└── types/
    β”œβ”€β”€ database.types.ts
    β”œβ”€β”€ expense.types.ts
    β”œβ”€β”€ investment.types.ts
    └── ledger.types.ts

Database Schema (key tables)

Table Purpose
profiles User profile (name, avatar, currency, timezone)
categories Expense/income categories with main groups
budget_limits Monthly spend cap per category
transactions All expense and income entries
persons People in the lent/debt ledger
person_ledger Individual lent/debt entries
ledger_payments Payments against ledger entries
investments Investment portfolio entries
investment_payments Installment payments into investments
investment_returns Returns received from investments

All tables have Row Level Security β€” users can only see their own data.


Contributing

  1. Fork the repo
  2. Create a branch: git checkout -b feature/your-feature
  3. Make your changes (TypeScript strict, .tsx only)
  4. Run pnpm build to verify it type-checks and builds cleanly
  5. Open a PR

Code conventions

  • No comments unless the WHY is non-obvious
  • No unused variables (TypeScript strict enforces this)
  • Inline <style> in components is fine (no Tailwind classes for custom UI)
  • All animations via Framer Motion
  • All forms via React Hook Form + Zod

License

MIT β€” fork it, self-host it, build on it.


Built by Istiak Islam

Releases

Packages

Contributors

Languages