Budget Tracker GUI: Same Data, More Visible
The CLI version of the budget tracker worked. Add a transaction. View totals. Close the terminal. But numbers in a terminal only tell part of the story. A pie chart shows the same data in under a second. Export means you can open the data in a spreadsheet instead of copy-pasting JSON. The GUI version added those things without changing the core logic.
Same Backend, New Frontend
The BudgetTracker class stayed almost untouched. It still manages Transaction objects, persists them to JSON files, and calculates category totals with generator expressions. The difference is the interface. CustomTkinter replaced print and input with text fields, dropdowns, and buttons.
The data layer separates cleanly from the UI for the same reason a function that returns a value is easier to reuse than one that prints it. The backend did not care whether it was driven by a terminal or a window. It accepted a method call either way.
What the GUI Added
The pie chart is the most useful addition. Matplotlib draws a circle split by category totals, and the application displays it inside the window using PIL to convert the rendered figure to a displayable image. A 377 line budget tool does not need a data visualization pipeline. Having one makes it feel complete.
Export to CSV and Excel use the csv module and pandas respectively. Neither required much code. Both made the tool useful outside itself. Data locked inside an application is data you cannot query, filter, or share.
The login screen uses hardcoded credentials. root with password root. user1 with password user1. It is not security. It is a partition. Each user gets their own JSON file, which prevents one person's transactions from spilling into another's view.
What I Would Change
The credentials are hardcoded. The categories are fixed. There is no way to edit or delete a transaction once it is saved. The date field is a text input and accepts anything, which means the data is only as consistent as the person typing it.
These are the same limitations the CLI version had. The GUI made the tool more accessible. It did not make it more robust. That was the right tradeoff for the time. A tool that works and has rough edges is better than a tool that never ships because the rough edges will not smooth out.