How zhengjason0814/bread works
Bread is a personal-finance application: users sign in or enter demo mode, then manage imported and manual transactions, accounts, budgets, receipts and spending insights. The browser calls the Node API, which owns persistence and brokers external services; a separate stateless ML service provides forecasting, classification, anomaly detection and recurring-transaction detection. The graph preserves these documented capabilities, but several unsampled routes are represented only at the subsystem level; dashed links indicate relationships not verified in the excerpts.
Main entry points: app.js API router · main.py ML endpoints · main.jsx React application · plaid.js Bank connections
Components 27
Browser experience
- React application
frontend/src/main.jsx - Sign-in and demo
frontend/src/components/AuthForm.jsx - App data workspace
frontend/src/layout/AppLayout.jsx - Finance pages
frontend/src/pages - API client
frontend/src/api/client.js
Backend API
- API router
backend/src/app.js - Authentication
backend/src/routes/auth.js - Transactions and receipts
backend/src/routes/expenses.js - Bank connections
backend/src/routes/plaid.js - Spending insights
backend/src/routes/insights.js - Budgets
backend/src/routes/budgets.js - Accounts
backend/src/routes/accounts.js - Admin and demo
backend/src/routes - ML service client
backend/src/services/mlClient.js
Finance data
- User profile
backend/src/models/User.js - Expense records
backend/src/models/Expense.js - Linked accounts
backend/src/models/Account.js - MongoDB
backend/src/config/db.js
External services
- Plaid
- Private receipt storage
backend/src/services/receiptStorage.js - Google identity
Machine learning
- ML endpoints
ml-service/app/main.py - Spend forecasting
ml-service/app/prediction.py - Purchase classification
ml-service/app/classification.py - Anomaly detection
ml-service/app/anomalies.py - Recurring detection
ml-service/app/recurring.py
Other components
- Finance user
Connections 29
- Finance user → React application: uses
- React application → Sign-in and demo: routes to
frontend/src/main.jsx - React application → App data workspace: routes to
frontend/src/main.jsx - React application → Finance pages: routes to
frontend/src/main.jsx - Sign-in and demo → API client: submits credentials
frontend/src/components/AuthForm.jsx - App data workspace → API client: loads finance data
frontend/src/layout/AppLayout.jsx - API client → API router: calls API
- API router → Authentication: routes to
backend/src/app.js - API router → Transactions and receipts: routes to
backend/src/app.js - API router → Bank connections: routes to
backend/src/app.js - API router → Spending insights: routes to
backend/src/app.js - API router → Budgets: routes to
backend/src/app.js - API router → Accounts: routes to
backend/src/app.js - API router → Admin and demo: routes to
backend/src/app.js - Authentication → User profile: reads and writes
backend/src/routes/auth.js - Transactions and receipts → Expense records: reads and writes
backend/src/routes/expenses.js - Transactions and receipts → Private receipt storage: stores receipts
backend/src/routes/expenses.js - Bank connections → Plaid: exchanges and syncs
- Bank connections → Linked accounts: persists accounts
backend/src/routes/plaid.js - Bank connections → Expense records: imports transactions
backend/src/routes/plaid.js - Authentication → Google identity: verifies identity
- Spending insights → ML service client: requests calculations
- ML service client → ML endpoints: sends features
- ML endpoints → Spend forecasting: dispatches prediction
ml-service/app/main.py - ML endpoints → Purchase classification: dispatches classification
ml-service/app/main.py - ML endpoints → Anomaly detection: dispatches detection
ml-service/app/main.py - ML endpoints → Recurring detection: dispatches detection
ml-service/app/main.py - User profile → MongoDB: persists profile
- Expense records → MongoDB: persists expenses