Track. Analyze. Save. β The intelligent way to manage your personal finances with AI-powered receipt scanning, automated insights, and beautiful analytics.
Features β’ Tech Stack β’ Quick Start β’ Documentation β’ Contributing
Traditional budgeting apps are tedious. FinAIlytics uses AI to automate the boring stuff:
- πΈ Snap & Go β Upload receipts, let AI extract the details
- π Visual Insights β Beautiful charts show where your money goes
- π Auto-Tracking β Recurring payments handled automatically
- π§ Stay Informed β Monthly reports delivered to your inbox
- Email/password authentication with bcrypt password hashing
- JWT-based sessions with access (15min) and refresh (7d) tokens
- Secure HTTP-only cookies for refresh tokens
- Protected routes with Passport.js JWT strategy
- CRUD Operations β Create, read, update, delete transactions
- Duplicate Transactions β One-click duplication
- Bulk Import β CSV import supporting up to 300 transactions
- Advanced Filtering β By type (income/expense), keyword, recurring status
- Pagination β Efficient list handling with configurable page sizes
- Upload receipt images (JPEG/PNG, max 2MB)
- Google Gemini 2.0 Flash extracts: title, amount, date, category, payment method
- Cloudinary handles image storage and retrieval
- Review extracted data before saving
- Summary Cards β Available balance, total income, total expenses
- Savings Rate β Percentage of income saved (clamped -100% to 100%)
- Percentage Changes β Compare current vs previous period
- Line Chart β Income vs expenses over time
- Pie Chart β Category breakdown (top 3 + others)
- Date Range Presets β Today, Last 7/30 days, This/Last month, This/Last year, All time
- On-Demand Reports β Generate for any custom date range
- Automated Reports β Weekly or monthly via Resend email
- Report History β View past sent reports
- Configurable Settings β Enable/disable, set frequency
- Intervals β Daily, Weekly, Monthly, Yearly
- Auto-Processing β Cron job runs hourly to create instances
- Smart Scheduling β Automatically calculates next occurrence
- Dark/Light Theme β Toggle via settings
- Responsive Design β Works on mobile and desktop
- Modern Components β Built with shadcn/ui and Radix UI
- Loading States β Skeleton loaders for better UX
| Technology | Purpose |
|---|---|
| React 18 | UI Framework |
| Vite | Build Tool |
| TypeScript | Type Safety |
| Redux Toolkit + RTK Query | State Management & Data Fetching |
| TailwindCSS | Styling |
| shadcn/ui + Radix UI | Component Library |
| Recharts | Data Visualization |
| React Router DOM | Routing |
| React Hook Form + Zod | Form Handling |
| date-fns | Date Utilities |
| Technology | Purpose |
|---|---|
| Node.js | Runtime |
| Express.js | Web Framework |
| TypeScript | Language |
| MongoDB + Mongoose | Database |
| Passport.js (JWT) | Authentication |
| Zod | Input Validation |
| node-cron | Job Scheduling |
| Service | Purpose |
|---|---|
| Google Gemini 2.0 Flash | AI Receipt Scanning |
| Cloudinary | Image Storage & CDN |
| Resend | Transactional Email |
- Node.js 18+
- MongoDB (local or Atlas)
- Cloudinary account (for receipts)
- Google Gemini API key (for AI)
- Resend API key (for emails, optional in dev)
# Clone the repository
git clone https://github.com/yourusername/finailytics.git
cd finailytics
# Install backend dependencies
cd backend
npm install
# Install frontend dependencies
cd ../client
npm installNODE_ENV=development
PORT=8000
BASE_PATH=/api
# MongoDB
MONGO_URI=mongodb://localhost:27017/finailytics
# JWT
JWT_SECRET=your_super_secret_jwt_key_at_least_32_chars
JWT_EXPIRES_IN=15m
JWT_REFRESH_SECRET=your_refresh_secret_key
JWT_REFRESH_EXPIRES_IN=7d
# Cloudinary
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret
# Google AI
GEMINI_API_KEY=your_gemini_api_key
# Email (optional in dev)
RESEND_API_KEY=your_resend_api_key
RESEND_MAILER_SENDER=no-reply@yourdomain.com
# CORS
FRONTEND_ORIGIN=http://localhost:5173VITE_API_URL=http://localhost:8000/api# Terminal 1: Backend
cd backend
npm run dev
# Terminal 2: Frontend
cd client
npm run dev- Backend: http://localhost:8000
- Frontend: http://localhost:5173
finailytics/
βββ docs/ # Detailed documentation
β βββ api_documentation.md # Complete API reference
β βββ backend.md # Backend architecture
β βββ frontend.md # Frontend architecture
β βββ authentication.md # Auth flow details
β βββ ocr-receipt-scanning.md # AI receipt scanning
β βββ ai-integration.md # Google Gemini integration
β βββ analytics.md # Analytics & reporting
β βββ reports-email.md # Email reports
β βββ recurring-transactions.md # Recurring transactions
β
βββ backend/ # Express + TypeScript API
β βββ src/
β βββ controllers/ # Route handlers
β βββ services/ # Business logic
β βββ models/ # Mongoose schemas
β βββ routes/ # Express routers
β βββ config/ # Configuration
β βββ middlewares/ # Express middleware
β βββ validators/ # Zod schemas
β βββ utils/ # Helpers
β βββ cron/ # Scheduled jobs
β βββ mailers/ # Email handling
β
βββ client/ # React + Vite frontend
βββ src/
βββ pages/ # Route pages
βββ components/ # UI components
βββ features/ # RTK Query API slices
βββ hooks/ # Custom hooks
βββ layouts/ # Layout components
βββ routes/ # Routing config
βββ lib/ # Utilities
For detailed documentation, see the docs/ folder:
| Document | Description |
|---|---|
docs/api_documentation.md |
Complete API reference with all endpoints, request/response formats |
docs/backend.md |
Backend architecture, folder structure, database schema |
docs/frontend.md |
Frontend pages, components, state management |
docs/authentication.md |
JWT authentication flow, token management |
docs/ocr-receipt-scanning.md |
AI receipt scanning workflow |
docs/ai-integration.md |
Google Gemini AI configuration |
docs/analytics.md |
Analytics endpoints, aggregation pipelines |
docs/reports-email.md |
Report generation, automated emails |
docs/recurring-transactions.md |
Recurring transaction processing |
POST /api/auth/registerβ Create accountPOST /api/auth/loginβ Sign in
GET /api/user/current-userβ Get profilePUT /api/user/updateβ Update profile
POST /api/transaction/createβ New transactionGET /api/transaction/allβ List (paginated)GET /api/transaction/:idβ Get onePUT /api/transaction/update/:idβ UpdatePUT /api/transaction/duplicate/:idβ DuplicateDELETE /api/transaction/delete/:idβ DeletePOST /api/transaction/bulk-transactionβ CSV importDELETE /api/transaction/bulk-deleteβ Bulk deletePOST /api/transaction/scan-receiptβ AI scan
GET /api/analytics/summaryβ Financial summaryGET /api/analytics/chartβ Chart dataGET /api/analytics/expense-breakdownβ Pie chart data
GET /api/report/allβ Report historyGET /api/report/generateβ Generate reportPUT /api/report/update-settingβ Configure auto-reports
npm run dev # Development with hot reload
npm run build # Compile TypeScript
npm start # Run production buildnpm run dev # Start dev server
npm run build # Production build
npm run preview # Preview productionImportant: Never commit real API keys or secrets to version control.
- All secrets stored in
.envfiles (gitignored) - Passwords hashed with bcrypt (12 rounds)
- JWT tokens with short expiry (15 min)
- CORS configured for specific origin only
- Input validation with Zod prevents malformed data
- MongoDB query injection prevention
- HTTPS recommended for production
| Issue | Solution |
|---|---|
| 404 on auth from localhost:5173 | Ensure VITE_API_URL=http://localhost:8000/api in client/.env |
| "Transaction numbers are only allowed on a replica set" | Use MongoDB replica set or code fallback handles it automatically |
| Login says "Email/password not found" | Email normalized to lowercase; check exact email used at signup |
| Savings rate unrealistic | Values clamped to -100% to 100% for realism |
MIT License β feel free to use for personal or commercial projects.
Contributions welcome! Please open an issue or submit a PR.
If you find this useful, please give it a β
Made with π» and β