How abhishek-jose7/finance-tracker works
Project Type and Purpose
• This is a full-stack personal finance web application (“FinAI”) built on Next.js 15 with an App Router.
• It integrates React-based frontend pages, AI workflows for budget insights (via Google Gemini/Genkit), and a Supabase-backed database.
High-Level Components
a. Frontend (Next.js App)
• Pages & Layouts: src/app/ (main layout group, sign-in, sign-up, global layout/styles)
• React Components: src/components/ organized by feature (dashboard, budget, transactions, AI assistant, onboarding, shared UI)
• Styling: Tailwind CSS (tailwind.config.ts, src/app/globals.css), Radix UI + shadcn/ui
b. Backend/API (Next.js Serverless Routes & Lib)
• API Routes: src/app/api/ (debug, test-ai, test-sync)
• AI Flows & Orchestration: src/ai/ (genkit.ts, flows/ for budget analysis, recommendations, alerts, etc.)
• Data Layer: src/lib/db-actions.ts, src/lib/file-processing.ts, src/lib/supabase.ts
• Business Logic & Utilities: src/lib/utils.ts, src/lib/data.ts, type definitions
c. Database (Supabase)
• Schema & Scripts: supabase-schema.sql, migration scripts (supabase-*.sql)
• Data Access: via src/lib/supabase.ts and db-actions.ts
d. External Services
• Google Gemini AI: accessed through Genkit (src/ai/genkit.ts)
• Authentication/Session: Clerk (via ClerkClientProvider.tsx)
• Deployment: Vercel (with vercel.json) or Docker
Component Interactions & Data Flows
• User interacts with React pages/components →
Next.js serverless API or direct client-side calls for data fetch/submit →
Data layer reads/writes Supabase →
For AI features, API handlers invoke Genkit workflows →
Genkit forwards prompts to Google Gemini →
Gemini returns AI responses which are processed by the flow modules →
Results are sent back to frontend and rendered in UI components.
Architectural Patterns & Principles
• Feature-based module structure: Each domain (budget, dashboard, transactions, assistant) has its own folder under components/ and app/.
• Separation of concerns: UI components vs. AI flows vs. data access/utilities.
• Serverless functions for API endpoints: Lightweight, per-feature routes.
• Layered approach: Presentation (React) → Application logic (AI flows, routes) → Persistence (Supabase) → External AI service.
A. Frontend Group
• App Sidebar, Header, ChatInterface, BudgetPlanner, TransactionTable, Chart Components
B. Backend/API Group
• /api/test-ai, /api/test-sync, /api/debug
• AI Flow Modules (analyze-budget, recommendations, alerts, explain-transaction)
C. Data Access Group
• Supabase Client, DB-actions module, SQL scripts
D. External Services
• Google Gemini AI (via Genkit)
• Clerk Authentication
E. Deployment & DevOps
• Dockerfile, docker-compose.yml, Vercel config
Final Advice
• How data and control flow between components.
• Custom patterns (e.g., Zod schema validation in AI flows).
• Keep it high-level but include enough detail so a new engineer can understand where to find code for each operation.