finance-expense-tracker

byCharan

Act as a Principal Full-Stack Engineer and Staff Product Designer (with Apple Design Award and flagship fintech design experience). Build a complete, production-grade, 100% offline, local-first personal finance and expense tracker web application called **"FinSight"** using **React, TypeScript, Tailwind CSS v4, Motion (`motion/react`), Lucide Icons, Recharts**, and client-side file parsing (**`papaparse`**, **`xlsx`**, **`pdfjs-dist`** with a local Vite-bundled worker—zero external CDN). --- ### 1. CORE ARCHITECTURE, MODULAR STRUCTURE & 100% LOCAL PRIVACY - **Strict Offline Persistence (`localStorage` + `IndexedDB` mirror):** Store all transactions, category budgets, savings goals, custom categories, and theme settings locally in the browser with automatic two-way sync between `localStorage` and an `IndexedDB` store (`finsight_db`). Zero backend API calls, zero external LLM calls, and zero user data leaving the device. - **Clean Modular File Architecture:** Organize cleanly into: - `src/types/finance.ts` (strict TypeScript interfaces for Transaction, Category, CustomCategory, Budget, SavingsGoal, ParsedStatementRow) - `src/data/seedData.ts` (6 months of realistic Indian Rupee demo transactions, budgets, goals, and sample custom category) - `src/utils/formatters.ts` (`en-IN` currency formatting, compact `₹1.2L` / `₹24k` chart helpers, date/time helpers) - `src/utils/statementParser.ts` (high-precision Indian Bank SMS / UPI receipt extractor + CSV, XLSX, and PDF coordinate-based row reconstructor) - `src/utils/insightsEngine.ts` (100% deterministic offline financial health scorer & rule-based coach) - `src/hooks/useFinanceStore.ts` (central state + `localStorage` & `IndexedDB` persistence + duplicate detection + backup/restore/reset) - `src/components/...` (modular UI components for TopBar, NavDrawer, HeroCard, Charts, Modals, and all 8 Views) - **INR Currency Only (`₹`):** Format every currency value in Indian Rupees (`₹`) using `en-IN` grouping (`₹1,24,500`), compact chart labels (`₹1.2L`, `₹24k`), and `tabular-nums lining-nums`. - **Pre-loaded 6-Month Demo Data:** Automatically seed 6 months of realistic Indian Rupee (`₹`) transactions (salary, freelance, dividends, rent, Swiggy/Zomato/Darshini, Uber/Metro, BESCOM/APEPDCL/Airtel, Netflix/Spotify/Apple One, impulse buys ⚡, plus a sample custom category `Coffee & Chai ☕`), category budgets, and savings goals on first load so every chart and metric looks alive immediately. - **Slide-Out Drawer Data Controls:** - `Backup data` — downloads a timestamped `.json` snapshot (`{ version: 2, exportedAt, transactions, budgets, goals, customCategories }`). - `Restore backup` — uploads, schema-validates, and restores both v1 and v2 `.json` backups. - `Reset demo data` — confirmation dialog that restores the 6-month `₹` demo dataset. - **Theme Support:** Dark mode by default (`class="dark"` on `<html>`, Tailwind v4 `@custom-variant dark (&:where(.dark, .dark *));`) with a smooth animated Dark/Light theme toggle in the top bar. --- ### 2. LUXURY FINTECH DESIGN SYSTEM & EDITORIAL TYPOGRAPHY - **Bespoke Typography (Load via Google Fonts in `index.html`, zero generic system-default UI):** - **Display & Editorial Serif (`Playfair Display`, weights 500, 600, 700, italic 500):** Brand wordmark (`FinSight`), top bar screen titles, hero headline (`Your money, in focus.`), card headers, modal/dialog titles, and section headings (`letter-spacing: -0.025em`, `line-height: 1.18`). - **Precision UI & Financial Numerals (`Inter`, weights 400, 500, 600, 700):** All body copy, form inputs, table rows, chips, and CTA buttons. Enforce `font-variant-numeric: tabular-nums lining-nums` on every `₹` amount, percentage, and chart axis so digits never jitter or misalign. - **Micro-Labels & Kickers:** `11px` uppercase `Inter` SemiBold with `letter-spacing: 0.10em` above every KPI and section. - **Layered Surface Architecture & Machined Depth (No Flat Boxes):** - *Dark Mode (Default):* Canvas `#080E10`, Primary Card `#0F191C`, Elevated Glass `#152328/80` with `backdrop-blur-xl`, Hairline Border `rgba(255, 255, 255, 0.07)`, Emerald Primary `#10B981`, Coral Expense `#F43F5E`, Amber Warning/Impulse `#F59E0B`, Text Primary `#F8FAFC`, Text Secondary `#94A8AF`, Text Muted `#60737A`. - *Light Mode:* Warm Alabaster Canvas `#F4F7F6`, Crisp White Card `#FFFFFF`, Elevated Surface `#EBF1EF`, Hairline Border `rgba(15, 23, 42, 0.08)`, Deep Emerald `#059669`, Coral `#DC2626`, Amber `#D97706`, Text `#0F172A`. - **1px Top Rim-Light & Glass Elevation:** Give primary cards a subtle top inner bevel (`shadow-[inset_0_1px_0_0_rgba(255,255,255,0.06)]` in dark mode) and soft layered drop shadows in light mode, plus a frosted-glass sticky top header (`backdrop-blur-md`). --- ### 3. FLAGSHIP INTERACTIVITY, MOTION & FLOATING TOASTS - **Atmosphere & Tactile Physics (`motion/react`):** - Subtle breathing radial emerald glow behind the Dashboard hero balance card (`prefers-reduced-motion` safe). - Tactile spring physics on interactive cards, filter pills, and buttons (`whileHover={{ y: -2 }}`, `whileTap={{ scale: 0.97 }}`, `stiffness: 420, damping: 28`). - Shared-element `layoutId` sliding highlight pills for segmented toggles and active filter tabs. - **Kinetic Data Visualizations:** - Smooth `requestAnimationFrame` count-up tickers for hero balance, KPI metrics, and health score on load/update. - Staggered spring entrance animations for dashboard cards, animated horizontal progress bars, custom frosted-glass Recharts tooltips, and an animated SVG semi-circular radial gauge sweep (`0–100`). - **Floating Pill Popup Toasts:** Top-center spring pill notifications with status icons when saving/editing/deleting transactions, creating custom categories, updating budgets/goals, importing statements/UPI messages, or backing up/restoring/resetting data. --- ### 4. ADD / EDIT TRANSACTION + CUSTOM CATEGORY DIALOG IN "OTHER" - Prominent emerald `+ Add transaction` pill button in the top bar opening an Add/Edit Transaction modal/sheet: - Expense / Income `layoutId` segmented toggle, numeric `₹` input, Category pill grid (emojis & accent colors), `datetime-local` Date & Time picker, Bank/Payment Source dropdown (`HDFC`, `SBI`, `ICICI`, `Axis`, `Kotak`, `IDFC`, `Union Bank`, `IPPB`, `GPay`, `PhonePe`, `Paytm`, `BHIM`, `CRED`, `Navi Pay`, `Cash`, preserving custom imported sources on edit), Note input, and checkboxes for `Recurring` and `Impulse buy ⚡`. - **Custom Category Dialog Inside "Other":** Tapping `Other` (or `Other Income`) opens a nested animated **Custom Category** dialog offering: - **Use Other / Other Income**, OR - **Add & Select** to create a custom category with **Name**, **Emoji picker**, and **Accent Color picker**. - Custom categories persist locally alongside built-in categories (`Food`, `Transport`, `Education`, `Rent`, `Bills`, `Shopping`, `Entertainment`, `Health`, `Travel`, `Subscriptions`, `Other` | `Salary`, `Freelance`, `Dividends`, `Other Income`) and propagate across **Budgets** (with a `Custom` badge), **Add/Edit Transaction**, **Transactions** filters, **Dashboard**, **Analytics**, **Waste Detector**, and **AI Insights**. --- ### 5. CORE FLAGSHIP FEATURE: AUTOMATIC INDIAN BANK SMS & UPI MESSAGE EXTRACTOR + STATEMENT IMPORTER - **One-Tap Access Everywhere:** Place a prominent **`Paste Bank SMS / UPI`** quick-action pill right next to `+ Add transaction` in the top bar (and on the Dashboard hero card) that opens/jumps straight to the SMS & UPI Extractor, alongside the dedicated **Import Statement** view. - **High-Precision SMS & Copied UPI Receipt Parser (`src/utils/statementParser.ts`):** - **Bulk & Multi-Line Support:** Users can paste a single SMS, 20+ mixed bank SMS alerts separated by blank lines, or multi-line copied receipts from **GPay, PhonePe, Paytm, BHIM, CRED, and Navi Pay**. - **Accurate Date & Time Extraction:** - Extracts exact dates across all Indian bank formats: `DD-MM-YYYY`, `DD/MM/YY`, `DD-MMM-YYYY` (e.g., `21-Nov-2026`, `21Nov26`), `YYYY-MM-DD`, and written receipt dates (`21 Nov 2026, 09:34 AM`). - Extracts exact timestamps (`HH:MM`, `HH:MM:SS`, `12-hour AM/PM` or `24-hour`) and combines them into ISO `YYYY-MM-DDTHH:mm` so transactions sort chronologically down to the minute. Falls back cleanly to the current date/time only when an SMS omits a timestamp. - **Accurate Amount, Direction & Balance Safety:** - Strips `Avl Bal`, `Avail Bal`, `Avl Limit`, `Clear Bal`, and `Total Bal` clauses **before** extracting the transaction amount so account balances are never recorded as expenses. - Parses `Rs.`, `Rs`, `INR`, and `₹` (both prefix `₹450.00` and suffix `450.00 INR`). - Enforces **debit-before-credit precedence**: messages like `"Your A/c X1234 is debited by Rs.320.00 and Swiggy UPI credited"` are strictly classified as **Expense (Debit)**, while `"credited by Rs.85,000"`, `"received Rs.500"`, or `"refund of Rs.299"` are classified as **Income (Credit)**. - **Merchant, Bank Source & Auto-Categorization Engine:** - Detects and tags the exact payment source (`HDFC`, `SBI`, `ICICI`, `Axis`, `Kotak`, `IDFC`, `Union Bank`, `IPPB`, `GPay`, `PhonePe`, `Paytm`, `BHIM`, `CRED`, `Navi Pay`). - Extracts clean merchant/payee names from `UPI/.../...`, `to VPA ...`, `at <Merchant>`, `Paid to <Name>`, or `Info: ...` and masks sensitive account/card digits (`••••1234`). - Maps merchants and keywords automatically to built-in or matching custom categories: - **Food:** *Swiggy, Zomato, Zepto, Blinkit, BigBasket, Domino's, McDonald's, KFC, Starbucks, Blue Tokai, Chai, Cafe, Bakery, Restaurant, Darshini* - **Transport:** *Uber, Ola, Rapido, Metro, BMTC, TSRTC, APSRTC, Petrol, HPCL, BPCL, IOCL, Shell, Fastag, Toll* - **Travel:** *IRCTC, IndiGo, Air India, Akasa, MakeMyTrip, Goibibo, RedBus, Hotel, OYO*

