How achyutha2546/nexspend works
NexSpend is a personal-finance application for tracking transactions and managing budgets, goals, recurring activity, reports, and related productivity features. The principal evidenced flow is an authenticated user entering through the dashboard, with transaction routes dispatching to transaction handlers that read and write transaction records. AI routes expose coaching, forecasting, scenario, and review capabilities; category detection also supports learned merchant mappings and receipt scanning. The tree and excerpts establish some route ownership and internal calls, but not most frontend-to-service or database wiring, so those links are omitted.
Main entry points: App.tsx App routing · syncEngine.ts Offline sync · aiRoutes.ts AI routes · transactionController.ts Transaction handlers
Components 24
Web application
- App routing
frontend/src/App.tsx - Finance pages
frontend/src/pages/dashboard - Transactions page
frontend/src/pages/dashboard/TransactionsPage.tsx - Transaction service
frontend/src/services/transactionService.ts - API client
frontend/src/services/api.ts - Offline sync
frontend/src/offline/syncEngine.ts - AI coach
frontend/src/pages/dashboard/AICoachPage.tsx - AI client service
frontend/src/services/aiService.ts
Finance workflows
- Transaction routes
backend/src/routes/transactionRoutes.ts - Auth middleware
backend/src/middleware/authMiddleware.ts - Transaction handlers
backend/src/controllers/transactionController.ts - Budget, goals, recurring
backend/src/controllers - Analytics and reports
backend/src/controllers/analyticsController.ts
AI capabilities
- AI routes
backend/src/routes/aiRoutes.ts - AI handlers
backend/src/controllers/aiController.ts - AI service
backend/src/ai/services/AIService.ts - Financial engines
backend/src/ai/engines - Category detection
backend/src/controllers/categoryDetectionController.ts - AI provider factory
backend/src/ai/providers/AIProviderFactory.ts
Persistence and offline
- IndexedDB queue
frontend/src/offline/idbStorage.ts - Transaction records
backend/src/models/Transaction.ts - Merchant mappings
backend/src/models/MerchantCategoryMapping.ts
Other components
- User
- LLM provider
Connections 17
- User → App routing: uses
- App routing → Finance pages: routes to
- App routing → Transactions page: routes to
- App routing → AI coach: routes to
- Transaction routes → Auth middleware: guards routes
- Transaction routes → Transaction handlers: dispatches
- Transaction handlers → Transaction records: reads/writes
- Offline sync → IndexedDB queue: reads queue
- Offline sync → IndexedDB queue: removes synced items
- Offline sync → API client: sends queued actions
- AI routes → Auth middleware: guards routes
- AI routes → AI handlers: dispatches
- AI routes → Category detection: dispatches detection
- Category detection → Merchant mappings: reads/writes
- Category detection → AI provider factory: requests classification
- AI provider factory → LLM provider: selects provider
- Transaction handlers → AI service: invalidates cache