A full-stack, data-driven desktop application for managing personal expenses. This application allows users to track their spending with full CRUD (Create, Read, Update, Delete) functionality, visualize monthly summaries with a pie chart, and export data to a CSV file.
View all expenses, sorted by date. A dynamic pie chart (using JFreeChart) provides a visual summary of monthly spending by category.
A single, reusable form is used for both adding new expenses and editing existing ones. The form is launched as a modal dialog, and the category dropdown is dynamically populated from the database.
A confirmation dialog, which includes the details of the selected item, appears before any destructive action to prevent accidental data loss.
Export all expense data to a .csv file with a single click. A native file-save dialog allows the user to choose where to save the file.
- Language: Java (JDK 17)
- Build Tool: Apache Maven
- User Interface (UI): JavaFX (with FXML)
- Database: SQLite (via JDBC)
- Charting Library: JFreeChart
This project is built using the Model-View-Controller (MVC) design pattern to ensure a clean separation of concerns:
- Model: The
Expense.javaclass represents the data structure. - View: The
MainView.fxmlandAddExpenseView.fxmlfiles define the UI layout. - Controller: The
MainViewControllerandAddExpenseControllerclasses handle all user input and application logic. - Data Layer: The
DatabaseManager.javaclass encapsulates all JDBC connections and SQL queries, abstracting the database from the rest of the application.
-
Clone the repository (or download the source code):
git clone [https://github.com/ykwise/java-ExpenseTracker-JavaFX-project.git](https://github.com/ykwise/java-ExpenseTracker-JavaFX-project.git) cd java-ExpenseTracker-JavaFX-project -
Compile and Run using the JavaFX Maven Plugin: This project is configured to run using the
javafx-maven-plugin. The following command will compile the project and launch the application:mvn clean javafx:run
The application will launch, and the expenses.db SQLite database file will be automatically created in the project's root directory if it doesn't already exist.