How anmay-27/spendwise-ai works
SpendWise AI is a personal-finance application: users authenticate, record income and expenses, manage budgets and goals, and review insights, reports, and payment activity. The browser UI calls the Spring finance core through a gateway; the core persists financial state, optionally requests transaction categorization, and publishes committed events for notifications. Payments are simulations or Razorpay test-mode checkout, not bank transfers. Edges are limited to README statements and shown source references/calls; unsampled domain implementations are represented by their exact enclosing paths.
Main entry points: App.jsx React application · FinanceController.java Finance API · TransactionCrudService.java Transaction management · CheckoutService.java Checkout service
Components 31
Web client
- React application
frontend/src/App.jsx - Sign-in UI
frontend/src/features/AuthPage.jsx - API client
frontend/src/api.js - Ledger and finance screens
frontend/src/features/LedgerPage.jsx - Budgets and goals
frontend/src/features/BudgetsPage.jsx - Insights and reports
frontend/src/features/ReportsPage.jsx - Payment screens
frontend/src/features/RazorpayPayPage.jsx
Finance core
- API gateway
services/api-gateway/src/main/java/com/anmay/gateway/GatewayApplication.java - Finance API
backend/src/main/java/com/anmay/spendwise/finance/FinanceController.java - Transaction management
backend/src/main/java/com/anmay/spendwise/finance/TransactionCrudService.java - Budget management
backend/src/main/java/com/anmay/spendwise/service/BudgetService.java - Savings goals
backend/src/main/java/com/anmay/spendwise/finance/GoalService.java - Insights and reporting
backend/src/main/java/com/anmay/spendwise/finance/FinanceInsights.java - Spending assistant
backend/src/main/java/com/anmay/spendwise/service/AssistantService.java - Checkout service
backend/src/main/java/com/anmay/spendwise/payments/CheckoutService.java - Razorpay test client
backend/src/main/java/com/anmay/spendwise/payments/RazorpayClient.java - Finance database
backend/src/main/java/com/anmay/spendwise/entity/ExpenseTransaction.java
Identity and access
- Auth service
backend/src/main/java/com/anmay/spendwise/service/AuthService.java - Session service
backend/src/main/java/com/anmay/spendwise/security/SessionService.java - JWT service
backend/src/main/java/com/anmay/spendwise/security/JwtService.java - Account provisioning
backend/src/main/java/com/anmay/spendwise/service/AccountProvisioningService.java
AI classification
- ML service client
backend/src/main/java/com/anmay/spendwise/service/MlServiceClient.java - Classifier API
ml-service/app/main.py - Category model
ml-service/app/model.py
Events and notifications
- Transactional outbox
backend/src/main/java/com/anmay/spendwise/events/EventOutbox.java - Outbox publisher
backend/src/main/java/com/anmay/spendwise/events/OutboxPublisher.java - Kafka events
- Finance event consumer
backend/src/main/java/com/anmay/spendwise/events/FinanceEventConsumer.java - Notification service
services/notification-service/src/main/java/com/anmay/notifications/NotificationConsumer.java - Notification database
services/notification-service/src/main/java/com/anmay/notifications/NotificationController.java
Other components
- Finance user
Connections 32
- Finance user → React application: uses
- React application → Sign-in UI: renders
frontend/src/App.jsx - Sign-in UI → API client: submits credentials
frontend/src/features/AuthPage.jsx - React application → API client: checks session
frontend/src/App.jsx - React application → Ledger and finance screens: renders
frontend/src/App.jsx - React application → Budgets and goals: renders
frontend/src/App.jsx - React application → Insights and reports: renders
frontend/src/App.jsx - React application → Payment screens: renders
frontend/src/App.jsx - API client → API gateway: calls REST
- API gateway → Finance API: routes requests
- Auth service → Session service: creates tokens
backend/src/main/java/com/anmay/spendwise/service/AuthService.java - Session service → JWT service: creates access token
backend/src/main/java/com/anmay/spendwise/security/SessionService.java - Session service → Finance database: stores sessions
backend/src/main/java/com/anmay/spendwise/security/SessionService.java - Auth service → Account provisioning: provisions account
backend/src/main/java/com/anmay/spendwise/service/AuthService.java - Finance API → Transaction management: handles writes
- Transaction management → Finance database: persists transactions
- Finance API → Budget management: serves budgets
- Finance API → Savings goals: serves goals
- Finance API → Insights and reporting: serves insights
- Finance API → Spending assistant: serves chat
- Checkout service → Razorpay test client: creates and verifies orders
backend/src/main/java/com/anmay/spendwise/payments/CheckoutService.java - Checkout service → Finance database: records captured expense
- Transaction management → ML service client: requests categorization
- ML service client → Classifier API: requests predictions
- Classifier API → Category model: predicts and learns
ml-service/app/main.py - Transaction management → Transactional outbox: records events
- Checkout service → Transactional outbox: records events
backend/src/main/java/com/anmay/spendwise/payments/CheckoutService.java - Outbox publisher → Transactional outbox: reads pending events
- Outbox publisher → Kafka events: publishes events
- Kafka events → Finance event consumer: delivers events
- Finance event consumer → Notification service: forwards notifications
- Notification service → Notification database: stores notifications