How damtoan-it05/expense-manager-backend works
Expense Manager is a personal income-and-expense backend API. Clients send requests to the Express app, which mounts feature routes; protected routes authenticate users, operate on MongoDB-backed records, and return results. The main domain stages are account access, category management, transaction tracking, budgeting with spend alerts, and statistics; administrators also manage users and inspect system totals. The graph reflects the sampled routes and README capabilities. Source evidence for unsampled details is limited, so unverified relationships are omitted.
Main entry points: app.js Express app · auth.js JWT access · admin.js Admin routes · budgets.js Budget routes
Components 14
API entry
- Express app
Backend/src/app.js
Expense features
- Account routes
Backend/src/routes/auth.js - Category routes
Backend/src/routes/categories.js - Transaction routes
Backend/src/routes/transactions.js - Budget routes
Backend/src/routes/budgets.js - Statistics routes
Backend/src/routes/statistics.js - Admin routes
Backend/src/routes/admin.js
Access control
- JWT access
Backend/src/middleware/auth.js
Domain data
- User records
Backend/src/models/User.js - Category records
Backend/src/models/Category.js - Transaction records
Backend/src/models/Transaction.js - Budget records
Backend/src/models/Budget.js
Other components
- API client
- MongoDB
Connections 28
- API client → Express app: sends requests
README.md - Express app → Account routes: mounts routes
Backend/src/app.js - Express app → Category routes: mounts routes
Backend/src/app.js - Express app → Transaction routes: mounts routes
Backend/src/app.js - Express app → Budget routes: mounts routes
Backend/src/app.js - Express app → Statistics routes: mounts routes
Backend/src/app.js - Express app → Admin routes: mounts routes
Backend/src/app.js - Express app → MongoDB: connects to
Backend/src/app.js - Account routes → User records: reads and writes
Backend/src/routes/auth.js - Account routes → JWT access: protects account actions
Backend/src/routes/auth.js - Category routes → JWT access: protects routes
Backend/src/routes/categories.js - Category routes → Category records: reads and writes
Backend/src/routes/categories.js - Transaction routes → JWT access: protects routes
Backend/src/routes/transactions.js - Transaction routes → Transaction records: reads and writes
Backend/src/routes/transactions.js - Transaction routes → Category records: checks categories
Backend/src/routes/transactions.js - Budget routes → JWT access: protects routes
Backend/src/routes/budgets.js - Budget routes → Budget records: reads and writes
Backend/src/routes/budgets.js - Budget routes → Transaction records: aggregates spending
Backend/src/routes/budgets.js - Budget routes → Category records: validates categories
Backend/src/routes/budgets.js - Statistics routes → JWT access: protects routes
Backend/src/routes/statistics.js - Statistics routes → Transaction records: aggregates transactions
Backend/src/routes/statistics.js - Statistics routes → Category records: looks up categories
Backend/src/routes/statistics.js - Admin routes → JWT access: requires admin
Backend/src/routes/admin.js - Admin routes → User records: manages users
Backend/src/routes/admin.js - Admin routes → Transaction records: aggregates activity
Backend/src/routes/admin.js - Admin routes → Budget records: deletes user budgets
Backend/src/routes/admin.js - Admin routes → Category records: deletes user categories
Backend/src/routes/admin.js - JWT access → User records: loads user
Backend/src/middleware/auth.js