A basic Maven-based Java application that allows users to upload CSV files containing spending records and generate spending reports.
- Parse CSV files with spending data
- Calculate total spending
- Break down spending by category
- Show percentage distribution per category
- Display recent transactions
- Java 11 or higher
- Maven 3.6 or higher
To build the application, run:
mvn clean packageThis will create a JAR file with all dependencies included in the target directory.
Run the application with a CSV file:
java -jar target/budget-app-1.0-SNAPSHOT-jar-with-dependencies.jar <path-to-csv-file>Example:
java -jar target/budget-app-1.0-SNAPSHOT-jar-with-dependencies.jar sample-spending.csvThe CSV file should have the following columns:
date- Date in YYYY-MM-DD format (e.g., 2024-01-15)category- Spending category (e.g., Food, Transportation, Entertainment)description- Brief description of the transactionamount- Amount spent (decimal number)
Example CSV:
date,category,description,amount
2024-01-05,Food,Grocery shopping,85.50
2024-01-07,Transportation,Gas station,45.00
2024-01-10,Entertainment,Movie tickets,30.00A sample CSV file (sample-spending.csv) is included in the repository for testing.
├── pom.xml # Maven configuration
├── sample-spending.csv # Sample CSV file for testing
└── src/
└── main/
└── java/
└── com/
└── example/
└── budget/
├── BudgetApp.java # Main application class
├── CSVReader.java # CSV file parser
├── ReportGenerator.java # Report generation logic
└── SpendingRecord.java # Data model for spending records
- Apache Commons CSV 1.10.0 - For parsing CSV files
- JUnit 4.13.2 - For unit testing (test scope)