This is a simple command-line application for tracking your personal expenses. It allows you to add, view, delete, and summarize your expenses. Additionally, it supports expense categories, monthly budgets, and exporting expenses to a CSV file.
- Add Expense: Add an expense with a description, amount, and optional category.
- Delete Expense: Delete an expense by its ID.
- List Expenses: View all expenses or filter by category.
- Expense Summary: Get a summary of total expenses, including monthly summaries.
- Set Budget: Set a budget for the current month and receive a warning if exceeded.
- CSV Export: Export your expenses to a CSV file.
- .NET SDK 6.0 or later
- Any text editor or IDE (e.g., Visual Studio, VS Code)
git clone <https://github.com/FQanbari/ExpenseTracker.git>
cd ExpenseTracker
dotnet build
dotnet run -- [command] [arguments]
dotnet run -- add --description "Lunch" --amount 15 --category "Food"
Example Output:
Expense added successfully (ID: 1)
dotnet run -- list
Example Output:
ID Date Description Amount Category
1 2024-09-01 Lunch $15 Food
dotnet run -- list --category "Food"
Example Output:
ID Date Description Amount Category
1 2024-09-01 Lunch $15 Food
dotnet run -- delete --id 1
Example Output:
Expense deleted successfully
dotnet run -- summary
Example Output:
Total expenses: $30
dotnet run -- summary --month 9
Example Output:
Total expenses for September: $30
dotnet run -- set-budget --amount 500
Example Output:
Budget set for the current month: $500
dotnet run -- export --file expenses.csv
Command | Description |
---|---|
add --description --amount [--category] |
Add a new expense with an optional category. |
delete --id [expense-id] |
Delete an expense by ID. |
list [--category] |
List all expenses, optionally filtered by category. |
summary |
Get a total summary of expenses. |
summary --month [month-number] |
Get a summary of expenses for a specific month. |
set-budget --amount [amount] |
Set a budget for the current month. |
export --file [file-path] |
Export expenses to a CSV file at the specified file path. |
- Invalid inputs (e.g., negative amounts, non-existent IDs) will return appropriate error messages.
- If the budget is exceeded, a warning will be displayed when running the
summary
command.
The expenses are stored in a local JSON file (expenses.json
). You can modify this file to manage persistent data across sessions. The file is loaded when the program starts and saved each time you add, update, or delete expenses.
- Expense Categories: You can add a category to each expense to better organize your data.
- Budget Tracking: Set a budget and receive warnings when expenses exceed that amount.
- CSV Export: Export your expenses to a CSV file for easy viewing and analysis.
- Ability to update an existing expense.
- Multiple user profiles to track expenses for different users.
- Enhanced filtering options (e.g., filter by date ranges).
- Interactive CLI for a more user-friendly experience.
This project is licensed under the MIT License.
This project is base Roadmap for backend: https://roadmap.sh/projects/expense-tracker