Skip to content

TinyExpenses is a minimal, personal finance tracker built with Flask. It supports multi-user setups, tracks expenses and income by category, and exposes a simple API for automation.

License

Notifications You must be signed in to change notification settings

MateuszMyalski/tinyexpenses

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TinyExpenses

TinyExpenses is a minimal, personal finance tracker built with Flask. It supports multi-user setups, tracks expenses and income by category, and exposes a simple API for automation.

TinyExpenses dashboard

🚀 Getting Started

  1. Install Dependencies (inside root dir)
pip install -r .
  1. Set Up Your App Create a Python file wsgi.py with the following content (or modify according to your needs):
from tinyexpenses import create_app
app = create_app("tinyexpenses.config.ProductionHTTPSConfig")

Use Waitress and nginx for real production environment.

  1. Set Environment Variables Before running the app, set the required variables:
export SECRET_KEY="your-very-secret-key"

You can generate secret key with:

python -c 'import secrets; print(secrets.token_hex())'

Changing the secret key invalidates all user API tokens.

  1. Run directly (local-only)
flask run

📁 Create the Accounts Directory

TinyExpenses stores user configurations inside a folder (default: accounts/). Create it manually or point to a custom path using ACCOUNTS_DB_DIRECTORY_PATH envariomental path.

mkdir accounts

👤 Creating Users with the CLI

TinyExpenses comes with a built-in CLI to manage users.

python -m tinyexpenses.cli init-user accounts

You will be prompted to enter:

  • Username
  • Full name
  • Password (with confirmation)

Example output:

✅ User 'alice' initialized at accounts/alice/config.toml

Reset a User’s Password

python -m tinyexpenses.cli reset-password accounts alice

Prompts for a new password with confirmation.

🧠 How It Works

Each user has a separate folder under accounts/, storing their config and data.

Yearly balances are updated automatically based on categories (Income or Expense).

You can add compensation/adjustments using negative amounts (e.g., -50.0).

✅ API (Optional Use)

You can automate expense tracking by sending JSON requests with your user’s API token.

PUT /api/v1/<username>/expenses/append
X-API-Key: your-api-key
Content-type: application/json

{
  "amount": 14.99,
  "title": "Dinner",
  "category": "Food",
  "date": "2025-08-02"
}
GET /api/v1/{{ username }}/expenses/view/balance HTTP/1.1
X-API-Key: (Here put your X-API key)

About

TinyExpenses is a minimal, personal finance tracker built with Flask. It supports multi-user setups, tracks expenses and income by category, and exposes a simple API for automation.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published