How waqar741/fintrac works
Project Type & Purpose
• FinTrac is a full-stack, single-page web application for personal finance tracking.
• Frontend: React + TypeScript + Vite + Tailwind CSS, with client-side routing and contexts (AuthContext, ThemeContext).
• Backend: Supabase (hosted Postgres, Auth, real-time, storage, migrations).
File-Structure Analysis
• src/: React app entry (main.tsx, App.tsx), components (AIChat, Layout, ProtectedRoute), contexts, pages (Dashboard, Transactions, Goals, etc.), and supabase client wrapper (src/lib/supabase.ts).
• supabase/migrations/: SQL files that define and evolve the database schema.
• Config files: vite.config.ts, tailwind.config.js, tsconfig*.json, vercel.json for deployment.
README Insights
• Although the README is minimal, the presence of Supabase migrations plus a complete React directory implies a BaaS-backed SPA with authentication, data storage, and real-time features.
a. Main Components
• Browser Client (SPA)
• CI/CD & Hosting (Vercel)
• Supabase Backend Services
• Auth Service
• Postgres Database (with migrations)
• Real-time (WS)
• Storage (if used for images)
b. Relationships & Data Flows
1. User ↔ Browser UI (React + Tailwind)
2. UI → Vercel (static asset hosting)
3. UI → Supabase Auth (signup, login)
4. Authenticated UI → Supabase Postgres API (CRUD for accounts, transactions, goals, group expenses)
5. Real-time updates via Supabase subscriptions
6. Supabase migrations manage schema lifecycle
c. Architectural Patterns & Principles
• SPA with client-side routing (React Router in ProtectedRoute)
• Context API for cross-cutting concerns (auth state, theming)
• BaaS integration: no custom backend servers, direct client-to-Supabase comms
• Infrastructure-as-Code via migration scripts
d. Key Technologies
• React, TypeScript, Vite (dev server & bundler)
• Tailwind CSS
• Supabase client library (src/lib/supabase.ts)
• Vercel for CI/CD and global CDN hosting