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*
Sign in to leave a comment

Private, local-first finance tracking in Indian Rupees.
Income less expenses this month
Income and expenses from the last six months will appear here when transactions are available.
Deterministic score from local records
More local activity is needed to calculate a score. Add income, expenses, and budgets to build a useful picture.
No local transactions to review yet.
0Category spending will appear here as transactions are recorded.
No transactions yet. Your recent activity will appear here.

FinSight · Personal finance, kept local
Private, local-first finance tracking in Indian Rupees.
Transactions are available after you sign in. Offline access cannot complete that step.
Balance
No local data yet
No comments yet. Be the first!