A multi-currency finance tracker built for international students to aggregate checking, savings, and investment accounts from different countries into a single USD net worth dashboard.
- Frontend: React, Vite
- Backend: Express.js, Node.js
- Database: MongoDB (Atlas), Mongoose
- Styling: Vanilla CSS
This project follows a strict Router -> Controller -> Model pattern.
backend/models/: Defines the Mongoose schemas (User, Account, Snapshot) with robust input validation.backend/controllers/: Contains the core business logic and custom aggregation pipelines.backend/routes/: Maps Express endpoints to the controller functions.
- Custom React Dashboard: Renders a dynamic
NetWorthSummarycomponent fetching aggregated metrics. - RESTful API Integration: Complete CRUD functionality (
GET,POST,PUT,DELETE) with the backend via a centralizedfrontend/src/api.js. - Advanced State Management: Implemented controlled forms (
AccountForm) with edit/populate states. - Auto-Refresh (Polling): Uses
setIntervalinuseEffectto fetch live data every 30 seconds, including the requiredclearIntervalcleanup function to prevent memory leaks. - Interactive UI Filter/Sort: The
AccountListallows users to dynamically search by country/type and click table headers to sort columns. - Robust Error Handling: Explicit Loading and Error states are conditionally rendered across all fetching components.
Creates a new financial account.
Body: { name, type, country, currency, balance, institution }
Response: { _id, userId, name, type, country, currency, balance, institution, createdAt }
Returns total net worth in USD with breakdowns.
Response: { totalUSD: 28420, byCountry: { Sweden: 15640, Ecuador: 9900 }, byType: { savings: 11100, investment: 14800 } }
Install dependencies in the root directory (which runs concurrently for frontend and backend):
npm installCreate a .env file inside the /backend folder with the following:
PORT=8000
MONGODB_URI=mongodb+srv://<your_user>:<your_password>@<your_cluster>.mongodb.net/FinanceTracker
To populate realistic mock data for your dashboard, run the seeder script from the root:
node backend/seed.jsnpm run dev- Frontend starts at:
http://localhost:5173 - Backend API starts at:
http://localhost:8000/api