LandingDashboard
Landing

Comments (0)

No comments yet. Be the first!

Project Tasks

44 planning tasks
#1

Generate system requirement document

6m 28s0.05 cr used
Done
#2

Generate personas & user flows

0m 9s0.05 cr used
Done
#5

Architecture

0.05 cr needed
Paused
#6

Workspace task plan

0.05 cr needed
Paused
#7

Create flow for Personal finance tracker user

0m 8sCredits in parent
Done
#8

Landing

2m 40sCredits in subtasks
Done
#9

Dashboard

9m 45sCredits in subtasks
Done
#10

Transactions

9m 47sCredits in subtasks
Paused
#11

SMS Import

9m 47sCredits in subtasks
Paused
#12

Import Statement

9m 46sCredits in subtasks
Paused
#13

Waste Detector

9m 46sCredits in subtasks
Paused
#14

Analytics

9m 46sCredits in subtasks
Paused
#15

Budgets

9m 46sCredits in subtasks
Paused
#16

Savings Goals

9m 46sCredits in subtasks
Paused
#17

AI Insights

9m 46sCredits in subtasks
Paused
#18

Landing / Hero

0m 53s0.85 cr used
Done
#19

Landing / Navigation

0m 0s0.85 cr used
Done
#20

Landing / Footer

