A simple desktop application built with Java Swing for manually tracking your daily expenses. This project uses JDBC to connect to a local SQLite database, providing a straightforward way to manage your finances without any external dependencies.*
⌨ Manual Data Entry: A straightforward interface to add expenses by typing the name, amount, and category.
💯 View All Expenses: See a clear, sortable table of all your past expenses.
🚮 Delete Expenses: Remove expenses you no longer need.
📁 Local Database Storage: All expenses are securely saved in a local SQLite database file expensetracker.db, making the application self-contained and portable.
📊 Clear Expense Table: View all your past expenses in a simple, sortable table.
• Core: Java 11
• GUI: Java Swing
• Database: SQLite with JDBC Driver
• Dependency Management: Apache Maven
The project follows the standard Maven directory layout for clean and organized code:
ai-expense-tracker/
├── pom.xml # Maven configuration file for dependencies
├── .gitignore # Specifies files for Git to ignore
├── README.md # This project overview file
└── src/
└── main/
└── java/
└── com/
└── expensetracker/
├── Expense.java # Data model for an expense
├── DatabaseHelper.java # Handles all JDBC/SQLite operations
└── ExpenseTrackerApp.java # Main class with the Swing GUI
Follow these steps to get the project running on your local machine.
1. Prerequisites
Git: To download the source code. (Download Git)
Java Development Kit (JDK): Version 11 or higher. (Download OpenJDK)
Apache Maven: To build the project. (Download Maven)You can run this project either directly from an IDE like IntelliJ IDEA or from your computer's command line.
- Clone the Repository:
git clone [https://github.com/akshxdhh/Ai-Expense-Tracker.git](https://github.com/akshxdhh/Ai-Expense-Tracker.git)-
Open in IntelliJ IDEA:
- Launch IntelliJ IDEA.
- Select File > Open....
- Navigate to the cloned project folder and select the pom.xml file.
- Choose "Open as Project".
-
Load Maven Dependencies:
- IntelliJ will automatically read the
pom.xmlfile. - If prompted, click "Load Maven Changes" or open the Maven tool window on the right and click the "Reload All Maven Projects" button. This will download the necessary SQLite-JDBC driver.
- IntelliJ will automatically read the
-
Run the Application:
- Navigate to the src/main/java/com/expensetracker folder.
- Right-click on the ExpenseTrackerApp.java file and select "Run
ExpenseTrackerApp.main()".
Prerequisites Before you begin, you must have the following software installed and configured in your system's PATH.
- Git: To download the source code. (Download Git)
- Java Development Kit (JDK): Version 11 or higher. (Download OpenJDK)
- Apache Maven: To build the project. (Download Maven)
Steps
- Clone the Repository: Open your command prompt, navigate to a directory of your choice, and run:
git clone [https://github.com/akshxdhh/Ai-Expense-Tracker.git](https://github.com/akshxdhh/Ai-Expense-Tracker.git)- Navigate to the Project Directory:
cd Ai-Expense-Tracker- Build the Project: Use Maven to compile the code and package it into a runnable.jar file.
mvn clean packageYou will see a BUILD SUCCESS message when it's done. The output file will be located in the target/ directory.
- Run the Application:
Execute the packaged
.jarfile using thejavacommand.
java -jar target/ai-expense-tracker-1.0.0.jarThe application window should now appear. The expensetracker.db file will be created in the project folder as you add your first expense.
Warning
If you modify the code to change the database structure (e.g., add a new field to Expense.java), you must delete the existing expensetracker.db file. The application will generate a new, correct database file on the next run.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.