A personal finance management app built with Next.js. Track your net worth, plan monthly budgets, and get AI-powered financial guidance—all with your data stored locally in your browser.
Note: This is a personal project I put together for fun. It's not intended for serious financial planning or production use.
- Net Worth Tracking - Monitor all your accounts (bank accounts, investments, credit cards, loans) in one place with automatic net worth calculations
- Budget Planning - Create monthly budgets with income, bills, debt payments, and savings goals. Track expected vs actual amounts
- Historical Snapshots - Save monthly snapshots to track your financial progress over time
- Budget Trends - Visualize how your income, expenses, and savings change month-over-month
- AI Advisor - Get personalized financial guidance based on your budget and net worth data (requires OpenAI API key)
- Privacy-First - All data is stored locally in your browser using IndexedDB. Nothing is sent to external servers except AI chat messages
- Framework: Next.js 16 with App Router
- UI: Tailwind CSS + Radix UI primitives
- Database: Dexie.js (IndexedDB wrapper)
- Charts: Recharts
- AI: OpenAI API
- Node.js 18+ or Bun
- OpenAI API key (optional, for AI Advisor feature)
-
Clone the repository:
git clone https://github.com/yourusername/kainance.git cd kainance -
Install dependencies:
npm install # or bun install -
Create a
.env.localfile for the AI Advisor (optional):OPENAI_API_KEY=your_api_key_here
-
Start the development server:
npm run dev # or bun dev -
Open http://localhost:3000 in your browser
kainance/
├── app/ # Next.js App Router pages
│ ├── accounts/ # Account management pages
│ ├── ai/ # AI Advisor page
│ ├── api/ # API routes
│ ├── budget/ # Budget planner page
│ └── ...
├── components/
│ ├── budget/ # Budget-related components
│ └── ui/ # Reusable UI components
├── lib/
│ ├── db/ # Database configuration (Dexie)
│ ├── hooks/ # React hooks
│ ├── types/ # TypeScript types and constants
│ └── utils/ # Utility functions
└── ...
All monetary amounts are stored as integers in cents to avoid floating-point precision issues. Use the formatting utilities to display amounts:
import { formatCurrency } from '@/lib/utils/format';
formatCurrency(150000); // "$1,500.00"Months are identified by keys in "YYYY-MM" format (e.g., "2025-01"). Use the month key utilities:
import { getMonthKey, formatMonthLabel } from '@/lib/utils/month-key';
getMonthKey(new Date()); // "2025-01"
formatMonthLabel('2025-01'); // "January 2025"Accounts are categorized as either assets or liabilities. The category is automatically determined based on the account type:
- Assets: Checking, Savings, Cash, Brokerage, 401(k), IRA, HSA, Crypto, Real Estate, Vehicle
- Liabilities: Credit Card, Loan, Mortgage, Student Loan, Auto Loan, 401(k) Loan
npm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
npm run lint # Run ESLintMIT