A modern personal finance management system built with Next.js 14, TypeScript, and Prisma. Designed for home use to manage debts, savings, budgets, investments, and financial goals with intelligent insights and recommendations.
- ๐ Transaction Tracking - Income and expenses with categories
- ๐ณ Account Management - Multiple bank accounts with reconciliation
- ๐ฐ Debt Management - Track loans with EMI calculations
- ๐ฏ Savings Goals - Set and monitor savings targets
- ๐ Budget Planning - Monthly and yearly budgets
- ๐ Investment Tracking - SIP and lump sum investments with returns
- ๐ Analytics - Charts and insights with spending trends
- ๐งฎ Financial Calculators - EMI, SIP, Prepay vs Invest
- ๐ฌ WhatsApp Integration - Manage finances via WhatsApp (optional)
- Frontend: Next.js 14, React 18, TypeScript, Tailwind CSS
- Backend: Next.js API Routes, Prisma ORM
- Database: SQLite (easily switchable to PostgreSQL)
- Charts: Recharts
- AI: Google Gemini Pro (optional for WhatsApp)
# Install dependencies
npm install
# Set up database
npm run db:push
npm run db:generate
# Initialize with default data
npm run db:init
# Start development server
npm run devVisit http://localhost:3000 to access the dashboard
Import your historical data from Excel:
# Place HomeBudget.xlsx and LoanDetails.xlsx in project root
npm run db:migrateโโโ app/ # Next.js app directory
โ โโโ (dashboard)/ # Dashboard pages (transactions, debts, etc.)
โ โโโ api/ # API routes (32+ endpoints)
โ โโโ globals.css # Global styles
โโโ components/ # React components
โ โโโ forms/ # Form components
โโโ lib/ # Utilities and helpers
โ โโโ calculations.ts # Financial calculations (EMI, SIP, etc.)
โ โโโ decision-engine.ts # Financial recommendations
โ โโโ ai-parser.ts # AI-powered message parsing
โ โโโ whatsapp-parser.ts # WhatsApp message parsing
โโโ modules/ # Feature modules (modular monolith)
โ โโโ transactions/ # Transaction management
โ โโโ debts/ # Debt management
โ โโโ savings/ # Savings goals
โ โโโ budget/ # Budget management
โ โโโ accounts/ # Account management
โ โโโ investments/ # Investment tracking
โโโ prisma/ # Database schema and migrations
โโโ scripts/ # Utility scripts
โ โโโ init-db.ts # Database initialization
โ โโโ migrate-sheets.ts # Excel data migration
โโโ shared/ # Shared services
โโโ cache/ # Caching service
โโโ events/ # Event system
โโโ queue/ # Background jobs
/api/transactions- Transaction CRUD/api/debts- Debt management/api/savings- Savings goals/api/budget- Budget management/api/accounts- Account management/api/investments- Investment tracking
/api/analytics/spending-trend- Spending over time/api/analytics/category-breakdown- Expenses by category/api/analytics/net-worth-trend- Net worth progression
/api/dashboard/stats- Dashboard statistics/api/advice- Financial recommendations/api/summary- Overall financial summary/api/whatsapp/webhook- WhatsApp integration
For WhatsApp integration setup, see WHATSAPP_SETUP_GUIDE.md.
Supported Commands:
add expense 500 food lunch
add income 50000 salary
balance
show debts
show savings
how much did I spend on food?
can I afford 20000?
Current: No authentication (home use, single household)
Production: See AUTH_IMPLEMENTATION_GUIDE.md for multi-user deployment
npm run build
pm2 start npm --name "finance-app" -- startdocker build -t finance-app .
docker run -p 3000:3000 finance-appCreate .env file:
# Database (optional, defaults to SQLite)
DATABASE_URL="file:./prisma/finance.db"
# Google Cloud (optional, for AI features)
GOOGLE_CLOUD_PROJECT=your-project-id
GOOGLE_CLOUD_LOCATION=us-central1
# NextAuth (optional, for production multi-user)
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your-secret-here- EMI Calculator: Calculate monthly payments for loans
- SIP Calculator: Project investment returns with step-up
- Prepay Analyzer: Compare prepayment vs investment returns
- Spending trends over last 6 months
- Category-wise expense breakdown
- Net worth progression
- Budget vs actual comparison
- Investment returns tracking
- Affordability checks
- Debt payoff recommendations (snowball/avalanche)
- Budget alerts
- Savings goal progress
- Financial health score
Key models:
Transaction- Income/expense recordsAccount- Bank accountsDebt- Loans with EMI trackingSavingsGoal- Savings targetsBudget- Monthly/yearly budgetsInvestment- SIP/lump sum investmentsFinancialYear- Financial year trackingFinancialAlert- Automated alerts
npm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
npm run db:generate # Generate Prisma client
npm run db:push # Push schema to database
npm run db:init # Initialize with seed data
npm run db:migrate # Import Excel dataBuilt with modular monolith architecture for clean separation of concerns while maintaining simplicity of deployment.
Architecture:
- API Layer: Next.js API routes
- Service Layer: Business logic (modules/*/services)
- Repository Layer: Database access (modules/*/repositories)
- Shared Services: Cache, events, queue
- โ All numeric inputs validated
- โ No NaN can enter database
- โ XLSX vulnerability patched
- โ SQL injection prevention (Prisma)
- โ Database queries optimized
- โ Caching implemented
- โ Atomic operations for concurrency
- โ Transaction-wrapped deletes
- โ Comprehensive validation
- โ Race condition prevention
- โ Atomic increment operations
- โ Foreign key constraints
MIT License - Free to use for personal and commercial purposes.
For issues or questions, check the documentation files:
WHATSAPP_SETUP_GUIDE.md- WhatsApp integrationAUTH_IMPLEMENTATION_GUIDE.md- Multi-user authentication
Status: โ
Production Ready
Version: 1.0.0
Build: โ
Successful (0 errors, 0 warnings)
Made with โค๏ธ for better financial management.