Wallets are the top-level organizational unit in Life Cost. Every transaction belongs to exactly one wallet, so you can keep separate accounts — for example a personal wallet, a household wallet, or a travel budget — without mixing their numbers together. All registered users automatically have access to every wallet, making Life Cost suited to shared finances across a household or team.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/akevalion/life_cost/llms.txt
Use this file to discover all available pages before exploring further.
How Wallets Work
When a new wallet is created via the API, the server immediately adds every existing user to it through theuser_wallet association table. This means no manual permission grants are ever required: all wallets are visible to all users from the moment they are created.
Each user remembers which wallet they were browsing last. When the page loads, the app reads current_user.last_visited_wallet_id to decide which wallet’s transactions and calendar data to show. Switching wallets from the UI writes this value back to the database immediately.
Wallet Data Model
TheWallet model is defined in app/models.py:
| Field | Type | Notes |
|---|---|---|
id | Integer (PK) | Auto-incremented primary key |
name | String (150) | Unique across the system; required |
description | String (300) | Optional free-text description |
users | Relationship | Many-to-many via the user_wallet table |
created_at timestamp recording when each user was linked to each wallet:
Switching Wallets in the UI
The page header contains a<select> dropdown (#groupSelector) pre-populated with every wallet the logged-in user belongs to. The currently active wallet is pre-selected based on last_visited_wallet_id.
When the user picks a different wallet, the change handler in ajax.js fires a POST /update_last_visited_wallet request and then reloads the page so every widget (table, calendar, charts) refreshes for the newly selected wallet:
wallet_id field, updates current_user.last_visited_wallet_id, and commits to the database:
Multi-User Wallet Sharing
Every wallet is shared across all users automatically. WhenPOST /add_wallet is called, the handler iterates over every User row and appends the new wallet to each user’s wallets relationship before committing:
set_user_wallets helper assigns all existing wallets to that user and sets last_visited_wallet_id to the first wallet found.
When a new wallet is created, every existing user is automatically added to it via the
user_wallet association table. No manual permission step is required.API Quick Links
Get Wallet
GET /wallet/<id> — Retrieve a single wallet by ID.Add Wallet
POST /add_wallet — Create a wallet and assign it to all users.Update Last Visited
POST /update_last_visited_wallet — Persist the active wallet for the current user.