A simple but powerful command-line expense tracker written in C++. Built as a portfolio project to practice OOP, file handling, STL, and clean architecture.
- Add expenses (with ID, name, amount, category, date)
- Delete expenses by ID
- View all expenses in a table format
- Calculate total spending
- Filter by category
- Search by name (case-insensitive)
- Filter by date (
YYYY-MM-DD) - Show last N expenses
-
Statistics by category
-
Monthly report (
YYYY-MM)- Total spending
- Category breakdown
- Top category
- Sort by amount
- Sort by name
- Automatic save/load from file (
expenses.txt) - CSV-like format:
id,name,amount,category,date
ExpenseTracker/
│
├── main.cpp
│
├── core/
│ ├── ExpenseManager.h
│ └── ExpenseManager.cpp
│
├── models/
│ └── Expense.h
│
├── utils/
│ └── Helpers.h
│
├── types/
│ └── Types.h
│
└── data/
└── expenses.txt
- C++ (STL)
- OOP (Classes, encapsulation)
- File I/O (
fstream) - Algorithms (
std::sort,std::remove_if) - Data structures (
std::vector,std::map)
git clone https://github.com/your-username/expense-tracker.git
cd expense-tracker
g++ main.cpp core/ExpenseManager.cpp -o tracker
./tracker
========== EXPENSE TRACKER ==========
[ BASIC ]
1. Add expense
2. Show all expenses
3. Total amount
[ FILTER ]
5. By category
6. Search by name
...
- Designing CLI applications
- Structuring medium-sized C++ projects
- Working with file persistence
- Implementing search, filtering, and statistics
- Writing cleaner and more maintainable code
- Edit existing expense
- Better input validation
- Colored CLI UI
- Export to JSON / CSV
- GUI version (Qt / ImGui)
ID Name Amount Category Date
--------------------------------------------------
1 Coffee 3.50 Food 2026-05-03
2 Taxi 12.00 Transport 2026-05-03
This project is open-source and available under the MIT License.
Pull requests are welcome. For major changes, please open an issue first.
Give it a star on GitHub ⭐