0m 0s0.85 cr used
Done
#21

Navigation

0m 15sCredits in parent
Done
#22

Footer

0m 13sCredits in parent
Done
#23

Fix Landing: Landing omits the explicitly required SMS/UPI quick action and renders an empty balance…

0m 13sCredits unavailable
Error
#24

Fix Landing review finding: Landing omits the explicitly required SMS/UPI quick action…

0m 12s0 cr used
Error
#25

Dashboard / Navigation

0m 0s0.85 cr used
Done
#26

Dashboard / Balance

2m 0s0.85 cr used
Done
#27

Dashboard / Cash Flow

1m 17s0.85 cr used
Done
#28

Dashboard / Health

0m 57s0.85 cr used
Done
#29

Dashboard / Waste

0m 47s0.85 cr used
Done
#30

Dashboard / Categories

0m 36s0.85 cr used
Done
#31

Dashboard / Activity

1m 14s0.85 cr used
Done
#32

Dashboard / Footer

0m 0s0.85 cr used
Done
#33

Transactions / Navigation

0.85 cr needed
Paused
#34

Transactions / Workspace

0.85 cr needed
Paused
#35

Transactions / Footer

0.85 cr needed
Paused
#36

Fix Dashboard: Dashboard renders without the requested preloaded demo data

3m 9sCredits unavailable
Error
#37

Fix Dashboard: The drawer's control does not download a timestamped snapshot as required; only sets an…

1m 36sCredits unavailable
Done
#38

Fix Dashboard: Is a no-op that only shows and the confirm dialog's button calls it, so the required…

2m 41sCredits unavailable
Done
#39

Fix Dashboard: The hero balance card renders the public-entry hero copy and as an on the Dashboard…

1m 19sCredits unavailable
Done
#40

Fix Dashboard review findings: Dashboard renders without the requested preloaded demo data (+3 more)

0m 41s0 cr used
Done
#41

SMS Import / SMSImport Header

0.85 cr needed
Paused
#42

SMS Import / SMSImport Workspace

0.85 cr needed
Paused
#43

SMS Import / SMSImport Footer

0.85 cr needed
Paused
#44

SMS Import / Navigation

0.85 cr needed
Paused
#45

Fix Dashboard review findings: Dashboard renders without the requested preloaded demo data (+1 more)

0m 30s0 cr used
Done
#46

Fix Dashboard review finding: Dashboard renders without the requested preloaded demo data

0m 22s0 cr used
Paused
Live
Landing design preview
Diagram Error: Diagram could not be rendered.
Live
Landing design preview
Diagram Error: Diagram could not be rendered.