Skip to content

Skyl1te/ExpenseTracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

💸 Expense Tracker (C++ CLI)

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.


🚀 Features

📌 Core functionality

  • Add expenses (with ID, name, amount, category, date)
  • Delete expenses by ID
  • View all expenses in a table format
  • Calculate total spending

🔍 Search & Filtering

  • Filter by category
  • Search by name (case-insensitive)
  • Filter by date (YYYY-MM-DD)
  • Show last N expenses

📊 Analytics

  • Statistics by category

  • Monthly report (YYYY-MM)

    • Total spending
    • Category breakdown
    • Top category

🔃 Sorting

  • Sort by amount
  • Sort by name

💾 Persistence

  • Automatic save/load from file (expenses.txt)
  • CSV-like format:
id,name,amount,category,date

🧱 Project Structure

ExpenseTracker/
│
├── main.cpp
│
├── core/
│   ├── ExpenseManager.h
│   └── ExpenseManager.cpp
│
├── models/
│   └── Expense.h
│
├── utils/
│   └── Helpers.h
│
├── types/
│   └── Types.h
│
└── data/
    └── expenses.txt

🛠️ Technologies Used

  • C++ (STL)
  • OOP (Classes, encapsulation)
  • File I/O (fstream)
  • Algorithms (std::sort, std::remove_if)
  • Data structures (std::vector, std::map)

▶️ How to Run

1. Clone repo

git clone https://github.com/your-username/expense-tracker.git
cd expense-tracker

2. Compile

g++ main.cpp core/ExpenseManager.cpp -o tracker

3. Run

./tracker

💡 Example Usage

========== EXPENSE TRACKER ==========

[ BASIC ]
1. Add expense
2. Show all expenses
3. Total amount

[ FILTER ]
5. By category
6. Search by name

...

🧠 What I Learned

  • Designing CLI applications
  • Structuring medium-sized C++ projects
  • Working with file persistence
  • Implementing search, filtering, and statistics
  • Writing cleaner and more maintainable code

🔮 Future Improvements

  • Edit existing expense
  • Better input validation
  • Colored CLI UI
  • Export to JSON / CSV
  • GUI version (Qt / ImGui)

📸 Preview

ID   Name           Amount    Category       Date
--------------------------------------------------
1    Coffee         3.50      Food           2026-05-03
2    Taxi           12.00     Transport      2026-05-03

📄 License

This project is open-source and available under the MIT License.


🤝 Contributing

Pull requests are welcome. For major changes, please open an issue first.


⭐ If you like this project

Give it a star on GitHub ⭐

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors