Comprehensive documentation for the Go Money personal finance system.
Start here to minimize token usage.
| Quick Reference | Description |
|---|---|
| INDEX.md | Master index - find any doc by keyword |
| Schema Quick-Ref | All tables, columns, enums in one file |
| Business Logic Quick-Ref | Formulas, rules, transaction behavior |
| Analytics Quick-Ref | Query templates ready to use |
- Schema Overview - ER diagram and table summary
- Enum Reference - All enum values and meanings
- Index Reference - Database indexes for optimization
| Table | Description |
|---|---|
| accounts | Bank accounts, credit cards, categories |
| transactions | All financial transactions |
| categories | Transaction categories |
| tags | Flexible transaction tags |
| currencies | Currency definitions and rates |
| rules | Transaction processing rules |
| double_entry | Double-entry bookkeeping ledger |
| stats | Pre-computed daily statistics |
| users | User authentication |
| import_deduplication | Import duplicate detection |
- Analytics Overview - Data sources and concepts
- Common Queries - Ready-to-use SQL queries
- Performance Tips - Query optimization
- Balance Queries - Net worth, account balances
- Transaction Queries - Filtering, pagination
- Category Analysis - Spending by category
- Tag Analysis - Tag-based queries
- Time Series - Trends and comparisons
- MCP Overview - AI-assisted database queries
- Tool Reference - Query tool specification
- Query Safety - Security and validation rules
- Query Examples - Natural language to SQL mappings
- Authentication - JWT tokens and service tokens
- Endpoints - Complete API reference
| Type | Value | Purpose |
|---|---|---|
| Asset | 1 | Cash, bank accounts, investments |
| Liability | 4 | Credit cards, loans, debts |
| Expense | 5 | Spending categories |
| Income | 6 | Revenue sources |
| Adjustment | 7 | Balance adjustments |
| Type | Value | Description |
|---|---|---|
| Transfer | 1 | Between Asset/Liability accounts |
| Income | 2 | Money received |
| Expense | 3 | Money spent |
| Adjustment | 5 | Balance correction |
- Each account has a currency
- Transactions store amounts in original and base currency
currencies.rateconverts to base currency:base_amount = amount / rate
Every transaction creates:
- One debit entry (is_debit = true)
- One credit entry (is_debit = false)
- Total debits always equal total credits
Most tables use soft deletes:
deleted_at IS NULL= active recorddeleted_at IS NOT NULL= deleted record- Always filter with
WHERE deleted_at IS NULL
SELECT * FROM accounts WHERE deleted_at IS NULL;SELECT SUM(destination_amount_in_base_currency)
FROM transactions
WHERE transaction_type = 3
AND deleted_at IS NULL
AND DATE_TRUNC('month', transaction_date_only) = DATE_TRUNC('month', CURRENT_DATE);SELECT SUM(CASE
WHEN type = 1 THEN current_balance
WHEN type = 4 THEN -current_balance
ELSE 0
END) as net_worth
FROM accounts
WHERE type IN (1, 4) AND deleted_at IS NULL;SELECT * FROM transactions
WHERE :tag_id = ANY(tag_ids)
AND deleted_at IS NULL;- Start with Schema Overview for the big picture
- Review Enum Reference to understand field values
- Explore Common Queries for analytics patterns
- Use MCP Overview for AI-assisted queries