How mm120-i/eecs-4314 works
Project Type and Purpose
• This is a full-stack web application centered on finance management. Its purpose is to allow users to track income and expenses, set budgets, analyze spending habits, and even perform receipt scanning and banking data integration.
• The README explicitly mentions features such as user authentication (using JWT), transaction tracking, receipt upload/analysis with Taggun, and Plaid for banking data integration.
File Structure and Architectural Implications
• The project is split into two major directories at the top level: “client” (for the frontend) and “server” (for the backend).
• The “client” folder contains directories like app/components, dashboard, and pages for login, register, and settings. This reflects a Next.js routing structure and component-based UI design.
• The “server” folder contains:
– A config directory (for environment and deployment settings).
– Controllers, Models, Routes (using Express), and Services (for integrations like Plaid, Taggun, geocoding, forecasting, and OpenAI) that collectively form the backend API logic.
– A dedicated “database” module for MongoDB connectivity.
• These explicit separations suggest a RESTful API backend environment and a client that consumes these endpoints.
Key Components
a. Frontend:
• Next.js client built using React, Tailwind CSS, and shadcn/ui.
• Components for authentication (login, signup), dashboard (with pages for transactions, settings, and reporting), and other UI elements (logos, buttons, tables).
b. Backend:
• API Server (Node.js + Express) that provides endpoints for authentication, transactions, receipt uploads, and the integration with banking data.
• Controllers that handle business logic (e.g., authController, transactionController, receiptController, userController).
• Routes mapping URLs to controller actions.
• Middleware for authentication (using JWT) and error handling.
• Services which encapsulate external integrations (Plaid for bank account linking, Taggun for receipt scanning, geocoding, openai for potential AI-driven features).
c. Database:
• MongoDB, interfaced via Mongoose models representing users, transactions, receipts, and perhaps even Plaid-related data.
d. External Services:
• Plaid API for dummy banking data.
• Taggun API for receipt scanning.
• OpenAI components and geocoding services to enhance user insights.
Relationships & Data Flow
• The backend server, after validating requests (e.g., using JWT), interacts with the MongoDB database for data storage/retrieval.
• For specific functions:
– Transaction tracking and receipt scanning require calls from the frontend to dedicated backend endpoints, which in turn call the external Plaid or Taggun APIs.
– Data from the database might be aggregated or transformed by services (like spendingAggregator or forecastReceipt) before being sent back to the client for visualization.
– User actions triggering frontend events.
– Frontend API calls reaching the backend.
– Backend queries hitting the database.
– Backend communicating with external services.