AI-powered personal finance app for budget management and credit card debt payoff. Status: ✅ Deployed (Backend + Frontend Budget/Spending Features Complete) Version: 0.5.0 (Budget & Spending Dashboard UI) Last Updated: October 17, 2025
Tyche Finance is a cross-platform, AI-powered personal finance application that helps users:
- Optimize credit card debt payoff (avalanche, snowball strategies)
- Analyze spending habits with AI classification
- Get personalized financial advice from multiple AI models
- Access via web or mobile (React Native)
- Import data from CSV, PDF, or camera-scanned receipts
- AWS Cognito authentication (email verification)
- Role-based access control (Admins, DevTeam, Users)
- JWT tokens for secure API authorization
- Amazon SES for email delivery
- Income and Expenses side-by-side
- Income breakdown: salary, bonuses, side income, investments, other
- Expense allocation: 20 categories with progress bars
- D3.js pie chart visualization
- Budget locked to current month (no selector)
- 24-hour edit window, then budget is locked
- Upload buttons for income and expense
- Real-time calculations: discretionary income, allocation percentages
- API integration for save/load
- Responsive design
- Monthly overview: income, spent, budgeted, net income
- Spending insights: daily average, projected spending, savings
- Category progress bars: budgeted vs actual
- Overspending alerts
- Transaction list with category filtering
- Transaction entry form: add income/expenses
- Month selector for viewing historical spending
- Empty states for new users
- Full CRUD for credit cards
- Inline editing, auto-scroll, recently-edited highlight
- Metrics dashboard: debt, credit, utilization
- Color-coded utilization
- Real-time sync with DynamoDB
- Responsive design
- Tailwind CSS integration
- Light/dark theme support
- Smooth animations
- Consistent styling
- 4 DynamoDB tables: budgets, transaction-details, spending-analytics, budget-goals
- TypeScript types for budget management
- 15 REST API endpoints (CRUD for budgets, categories, transactions, analytics)
- Multi-tenant design
- AI integration ready
- D3.js integration for charts
- Pie charts and progress bars
- Custom animations
- Responsive charts
- AI Chat Page: get_user_context tool working, 5 more tools to test
- AI Budget Integration: personalized recommendations
- Analytics Page: charts, goals, spending trends
- Transaction editing and recurring transactions
- CSV import and budget goals
- Mobile app feature parity
Monorepo structure:
tyche/
├── packages/ # Shared libraries
│ ├── types/ # TypeScript definitions
│ ├── core/ # Business logic
│ └── ai/ # Multi-model AI adapter
├── apps/ # Frontend applications
│ ├── web/ # React + Vite
│ └── mobile/ # React Native + Expo
├── services/ # Backend services
│ └── api/ # Lambda handlers
├── infrastructure/ # AWS CDK (IaC)
└── docs/ # Internal documentation (excluded from public repo)
Tech Stack:
- Frontend: React 18 + Vite | React Native + Expo
- Backend: AWS Lambda (Node.js 20) + HTTP API V2 + DynamoDB
- AI: Anthropic Claude, OpenAI GPT-4, Grok, DeepSeek
- Infrastructure: AWS CDK (TypeScript)
- Build System: npm workspaces + TypeScript + esbuild
- Auth: AWS Cognito
- Database: 7 core tables, 4 budget tables
- Node.js 20+ and npm 9+
- AWS CLI configured
- AI API key (Anthropic/OpenAI/xAI/DeepSeek)
git clone https://github.com/adonisja/tyche-finance.git
cd tyche-finance
npm install
npm run buildcd apps/web
npm run dev
# Open http://localhost:5173
cd apps/mobile
npm start
# Scan QR code with Expo Go# Set API keys (not tracked in git)
export OPENAI_API_KEY=sk-proj-your-key-here
export ANTHROPIC_API_KEY=sk-ant-your-key-here
cd infrastructure
npx cdk deploy --profile your-aws-profilenpm test
cd packages/core
npm test
cd apps/web
npm run test:e2e- Role-based access control (User, Dev, Admin)
- Row-level security with tenant/user partitioning
- Audit logging for admin actions
- Fork the repository
- Create a feature branch
- Commit changes
- Push to branch
- Open a Pull Request
This project is licensed for personal, educational, and non-commercial use only. See LICENSE file for details and commercial licensing inquiries.
Built with ❤️ for better financial health
AI-powered personal finance application to help users manage budgets and optimize credit card debt payoff strategies.
Status: ✅ DEPLOYED - Backend + Frontend Budget/Spending Features Complete!
Version: 0.5.0 (Budget & Spending Dashboard UI)
Last Updated: October 17, 2025
Live API: https://841dg6itk5.execute-api.us-east-1.amazonaws.com/
Tyche Finance is a cross-platform AI-powered personal finance application that helps users:
- 💳 Optimize credit card debt payoff using proven strategies (avalanche, snowball)
- 📊 Analyze spending habits with AI-powered classification
- 🤖 Get personalized financial advice from multiple AI models (Claude, GPT-4, Grok, DeepSeek)
- 📱 Access anywhere via web app or mobile (iOS/Android)
- 📄 Import data easily from CSV, PDF, or camera-scanned receipts
- AWS Cognito - Secure user authentication with email verification
- Role-Based Access Control - Automatic user group assignment (Admins, DevTeam, Users)
- JWT Tokens - Secure API authorization with cognito:groups claims
- Amazon SES - Professional email delivery (50K emails/day limit)
- Modern Layout - Income and Expenses side-by-side, Visualization below
- Income Breakdown - 5 input fields: salary, bonuses, side income, investments, other
- Expense Allocation - 20 budget categories with real-time progress bars
- D3.js Pie Chart - Interactive full-width visualization with color-coded legend
- Month Selector - Create/edit budgets for any month
- Auto-Distribute - Automatically allocate budget using proven percentages
- Real-Time Calculations - Discretionary income and allocation percentages
- Color Coding - Green border for income, red border for expenses
- API Integration - Seamless save/load with authentication
- Responsive Design - Adapts beautifully to mobile, tablet, desktop
- Route:
/budget
- Monthly Overview - Income, spent, budgeted, net income cards
- Spending Insights - Daily average, projected spending, potential savings
- Category Progress Bars - Visual budgeted vs actual comparison (green/yellow/red)
- Overspending Alerts - Highlighted warnings for categories over budget
- Transaction List - Complete list with category filtering and sorting
- Transaction Entry Form - Add income or expenses with dynamic categories
- 9 Income Categories: salary, bonuses, freelance, investments, rental, refunds, gifts, side income, other
- 19 Expense Categories: groceries, dining, transportation, utilities, housing, healthcare, insurance, entertainment, shopping, personal care, education, childcare, pets, gifts, travel, subscriptions, debt payments, savings, miscellaneous
- Essential Flag: Distinguish needs vs wants for better insights
- Notes Support: Add context to any transaction
- Month Selector - View spending for any month with URL support
- Empty States - Helpful guidance for new users
- Routes:
/spendingand/spending/:month
- Quick Action Cards - Budget Setup, Credit Cards, Spending, AI Chat, Analytics
- Budget Summary - Current month overview if budget exists
- Financial Metrics - Total cards, debt, credit, utilization
- Recent Cards Preview - Top 3 cards with utilization bars
- AI Insights Banner - Call-to-action for personalized advice
- Consistent Navigation - Dashboard | Cards | Budget | Spending | AI Chat | Analytics
- Route:
/dashboard
- Full CRUD Operations - Create, Read, Update, Delete credit cards
- Inline Editing - Cards expand vertically for seamless editing experience
- Auto-Scroll - View automatically centers on card being edited
- Recently-Edited Highlight - Green border that fades over 3 seconds after save
- View Toggle - Display 6 cards by default, expand to view all
- Metrics Dashboard - Total debt, available credit, average utilization
- Color-Coded Utilization - Visual indicators (green/yellow/red) for credit usage
- Immutable Field Protection - Card name, network, last 4 digits cannot be changed
- Real-Time Sync - All data persists to DynamoDB with fast response times (20-150ms)
- Responsive Design - Works on mobile, tablet, and desktop
- Tailwind CSS Integration - 40+ design tokens with HSL color system
- Light/Dark Theme Support - Ready for theme switching
- Smooth Animations - moveToTop, highlightPulse, highlightFade, slideDown
- Finance-Specific Tokens - Purple-blue gradient, card shadows, success/warning/danger colors
- Consistent Styling - All components use shared design variables
- 4 DynamoDB Tables - tyche-budgets, tyche-transaction-details, tyche-spending-analytics, tyche-budget-goals
- TypeScript Types - 7 comprehensive types for budget management (373 lines)
- 15 REST API Endpoints - Complete CRUD for budgets, categories, transactions, analytics
- Multi-Tenant Design - Budget isolation per tenant with GSIs for flexible querying
- Schema Documentation - Complete database design with access patterns (650+ lines)
- API Documentation - Full REST API reference with examples (850+ lines)
- AI Integration Ready -
availableForDebtPayofffield enables personalized recommendations
- D3.js Integration - 132 packages for powerful visualization and statistics
- Pie Charts - Budget distribution by category with interactive legend
- Progress Bars - Visual spending comparison with color coding
- Custom Animations - Smooth transitions and hover effects
- Responsive Charts - Adapts to all screen sizes
- AI Chat Page - Conversation interface with AgentKit tools (90% Complete!)
- ✅ get_user_context tool working (fetches real credit card data)
- 🔲 5 more tools to test (debt payoff simulation, spending analysis, etc.)
- AI Budget Integration - Update get_user_context to fetch budget data for personalized recommendations
- Analytics Page - Progress charts, financial goals, spending trends with D3.js
- Transaction Editing - Edit/delete existing transactions
- Recurring Transactions - Auto-generate expected transactions (rent, subscriptions, bills)
- CSV Import - Bulk import bank transactions
- Budget Goals - Set and track savings goals with milestone notifications
- Spending Predictions - AI-powered forecasting of end-of-month spending
- Budget Recommendations - AI suggests budget adjustments based on spending patterns
- Mobile App - React Native + Expo version with full feature parity
- Receipt Scanning - Camera-based receipt capture with AI categorization
Monorepo Structure with shared business logic:
tyche/
├── packages/ # Shared libraries
│ ├── types/ # TypeScript definitions
│ ├── core/ # Business logic (payoff algorithms)
│ └── ai/ # Multi-model AI adapter
├── apps/ # Frontend applications
│ ├── web/ # React + Vite
│ └── mobile/ # React Native + Expo
├── services/ # Backend services
│ └── api/ # Lambda handlers
├── infrastructure/ # AWS CDK (IaC)
└── docs/ # Comprehensive documentation
Tech Stack:
- Frontend: React 18.3 + Vite 5.4 | React Native 0.74 + Expo 51
- Backend: AWS Lambda (Node.js 20) + HTTP API V2 + DynamoDB (11 tables)
- AI: Anthropic Claude, OpenAI GPT-4 (6 AgentKit tools)
- Infrastructure: AWS CDK 2.160 (TypeScript IaC)
- Build System: npm workspaces + TypeScript 5.6 + esbuild
- Auth: AWS Cognito with JWT tokens
- Database:
- 7 core tables: users, cards, transactions, goals, snapshots, analytics, audit logs
- 4 budget tables: budgets, transaction-details, spending-analytics, budget-goals
- Cost: $2-5/month at low scale (HTTP API V2 = 71% cheaper!)
Comprehensive documentation available in /docs:
| Document | Description | Status |
|---|---|---|
| BUDGET_API_REFERENCE.md | 📡 Budget REST API - 15 endpoints with examples (850+ lines) | ✅ NEW! |
| BUDGET_DEPLOYMENT_SUMMARY.md | 💰 Budget infrastructure deployment - 4 tables, types, schema (v0.4.0) | ✅ Complete |
| BUDGET_SPENDING_SCHEMA.md | 📊 DynamoDB schema for budget/spending (650+ lines with access patterns) | ✅ Complete |
| DEVELOPMENT_WORKFLOW.md | 📋 Dev workflow - Documentation standards, todo completion checklist | ✅ Complete |
| DEPLOYMENT_COMPLETE.md | 🎉 Complete deployment summary with live URLs, testing guide | ✅ Complete |
| CARDS_PAGE_IMPLEMENTATION.md | 💳 Complete Cards page - Full CRUD, inline editing, animations, design system | ✅ Complete |
| HTTP_API_MIGRATION.md | REST API → HTTP API V2 migration (71% cost savings, 60% faster) | ✅ Complete |
| COGNITO_GROUPS_MIGRATION.md | 👥 Cognito Groups RBAC migration with auto-assignment | ✅ Complete |
| COGNITO_USER_IDENTIFIERS.md | 🆔 Cognito user identifiers guide (sub vs username vs email) | ✅ Complete |
| SES_EMAIL_SETUP.md | 📧 Amazon SES email configuration for Cognito (50K emails/day) | ✅ Complete |
| AUTH_TESTING_GUIDE.md | 🔐 Step-by-step authentication testing checklist | ✅ Complete |
| FRONTEND_BUILD_SUMMARY.md | Complete frontend build walkthrough with React hooks | ✅ Complete |
| FRONTEND_INTEGRATION.md | Frontend-backend integration guide with code examples | ✅ Complete |
| CHANGELOG.md | 📝 All notable changes and version history | ✅ UPDATED! |
| ARCHITECTURE.md | Deep-dive into system design, components, and patterns | 📖 Complete |
| AGENTKIT_INTEGRATION.md | 6 AI tools implementation (payoff, analysis, recommendations) | 📖 Complete |
| MULTI_TENANCY.md | Multi-tenant RBAC with admin/dev/user roles | 📖 Complete |
| ANALYTICS_SYSTEM.md | Progress tracking, goals, and snapshots system | 📖 Complete |
| LEARNING_GUIDE.md | Educational guide for TypeScript, JWT, security patterns | 🎓 Complete |
| DEVELOPER_GUIDE.md | Development workflows and code patterns | 📖 Complete |
| DEPLOYMENT_GUIDE.md | AWS deployment guide with troubleshooting | 🚀 Complete |
| AWS_SETUP_GUIDE.md | Complete AWS account setup instructions | 📖 Complete |
| BUGS_AND_FIXES.md | Bug tracking and resolution history | 📖 UPDATED! |
- Node.js 20+ and npm 9+
- AWS CLI configured with credentials
- AI API key (Anthropic/OpenAI/xAI/DeepSeek)
# Clone repository
git clone https://github.com/yourusername/tyche.git
cd tyche
# Install dependencies
npm install
# Build all packages
npm run build# Start web app (dev server)
cd apps/web
npm run dev
# Open http://localhost:5173
# Start mobile app (Expo)
cd apps/mobile
npm start
# Scan QR code with Expo Go app# Configure API keys (already done!)
export OPENAI_API_KEY=sk-proj-your-key-here
export ANTHROPIC_API_KEY=sk-ant-your-key-here
# Deploy to AWS (already deployed!)
cd infrastructure
npx cdk deploy --profile tyche-dev
# Deployment outputs:
# ✅ API URL: https://841dg6itk5.execute-api.us-east-1.amazonaws.com/
# ✅ User Pool ID: us-east-1_khi9CtS4e
# ✅ Client ID: 49993ps4165cjqu161528up854# Health check (no auth required)
curl https://841dg6itk5.execute-api.us-east-1.amazonaws.com/public/health
# Expected response:
# {"success":true,"data":{"status":"healthy",...}}cd infrastructure npm run bootstrap
npm run deploy
See [infrastructure/README.md](infrastructure/README.md) for detailed deployment instructions.
## 🧪 Testing
```bash
# Run all tests
npm test
# Test specific package
cd packages/core
npm test
# E2E tests (after deployment)
cd apps/web
npm run test:e2e
- Monorepo with npm workspaces
- TypeScript configuration with project references
- Shared business logic (@tyche/core, @tyche/types)
- Multi-model AI provider system (Claude, GPT-4, Grok, DeepSeek)
- AWS CDK infrastructure definitions
- Lambda API with routing and authentication
- Multi-tenancy with role-based access control (admin/dev/user)
- Authorization middleware and audit logging
- Admin user management endpoints (all 6 handlers)
- Developer system monitoring endpoints (all 4 handlers)
- Debt payoff simulation (avalanche, snowball)
- AI chat with tool calling (AgentKit patterns)
- Credit card CRUD endpoints (all handlers wired with DynamoDB)
- Database utilities for tenant-aware operations
- Comprehensive documentation (7 major guides)
- Full project builds successfully with zero TypeScript errors
All code complete! Infrastructure and handlers ready to deploy. Only prerequisites needed:
- Configure AWS credentials (
aws configure) - Set AI API key (ANTHROPIC_API_KEY or similar)
- Bootstrap CDK (
cd infrastructure && cdk bootstrap) - Deploy stack (
cdk deploy)
See DEPLOYMENT_GUIDE.md for detailed instructions.
- File processing (CSV/PDF/OCR)
- Advanced optimization (hybrid strategies, balance transfers)
- React web frontend UI (dashboard, admin panel)
- React Native mobile app UI
- Transaction classification and spending analysis
- Real-time notifications
- Rate limiting per tenant/user
Swappable AI providers with environment-based configuration:
// Switch models via environment variables
export AI_PROVIDER=anthropic # or openai, xai, deepseek
export AI_MODEL=claude-3-5-sonnet-latest
// Usage in code
const agent = createAgent({ userId });
const response = await agent.chatWithTools(messages, tools);Supported Models:
- Claude 3.5 Sonnet (Anthropic): Best for financial reasoning
- GPT-4 Turbo (OpenAI): Fast and conversational
- Grok Beta (xAI): Real-time data access
- DeepSeek Chat: Cost-effective (10x cheaper)
AWS Lambda + API Gateway for zero-ops infrastructure:
- Auto-scaling from 0 to 1000s of concurrent requests
- Pay-per-use (free tier covers development)
- Single Lambda with router (avoids cold start issues)
Shared packages prevent code duplication:
@tyche/types: Financial domain types used everywhere@tyche/core: Pure TypeScript business logic (no dependencies)@tyche/ai: Provider-agnostic AI adapter
Benefits: Change CreditCardAccount type once, updates web + mobile + API automatically.
Three user roles with escalating permissions:
| Role | Permissions |
|---|---|
| User | Manage own cards, transactions, chat with AI |
| Dev | View system metrics, test AI models, access anonymized data |
| Admin | View all users, manage roles, access audit logs, impersonate users |
| Admin | View all users, manage roles, access audit logs, perform advanced troubleshooting and support |
Row-level security with tenant-based partitioning:
// All queries filtered by tenantId + userId
PK: 'TENANT#personal#USER#user-123'
SK: 'CARD#card-456'Prevents cross-tenant data access at database level.
All admin actions logged with TTL (90-day retention):
await auditLog({
tenantId: user.tenantId,
userId: adminUserId,
action: 'view_user_cards',
targetUserId: 'user-123',
success: true
});Lines of Code: ~8,000+ (TypeScript)
Packages: 7 (3 shared, 2 apps, 2 services)
Dependencies: 1,298 packages
Build Time: ~5 seconds (incremental)
Bundle Size: 143.94 KB (web app, gzipped: 46.39 KB)
This is a learning project, but contributions are welcome!
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
Please read ARCHITECTURE.md to understand system design before contributing.
MIT License - see LICENSE file for details
- Anthropic for Claude AI
- AWS CDK team for excellent IaC tooling
- React and React Native communities
- OpenAI AgentKit for agent design patterns
Built with ❤️ for better financial health