A small C#/.NET console app that tracks incomes and expenses, stores them as daily JSON files, and generates date-range reports using LINQ. Built as a solo project to practice file I/O, JSON serialization, events, and basic error handling.
- Add transactions (Income or Expense)
- Store data per day in
data/YYYY-MM-DD.json - Remove transactions by their unique Id
- Generate reports for a date range:
- All transactions, Income only, or Expense only
- Total income, total expenses, net balance
- Log each added transaction to
logs/transactions.log - Basic error handling:
- Invalid user input
- Missing or corrupted data files (skips bad files instead of crashing)
- .NET SDK 9.0 (or compatible)
- Console / terminal to run the app
dotnet restore
dotnet builddotnet runWhen the app starts, you see this menu:
=== Budget Tracker ===
1) Add transaction
2) Remove transaction
3) Generate report
0) Exit
Choose an option:
-
Choose type:
1= Income2= Expense
-
Enter description
-
Enter amount
The app will:
- Create a
Transactionwith Id, timestamp, date, type, description, amount - Append it to
data/YYYY-MM-DD.json - Log the add event to
logs/transactions.log - Show a confirmation with full details
- Enter the Id (GUID) of an existing transaction
The app:
- Searches all JSON files inside
data/ - Removes the matching transaction if found
- Shows success or “not found”
-
Enter a start and end date (
YYYY-MM-DD) -
Filter option:
1= All2= Income only3= Expense only
The app uses LINQ to calculate:
- Number of transactions
- Total income
- Total expenses
- Net balance (income − expenses)
And prints the results to the console ✨
| Type | Location | Notes |
|---|---|---|
| Daily transaction storage | data/YYYY-MM-DD.json |
JSON array of Transaction |
| Logs | logs/transactions.log |
One line per added transaction |
Both directories are created automatically if missing.
Program.cs (entry point / console menu)
│
├── Models/
│ ├── Transaction.cs
│ └── TransactionType.cs (enum)
│
├── Events/
│ └── TransactionAddedEventArgs.cs
│
└── Services/
├── StorageService.cs
├── TransactionService.cs
└── LoggerService.cs
| Component | Responsibility |
|---|---|
| Program.cs | User interaction, menu, calls services |
| StorageService | Read/write JSON, handle date-based files |
| TransactionService | Business logic, add/remove/query, raises event |
| LoggerService | Subscribes to events, writes logs |
| TransactionAddedEventArgs | Carries transaction data to event listeners |
- Invalid input → user can re-enter a valid value
- Corrupted JSON → skipped automatically
- Unexpected errors → caught & friendly message displayed
- App never crashes on user mistakes 🙌
Solo project by Büşra Demirhan Created during the WBS Coding School Software Engineering course Purpose: strengthen .NET, file I/O, JSON, events, and clean architecture skills