A modern personal finance app to track accounts and transactions, visualize spending, and use AI to speed up expense logging from chat and files.
- Secure auth and session management with Supabase
- Dashboard with summary cards and spending charts
- Account management (create, update, delete with balance safety checks)
- Transaction management (add, edit, delete, transfer between accounts)
- Categories with budgeting support
- AI assistant for finance actions and query-style insights
- File and image parsing for transaction extraction
- Protected app routes with middleware-based redirects
- Responsive marketing landing page and auth flows
personal-finance-analyzer/
|- app/
| |- (marketing)/ # Public landing page
| |- (auth)/ # Login, signup, reset/update password
| |- app/(protected)/ # Authenticated finance app
| |- actions/ # Server actions (accounts, transactions, AI, etc.)
| |- api/ai/ # AI chat + file parsing API routes
| |- auth/callback/ # Supabase auth callback route
|- components/
| |- ui/ # Reusable UI primitives (shadcn/radix)
| |- home/ # Dashboard widgets/charts/forms
| |- auth/ # Auth forms
| |- ai/ # AI chat and confirmation UI
|- hooks/ # React Query hooks and app hooks
|- lib/ # Shared utilities, auth context, types, Supabase clients
|- scripts/ # Utility scripts (schema check)
|- middleware.ts # Route protection and redirects
- Next.js 16 (App Router)
- React 19 + TypeScript 5
- Tailwind CSS 4
- Supabase (
@supabase/ssr,@supabase/supabase-js) - Middleware-based auth guards
- TanStack Query (
@tanstack/react-query)
- shadcn/ui + Radix UI primitives
- Lucide icons
- Recharts for analytics and trends
date-fnsfor date utilities
- Cloudflare AI (Gemma model) for conversational finance assistant
mammothfor DOCX parsingunpdffor PDF parsing
- Node.js 20+
- npm
- Supabase project
- (Optional) Cloudflare account + AI token for AI features
npm installCreate a .env.local file in the project root:
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY=your_supabase_publishable_or_anon_key
# Optional: used by scripts/check-schema.ts
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_publishable_or_anon_key
# Optional: enable AI routes
CLOUDFLARE_ACCOUNT_ID=your_cloudflare_account_id
CLOUDFLARE_AI_API_TOKEN=your_cloudflare_ai_api_tokenMake sure your Supabase database includes the tables used by the app:
accountstransactionscategoriesai_messages
Each table should include a user_id column and timestamps as needed by your schema.
npm run devOpen http://localhost:3000.
npm run dev- Start the local dev servernpm run build- Create production buildnpm run start- Run production servernpm run lint- Run ESLint
- Public routes include landing and auth pages
/appand/app/*are protected- Unauthenticated users are redirected to
/login - Authenticated users trying to access
/loginor/signupare redirected to/app
- AI features are optional and require Cloudflare AI credentials.
- The app uses server actions and API routes, so environment variables must be configured before startup.