How ezolo/budget-project works
Project Type and Purpose
• This is a Java desktop Budget Management Application built with Eclipse.
• It follows an MVC-style pattern: a Swing-based presentation layer (“pages” and custom components), controller/utilities, and a data access layer connecting via JDBC to a MySQL database.
• Purpose: allow users to register/login, create budgets, manage expenses, run saving challenges, and remove subscriptions.
File Structure Analysis
• Top-level:
• src/budgetapp/auth – handles user authentication (LoginApp.java)
• src/budgetapp/components – custom Swing fields (LineTextField, LinePasswordField)
• src/budgetapp/controller – shared menu/navigation logic (MenuUtilities.java)
• src/budgetapp/connection – DatabaseConnection.java wraps JDBC logic
• src/budgetapp/pages – one class per screen (AccountsPage, AddRecordPage, AnalysisPage, etc.) plus BaseFrame
• resources – sample data for accounts, categories, records
• DDL.sql/DML.sql – schema and seed data for “budget_management” database
README Insights
• The app uses MySQL via JDBC (requires Connector/J).
• Features: user registration/login, budget creation, expense tracking, analysis, challenges, subscription management.
• It’s in development; everything runs in a single desktop client connecting to a remote or local MySQL server.
Main Components
a. Presentation Layer (Desktop Client)
• UI Frames & Pages: BaseFrame, LoginApp, RegisterPage, AccountsPage, RecordsPage, AnalysisPage, ChallengesPage, SubscriptionPage, etc.
• Custom UI Components: LineTextField, LinePasswordField
b. Controller / Business Logic
• MenuUtilities (handles navigation, shared UI logic)
• Inline logic within page classes (validation, formatting)
c. Data Access Layer
• DatabaseConnection: opens/closes JDBC connections, executes queries
• DAO-style methods embedded in page classes or a separate DAO package (future refactor)
d. Database Server
• MySQL “budget_management” schema and six tables (users, accounts, categories, records, useraddedcategories, subscriptions)
e. External Dependencies
• MySQL Connector/J driver
• Eclipse settings (for build)
Relationships and Interactions
• UI Pages ←→ Controller/Utilities ←→ Data Access Layer ←→ MySQL Database
• On login or register: LoginApp/RegisterPage call DatabaseConnection → users table
• On CRUD operations (accounts, categories, records): Pages call DatabaseConnection → respective tables
• AnalysisPage retrieves aggregated data (GROUP BY queries)
• ChallengesPage and SubscriptionPage use business logic + data queries
• Static resources (CSV or JSON) loaded at startup or for defaults
Architectural Patterns & Design Principles
• Layered Architecture (Presentation → Business Logic → Persistence)
• MVC-inspired separation: each “Page” encapsulates its own view & partial controller logic
• Single responsibility for DatabaseConnection (connection pooling or reuse can be added)
• Future extensibility: extract DAOs, services, or move to microservices or web layers