A modern, privacy-focused personal finance tracking application with AI-powered features and dual-language support (English/Chinese).
New to the project? Choose your path:
- INSTALLATION_CHECKLIST.md - Step-by-step setup checklist
- QUICKSTART.md - Fast setup guide (5-10 minutes)
- SETUP.md - Detailed instructions with explanations
- DEPLOYMENT.md - Production deployment guide
- โ User Authentication - Secure sign up/sign in with Firebase Auth
- โ Transaction Management - Add, edit, delete, and search transactions
- โ Custom Categories - Unlimited categories with icons and colors
- โ Budget Management - Monthly and custom period budgets with progress tracking
- โ Dual Currency - Support for USD and CNY with currency conversion
- โ Dual Language - Full English and Chinese (ไธญๆ) support
- โ Responsive Design - Works seamlessly on desktop, tablet, and mobile
- โ
AI Smart Input - Natural language transaction parsing powered by Claude AI
- Example: "Coffee 45 CNY at Starbucks" โ Automatically creates transaction
- โ
Receipt Scanning - OCR-powered receipt scanning with AI extraction
- Upload or photograph receipts
- Automatic merchant, amount, and date detection
- Smart category suggestions
- โ
Enhanced Analytics Dashboard
- Month-over-month spending comparison
- Category trends over time
- Spending forecasts using linear regression
- Budget vs actual analysis
- โ
Export Capabilities
- CSV export for transactions and analytics
- Excel export with formatting
- PDF reports with charts and tables
- โ
Interactive Charts - Powered by Recharts
- Spending by category (pie charts)
- Spending trends over time (line charts)
- Budget progress visualization
- โ
Recurring Transactions - Automated recurring expense tracking
- Daily, weekly, biweekly, monthly, quarterly, yearly frequencies
- Template-based system
- Automatic transaction creation
- Manual "create now" and "process due" options
- โ
Transaction History - Comprehensive transaction management
- Advanced filtering and search
- Date range selection
- Category filtering
- Multiple sort options
- โ
Dashboard Widgets
- Total spending this month
- Budget progress with color-coded alerts
- Active categories count
- Recent transactions
- Spending trends
- โ
Stealth Mode - Privacy protection (UI ready, full implementation pending)
- Data scaling (reduce displayed amounts)
- Hidden categories
- Noise injection (fake transactions)
- โ Secure by Default - Firestore security rules enforce data isolation
- React 18 - Modern React with hooks and functional components
- TypeScript - Type-safe development
- Vite - Lightning-fast build tool and dev server
- Material-UI (MUI) - Comprehensive UI component library
- React Router v6 - Client-side routing
- i18next - Internationalization framework
- Firebase Authentication - Secure user authentication
- Firebase Firestore - NoSQL cloud database
- Firebase Hosting - Fast and secure web hosting
- Anthropic Claude API - AI-powered natural language processing
- Tesseract.js - Client-side OCR for receipt scanning
- Recharts - Composable charting library
- jsPDF - PDF generation
- jspdf-autotable - PDF table generation
- Zustand - Lightweight state management
- date-fns - Modern date utility library
- ESLint - Code quality and consistency
- GitHub Actions - CI/CD automation
- Firebase CLI - Deployment and management tools
BalanceAPP/
โโโ .github/
โ โโโ workflows/
โ โโโ firebase-deploy.yml # CI/CD pipeline
โโโ web-app/
โ โโโ src/
โ โ โโโ components/ # Reusable UI components
โ โ โ โโโ analytics/ # Analytics-specific components
โ โ โ โโโ dashboard/ # Dashboard widgets
โ โ โ โโโ transaction/ # Transaction components
โ โ โ โโโ Layout.tsx # Main app layout
โ โ โ โโโ ProtectedRoute.tsx # Route authentication wrapper
โ โ โโโ config/
โ โ โ โโโ firebase.ts # Firebase initialization
โ โ โโโ hooks/ # Custom React hooks
โ โ โ โโโ useAuth.ts # Authentication
โ โ โ โโโ useTransactions.ts # Transaction management
โ โ โ โโโ useCategories.ts # Category management
โ โ โ โโโ useBudgets.ts # Budget management
โ โ โ โโโ useRecurringTransactions.ts
โ โ โ โโโ useDashboardData.ts
โ โ โ โโโ useStealthMode.ts
โ โ โโโ lib/
โ โ โ โโโ i18n.ts # i18n configuration
โ โ โโโ locales/
โ โ โ โโโ en.json # English translations
โ โ โ โโโ zh.json # Chinese translations
โ โ โโโ pages/ # Page components
โ โ โ โโโ Login.tsx
โ โ โ โโโ SignUp.tsx
โ โ โ โโโ Onboarding.tsx
โ โ โ โโโ Dashboard.tsx
โ โ โ โโโ Transactions.tsx
โ โ โ โโโ Analytics.tsx
โ โ โ โโโ RecurringTransactions.tsx
โ โ โโโ stores/ # Zustand stores
โ โ โ โโโ authStore.ts
โ โ โ โโโ settingsStore.ts
โ โ โโโ types/
โ โ โ โโโ index.ts # TypeScript definitions
โ โ โโโ utils/ # Utility functions
โ โ โ โโโ firestore.ts # Firestore service layer
โ โ โ โโโ currency.ts # Currency formatting
โ โ โ โโโ date.ts # Date utilities
โ โ โ โโโ export.ts # CSV/Excel export
โ โ โ โโโ pdfExport.ts # PDF export
โ โ โ โโโ aiParser.ts # Claude AI integration
โ โ โ โโโ ocrService.ts # OCR integration
โ โ โ โโโ recurringUtils.ts # Recurring transaction logic
โ โ โโโ App.tsx # Main app component with routing
โ โ โโโ main.tsx # Entry point
โ โโโ .env.example # Environment variables template
โ โโโ .env.production # Production env template
โ โโโ package.json
โ โโโ vite.config.ts # Vite configuration
โโโ .firebaserc # Firebase project configuration
โโโ firebase.json # Firebase hosting configuration
โโโ firestore.rules # Firestore security rules
โโโ firestore.indexes.json # Firestore indexes
โโโ deploy.sh # Deployment script
โโโ DEPLOYMENT.md # Deployment guide
โโโ INSTALLATION_CHECKLIST.md # Setup checklist
โโโ QUICKSTART.md # Quick setup guide
โโโ SETUP.md # Detailed setup guide
โโโ README.md # This file
- Node.js v18 or higher
- npm v9 or higher
- Firebase account (free tier works)
- Anthropic API key (optional, for AI features)
-
Clone the repository:
git clone <repository-url> cd BalanceAPP
-
Navigate to web-app directory:
cd web-app -
Install dependencies:
npm install
-
Set up Firebase:
- Go to Firebase Console
- Create a new project
- Enable Authentication โ Email/Password
- Create a Firestore Database in production mode
- Copy your Firebase configuration
-
Configure environment variables:
cp .env.example .env.local
Edit
.env.local:VITE_FIREBASE_API_KEY=your_api_key VITE_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com VITE_FIREBASE_PROJECT_ID=your_project_id VITE_FIREBASE_STORAGE_BUCKET=your_project.firebasestorage.app VITE_FIREBASE_MESSAGING_SENDER_ID=your_sender_id VITE_FIREBASE_APP_ID=your_app_id VITE_FIREBASE_MEASUREMENT_ID=your_measurement_id # Optional: For AI features VITE_ANTHROPIC_API_KEY=your_anthropic_api_key -
Deploy Firestore rules:
cd .. # Back to project root firebase deploy --only firestore:rules
-
Start development server:
cd web-app npm run dev -
Open your browser: Navigate to
http://localhost:5173
For detailed setup instructions, see SETUP.md.
# Development
npm run dev # Start development server (http://localhost:5173)
# Building
npm run build # Build for production (outputs to dist/)
npm run preview # Preview production build locally
# Code Quality
npm run lint # Run ESLint
npm run type-check # Run TypeScript type checking (if configured)
# Deployment (from project root)
./deploy.sh # Full deployment (build + Firestore rules + hosting)
firebase deploy --only hosting # Deploy hosting only
firebase deploy --only firestore # Deploy Firestore rules only# From project root
./deploy.shThe project includes automated deployment via GitHub Actions:
- Set up GitHub Secrets with your Firebase and Anthropic credentials
- Push to main branch โ Automatic production deployment
- Open a PR โ Automatic preview deployment
See DEPLOYMENT.md for complete deployment instructions.
The app uses comprehensive Firestore security rules to ensure:
- Users can only access their own data
- All operations are authenticated
- Data validation on writes
- Protection against malicious queries
- Client-side only: OCR processing happens in your browser
- No data sharing: Your financial data never leaves Firebase (except AI API calls)
- Secure authentication: Firebase Auth with email/password
- HTTPS enforced: All connections are encrypted
- Stealth mode: Optional privacy layer for display (coming soon)
Type naturally and let Claude AI parse your transaction:
Input: "Coffee 45 CNY at Starbucks"
Output: {
description: "Coffee at Starbucks",
amount: 45,
currency: "CNY",
location: "Starbucks",
category: "Food & Dining"
}
- Take a photo or upload a receipt
- OCR extracts text from the image
- AI parses merchant, amount, date
- Auto-suggests appropriate category
- Review and confirm transaction
Set up templates for:
- Monthly subscriptions (Netflix, Spotify, etc.)
- Weekly expenses (groceries, gas, etc.)
- Quarterly bills (insurance, taxes, etc.)
- Yearly payments (memberships, renewals, etc.)
The app automatically creates transactions based on your schedule.
- Month-over-Month: See spending trends with percentage changes
- Category Trends: Multi-line charts showing how category spending evolves
- Forecasting: Predict future spending based on historical patterns
- Budget Analysis: Compare actual vs budgeted spending with detailed breakdowns
- Export: Download reports as CSV, Excel, or PDF
- Project setup with Vite + React + TypeScript
- Firebase configuration
- Authentication system
- Routing and navigation
- Dual-language support (English/Chinese)
- Basic layout and dashboard
- Transaction CRUD operations
- Category management
- Dashboard data visualization
- Transaction list with filtering
- Budget management
- Search and sort functionality
- AI-powered natural language input (Claude AI)
- Receipt scanning with OCR (Tesseract.js)
- Enhanced analytics with charts and forecasting
- Export to CSV, Excel, and PDF
- Recurring transactions
- Transaction history enhancements
- Firebase Hosting setup
- Firestore security rules
- Environment configuration
- Build optimization
- CI/CD with GitHub Actions
- Deployment documentation
- Progressive Web App (PWA) configuration
- Offline support with service workers
- Mobile-optimized layouts
- Touch gestures and mobile UX
- Add to home screen functionality
- Push notifications (optional)
- Budget alert system
- Recurring transaction reminders
- Custom spending alerts
- Email notifications
- In-app notification center
- Unit tests with Vitest
- Integration tests
- E2E tests with Playwright
- Performance monitoring
- Error tracking and logging
- Accessibility improvements
- Full stealth mode implementation
- Multi-currency advanced features
- Shared budgets and categories
- Data import/export from other apps
- Machine learning for categorization
- Voice input for transactions
- Custom dashboard widgets
- Dark mode theme
This is currently a personal project, but suggestions and feedback are welcome! Feel free to:
- Open issues for bugs or feature requests
- Submit pull requests
- Share ideas and improvements
MIT License - See LICENSE file for details
For questions, feedback, or issues:
- Open an issue in the repository
- Check SETUP.md for common setup issues
- Check DEPLOYMENT.md for deployment troubleshooting
- Anthropic Claude - AI-powered natural language processing
- Firebase - Backend infrastructure and hosting
- Material-UI - Beautiful React components
- Recharts - Elegant data visualization
- Tesseract.js - Client-side OCR capabilities
Made with โค๏ธ for better personal finance management