This is my first capstone project at Year Up United, developed using Java. It reads data from a CSV file and provides a simple command-line interface for managing financial tasks. Users can add deposits, make payments, view transaction history, and generate various financial reports.
-
User Interface
- Home Screen
- Ledger Screen
- Report Screen
-
Home Screen
- Add deposits
- Make payments
- Ledger Screen
-
Ledger Screen
- View all transactions
- View deposits only
- View payments only
- View current balance
- Report Screen
- Home Screen
-
Report Screen
- Month-to-date report
- Previous month report
- Year-to-date report
- Previous year report
- Search by vendor name
- Custom search by multiple properties
- Back to Ledger Screen
The project is organized into several key classes:
AccountingLedgerApplication
: The main class that initializes the application and handles the home screen navigation.Ledger
: Manages the list of transactions and provides methods for adding, displaying, and manipulating transaction data.Report
: Generates various financial reports based on the transaction data.Transaction
: Represents individual financial transactions.InputUtil
: Utility class for handling user input and formatting output.
By implement the singleton instance, I believe it can save a lot of resources!
// Singleton instance of the AccountingLedgerAPP class
private static AccountingLedgerApplication accountingLedgerApp;
/**
* Private constructor to prevent instantiation.
*/
private AccountingLedgerApplication() {
}
/**
* Returns the singleton instance of the AccountingLedgerAPP class.
* If the instance is null, it initializes it.
*
* @return The singleton instance of AccountingLedgerAPP
*/
public static AccountingLedgerApplication getInstance(String fileName) {
if (accountingLedgerApp == null) {
accountingLedgerApp = new AccountingLedgerApplication();
}
return accountingLedgerApp;
}
By implement the userInput, I think it will make my code more concise and clean
public static Transaction userInput() {
try {
String dateTime = promptForString("Enter the Date time (yyyy-MM-dd HH:mm:ss) Or default Today's Now: ");
LocalDateTime createdDateTime;
if (dateTime.isBlank() || dateTime.isEmpty()) {
createdDateTime = LocalDateTime.now().truncatedTo(ChronoUnit.SECONDS);
System.out.println("You have used the default time: Now " + createdDateTime);
} else {
createdDateTime = LocalDateTime.parse(dateTime, InputUtil.dateTimeFormatter);
}
String vendorName = promptForString("Enter the Vendor Name: ");
String description = promptForString("Enter the Description: ");
Double amount = promptForDouble("Enter the Amount: ");
System.out.println();
Transaction transaction = new Transaction(createdDateTime, description, vendorName, amount);
logger.info("Created transaction: {}", transaction);
return transaction;
} catch (Exception e) {
logger.error("Error while processing user input: ", e);
System.out.println("Date Time Format issues! Please try it again!");
e.printStackTrace();
}
return null;
}
- Java Development Kit (JDK) 11 or higher
- Maven (for dependency management)
-
Clone the repository:
git clone https://github.com/yourusername/accounting-ledger-app.git
-
Navigate to the project directory:
cd accounting-ledger-app
-
Build the project using Maven:
mvn clean install
Run the main class AccountingLedgerApplication
to start the application:
java -cp target/accounting-ledger-app-1.0-SNAPSHOT.jar com.pluralsight.service.AccountingLedgerApplication
- Home Screen: Choose from options to add deposits, make payments, view the ledger, or exit the application.
- Ledger Screen: View all entries, deposits only, payments only, check balance, access the report screen, or return to the home screen.
- Report Screen: Generate various financial reports or perform custom searches on transactions.
This project is licensed under the MIT License. See the LICENSE
file for details.
- SLF4J for logging
- Reference : How to Write README for My software project
- Reference : How to Write README
- Reference : How to Get First Date or Last Date in LocalDateTime
- Reference : How to Compare Date in Java
- Reference : Interface vs Abstract Class
- Reference : How to use the Stream API
- Reference : How to use the Collections Framework
- Reference : How to use Comparator.Comparing
- Reference : How to Format the DateTime
Name Yiming - Yiming.Gao0907@gmail.com
Project Link: Accounting-Ledger-Application