A lightweight, desktop-native GUI client built in Python using Tkinter to interact with a Notes REST API. This application implements a stateful Master/Detail interface layout, allowing you to seamlessly authenticate, browse, search, create, update, and delete notes cached locally for maximum responsiveness.
This client is fully interchangeable with the CLI Go TUI and Python equivalents, communicating with the exact same database engine.
- Secure Session Authentication: Integrated login gate with token-based authorization.
- Master/Detail Layout:
- Left pane displays an interactive, scrollable list of notes using
ttk.Treeview. - Right pane features a complete rich-text editing suite for editing titles and bodies.
- Left pane displays an interactive, scrollable list of notes using
- Smart Local Caching: Minimizes server round-trips by caching notes in memory during selection toggles.
- Stateful Completion System: Visual distinction for completed notes (grayed out with a
[✓]tag in the sidebar). - Graceful Error Handling:
- Non-blocking dynamic status bar offering clear visual feedback on successful operations.
- Safe extraction logic utilizing guard clauses to prevent Tkinter index out-of-bounds callback errors.
- Native System Dialogs: Warns users and prompts for explicit confirmation before critical database actions (like deletion).
- Backend Interoperability: Compatible with any backend matching the standardized REST endpoints (Go/Fiber/Gorm, Python/FastAPI, or PHP/Laravel).
- GUI Engine: Python 3.12+ with standard libraries (
tkinter,ttk). - Dependencies:
requestslibrary for synchronous HTTP transport.
notes-gui-tkinter/
├── app.py # Main Tkinter Application UI & State Controller
├── client.py # API Engine Class wrapper (HTTP transport requests)
└── README.md # Project Documentation
- Clone the repository and navigate into the project directory:Bashcd ~/apis/notes-gui-tkinter
- Set up a virtual environment and activate it:
python3 -m venv venv
source venv/bin/activate- Install the HTTP client transport dependency:
pip install requestsor
pip install -r requirements.txt- Verify Backend Address: Open app.py and ensure the API client initialization points to your active server URL:Pythonself.api = APIClient("http://127.0.0.1:8002")
- Execute the Application:
python3 app.py- Select a Note: Click any note in the left panel to load its content into the editor instantly from memory.
- Create New: Click the New Note button to clear the text editor, focus your typing cursor, and safely reset active selection states.
- Save Updates: Edits to an existing note are saved securely on-save. If no note is selected, the application automatically defaults to creating a brand new record instead.
- Verification Popups: The Delete Note option triggers a system-native modal checking if you are sure before calling the API.