Financial Workflow Application CLI
Project description
FiWa CLI - Financial Tracking Application
FiWa (Financial Wallet) is a terminal-based financial tracking application built with Textual, providing a rich TUI (Text User Interface) for managing personal finances, projects, and transactions.
๐ Table of Contents
- Features
- Architecture
- Installation
- Quick Start
- User Guide
- Database Schema
- Configuration
- Development
- Project Structure
โจ Features
๐ User Management
- Multi-user support with secure password hashing (SHA-256)
- Session management with UUID-based tracking
- User login/logout with reactive state updates
- User creation with configurable project limits
- Role-based permissions (regular users and superusers)
๐ Project Management
- Multiple projects per user (configurable limit, default: 3)
- Project creation with name, description, and currency settings
- Project modification with real-time updates
- Primary project selection for active context
- Multi-currency support with main and additional currencies
- Project switching via integrated selector
๐ท๏ธ Label Management
- Hierarchical labels for categorizing transactions
- Label types: Action, Account, Label (3 levels)
- Label status: Active, Deactivated, Mark for Deletion
- Batch operations for efficient label management
- Interactive editor with click-to-edit functionality
- Label creation with validation and uniqueness checks
๐ Calendar Widget
- Interactive date picker with month navigation
- Configurable week start (Monday/Sunday)
- Today highlighting with quick jump
- Keyboard shortcuts (ESC to close)
- Compact design positioned near trigger button
๐จ User Interface
- Reactive header showing user, project, and date
- Menu system with contextual options
- Settings panel with sidebar navigation
- Dark/Light theme toggle (Ctrl+D)
- Responsive layout with grid-based components
- Modal screens for focused interactions
๐ State Management
- Reactive app_state for real-time UI updates
- Automatic screen refresh on state changes
- Session persistence across app lifecycle
- Clean logout with complete state reset
- Fallback to main screen after logout
๐๏ธ Architecture
Technology Stack
- Framework: Textual - Modern TUI framework
- Language: Python 3.12+
- Database: SQLite (local storage)
- Password Hashing: SHA-256 with salt
- State Management: Reactive variables with watchers
Design Patterns
- Screen-based navigation with modal overlays
- Message passing for component communication
- Reactive programming for state synchronization
- Database handler pattern with
op_*methods - Component-based architecture with reusable widgets
Key Components
FiWa CLI Application
โ
โโโ Main App (main.py)
โ โโโ Reactive app_state
โ โโโ Watch callbacks
โ โโโ Screen stack management
โ
โโโ Components (components/)
โ โโโ FiwaHeader - Top navigation bar
โ โโโ CalendarWidget - Date picker modal
โ
โโโ Screens (screens/)
โ โโโ Base - Login/Logout functionality
โ โโโ Menu - Navigation menu
โ โโโ Settings - Configuration hub
โ โโโ Project Selector - Switch projects
โ โโโ Reports - (Placeholder)
โ โโโ Dashboard - (Placeholder)
โ โโโ Inputs - (Placeholder)
โ
โโโ Functions (functions/)
โ โโโ handler_sqllite.py - Database operations
โ โโโ loader.py - Configuration loading
โ โโโ db_faker.py - Test data generation
โ
โโโ Database
โโโ Users
โโโ Projects
โโโ Labels
โโโ User-Project mapping
โโโ Session tracking
๐ฆ Installation
Prerequisites
- Python 3.12 or higher
- pip (Python package manager)
- Terminal with Unicode support
Install Dependencies
# Clone the repository
cd /home/koenig/Projects/00_fiwa_work/fiwa-cli
# Create virtual environment (optional but recommended)
conda create -n fiwa-cli python=3.12
conda activate fiwa-cli
# Install dependencies
pip install textual bcrypt pyyaml faker
Database Setup
The application automatically initializes the SQLite database on first run using the schema defined in schema.sql.
๐ Quick Start
Run the Application
# From the project directory
python main.py
First Time Setup
-
Create a User (if database is empty)
- Navigate: Menu โ Settings โ + Create User
- Fill in: First name, Last name, Username, Email, Password
- Click "Create"
-
Login
- Click: Menu โ Login
- Enter credentials
- Click "Login"
-
Create a Project
- Navigate: Settings โ + Create Project
- Fill in: Name, Description, Currencies
- Click "Create"
-
Create Labels
- Navigate: Settings โ + Create Label
- Fill in: Name, Description, Type, Status
- Click "Create"
๐ User Guide
Navigation
Header Bar
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ FiWa [โฐ Menu] [๐
Calendar] User | Project โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
- FiWa - Application title
- โฐ Menu - Opens main menu
- ๐ Calendar - Opens date picker
- User - Current logged-in user
- Project - Active project
Main Menu
- Inputs - Add transactions (Coming soon)
- Reports - View financial reports (Coming soon)
- Dashboard - Overview (Coming soon)
- Settings - Configure application
- Select Project - Switch active project
- Login/Logout - Manage session
- Exit - Close application
User Management
Creating a User
- Navigate to Settings โ + Create User
- Fill in the form:
- First Name (required)
- Last Name (required)
- Username (required)
- Email (required, unique)
- Password (required, will be hashed)
- Birthday (optional)
- Max Projects (default: 3)
- Click Create
- User is created and saved to database
Login/Logout
Login:
- Click Menu โ Login
- Enter username/email and password
- Click "Login"
- Session starts, app_state updates with user data
Logout:
- Click Menu โ Logout
- Confirm logout
- Session ends, returns to main screen
- All user data cleared from app_state
Project Management
Creating a Project
- Settings โ + Create Project
- Check project limit (displayed at top)
- Fill in:
- Name (required, max 24 chars)
- Description (optional)
- Main Currency (3-letter code, e.g., USD)
- Additional Currencies (comma-separated)
- Click Create
- Project added to database and app_state
Modifying a Project
- Settings โ = Modify Project
- Current project shown (selected from app_state)
- Edit fields:
- Name
- Description
- Main Currency
- Additional Currencies
- Click Update
- Changes saved, app_state updated
Switching Projects
- Menu โ Select Project
- Choose from list of your projects
- Project changes immediately
- Header updates to show new project
Label Management
Creating Labels
- Settings โ + Create Label
- Fill in:
- Name (required)
- Description (optional)
- Action Type: Account / Action / Label
- Status: Active / Inactive
- Click Create
- Label saved to database
Managing Labels
- Settings โ = Manage Labels
- View table of all labels
- Click any row to edit:
- Edit name
- Edit description
- Change status (Active/Deactivated/Deleted)
- Click Save All Changes to persist
Label Status:
- Active (2) - Label is in use
- Deactivated (1) - Label is hidden but preserved
- Mark for Deletion (0) - Flagged for removal
Calendar Usage
- Click ๐ Calendar in header
- Navigate:
- โ Previous month
- Today Jump to current month
- โถ Next month
- Select date by clicking any day
- ESC to close without selecting
๐๏ธ Database Schema
Users Table
CREATE TABLE pstand_users (
user_id INTEGER PRIMARY KEY AUTOINCREMENT,
first_name VARCHAR(255) NOT NULL,
last_name VARCHAR(255) NOT NULL,
username VARCHAR(255) NOT NULL,
birthday DATE,
email VARCHAR(255) NOT NULL UNIQUE,
password_hash VARCHAR(255) NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
activated BOOLEAN DEFAULT 1,
is_superuser BOOLEAN DEFAULT 0,
scope VARCHAR(255) DEFAULT 'user:write',
max_projects INTEGER DEFAULT 3,
unique_identifier VARCHAR(36) NOT NULL
);
Projects Table
CREATE TABLE pstand_projects (
project_id INTEGER PRIMARY KEY AUTOINCREMENT,
name VARCHAR(255) NOT NULL,
description TEXT,
created_at TIMESTAMP NOT NULL,
currency_main VARCHAR(3),
currency_list TEXT,
project_hash VARCHAR(64) UNIQUE
);
Labels Table
CREATE TABLE pstand_labels (
label_id INTEGER PRIMARY KEY AUTOINCREMENT,
name VARCHAR(36) NOT NULL,
description VARCHAR(255) NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
project_id INTEGER NOT NULL,
composite TEXT NOT NULL,
label_status INTEGER DEFAULT 2,
label_type INTEGER DEFAULT 1,
FOREIGN KEY (project_id) REFERENCES pstand_projects(project_id),
UNIQUE (name, project_id)
);
User-Project Mapping
CREATE TABLE pstand_user_project_map (
id INTEGER PRIMARY KEY AUTOINCREMENT,
user_id INTEGER,
project_id INTEGER,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
project_perm_model VARCHAR(6) DEFAULT '000000',
project_primary BOOLEAN DEFAULT 0,
excluded_tags TEXT,
FOREIGN KEY (user_id) REFERENCES pstand_users(user_id),
FOREIGN KEY (project_id) REFERENCES pstand_projects(project_id)
);
Session Table
CREATE TABLE pstand_session_table (
session_id INTEGER PRIMARY KEY AUTOINCREMENT,
user_id INTEGER NOT NULL,
session_start TIMESTAMP NOT NULL,
session_uuid VARCHAR(36) UNIQUE NOT NULL,
session_type VARCHAR(50),
FOREIGN KEY (user_id) REFERENCES pstand_users(user_id)
);
โ๏ธ Configuration
config.yml
database:
path: "./fiwa_data.db"
salt: "fiwa_default_salt_2026"
partition: "stand"
app:
mode: "terminal" # or "web"
theme: "textual-dark"
calendar:
week_starts_monday: true
Configuration Options
- database.path - SQLite database file location
- database.salt - Password hashing salt
- database.partition - Database table prefix
- app.mode - Terminal or web mode
- app.theme - UI theme (dark/light)
- calendar.week_starts_monday - Week start day
๐ ๏ธ Development
Project Structure
fiwa-cli/
โโโ main.py # Application entry point
โโโ main.css # Global styles
โโโ config.yml # Configuration file
โโโ schema.sql # Database schema
โโโ README.md # This file
โ
โโโ components/ # Reusable UI components
โ โโโ __init__.py
โ โโโ header.py # FiwaHeader component
โ โโโ calendar_display.py # Calendar widget
โ
โโโ screens/ # Application screens
โ โโโ __init__.py
โ โโโ base.py # Base screen + Login/Logout
โ โโโ menu.py # Main menu
โ โโโ settings.py # Settings screen
โ โโโ project_selector.py # Project selector
โ โโโ settings_project_new.py
โ โโโ settings_project_modify.py
โ โโโ settings_user_new.py
โ โโโ settings_label_new.py
โ โโโ settings_label_page.py
โ โโโ reports.py # Reports screen
โ โโโ dashboard.py # Dashboard screen
โ โโโ inputs.py # Inputs screen
โ
โโโ functions/ # Business logic
โโโ __init__.py
โโโ handler_sqllite.py # Database operations
โโโ loader.py # Config loader
โโโ db_faker.py # Test data generator
Database Handler Pattern
All database operations use the op_* naming convention:
# User operations
op_user_create(user_dict)
op_user_login(username, password)
op_user_logout(session_uuid)
op_user_get_info(user_id)
# Project operations
op_project_create(project_dict, user_id)
op_project_update(project_dict)
op_project_get_info(user_id)
op_get_max_projects(user_id)
# Label operations
op_label_create(label_dict, project_id)
op_label_update(label_id, label_dict)
op_label_get_all(project_id)
op_label_delete(label_id, hard_delete)
Generating Test Data
from functions.db_faker import faker_users, faker_projects, faker_labels
# Create fake users
dbh = SQLLiteHandler(db_path="./test.db")
user_ids = faker_users(dbh, n=5)
# Create fake projects
project_ids = faker_projects(dbh)
# Create fake labels
faker_labels(dbh, project_ids)
Key Bindings
- Ctrl+C - Quit application
- D - Toggle dark/light mode
- ESC - Close modals/dialogs
- Tab - Navigate between inputs
- Enter - Activate buttons
๐ฎ Roadmap
Planned Features
-
Inputs Screen
- Add transactions (income/expenses)
- Quick entry mode
- Bulk import from CSV/Excel
- Receipt attachment
-
Reports Screen
- Monthly summaries
- Category breakdowns
- Trend analysis
- Export to PDF/Excel
-
Dashboard Screen
- Budget overview
- Spending charts
- Account balances
- Savings goals
-
Items Table
- Transaction details
- Label associations
- Currency conversion
- Exchange rate tracking
-
Advanced Features
- Multi-currency conversion
- Recurring transactions
- Budget alerts
- Data export/import
- API integration
๐ License
This project is part of a private financial tracking system.
๐ฅ Contributors
- Boris Bauermeister - Lead Developer
๐ Known Issues
- Calendar widget positioning may vary on different terminal sizes
- Label table scrolling requires keyboard navigation
- Some placeholder screens (Inputs, Reports, Dashboard) are not yet implemented
๐ Support
For issues, questions, or contributions, please contact the development team.
๐ฏ Getting Help
Common Issues
Q: Database not found
- A: Run the app once to auto-create the database, or check
config.ymlpath
Q: Can't login
- A: Ensure you created a user first (Settings โ + Create User)
Q: Project limit reached
- A: Check user's
max_projectssetting in database
Q: Labels not saving
- A: Click "Save All Changes" button after editing labels
Q: Screen not updating after login
- A: This is a known issue; logout and login again
๐ Additional Resources
Version: 0.1.0-alpha
Last Updated: February 15, 2026
Status: Active Development
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fiwa_cli-0.3.0.tar.gz.
File metadata
- Download URL: fiwa_cli-0.3.0.tar.gz
- Upload date:
- Size: 214.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e49881417ac57ccf892db3995b895a7e29f59602e526572fd9c7a243a9f52cf7
|
|
| MD5 |
0f14eaa5bb711dded6ace9584a3ea684
|
|
| BLAKE2b-256 |
28cef22cb2d2db3e31a9e24e618c19ec378282b57e32cf4bf8cdf65493be7df5
|
File details
Details for the file fiwa_cli-0.3.0-py3-none-any.whl.
File metadata
- Download URL: fiwa_cli-0.3.0-py3-none-any.whl
- Upload date:
- Size: 240.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53b6d68813c023a4806f0c82d4d5ef3fc3acd7b9db3ef5cb18a289b9e6161632
|
|
| MD5 |
f5ca614afe4a3eac12095ebbc41227f9
|
|
| BLAKE2b-256 |
707635d266d90538518cbf4be3a0abff012c7b77d64e794baf6e1c2a0c69922c
|