Skip to content

Latest commit

 

History

History
148 lines (119 loc) · 6.86 KB

File metadata and controls

148 lines (119 loc) · 6.86 KB

Go Money Documentation Index

For AI Agents: Start here. This index maps all documentation with keywords for efficient navigation.

Quick References (Read These First)

File Description
Schema Quick-Ref All tables, columns, types, enums in one file
Business Logic Quick-Ref Formulas, transaction rules, account rules
Analytics Quick-Ref Query templates with descriptions
Frontend Architecture Per-page config, transport, MCP servers — read before frontend work

By Use Case

"I need to write a SQL query"

Document Keywords
Analytics Overview query basics, table selection, data sources
Common Queries 25+ ready SQL examples, spending, income, net worth
MCP Examples natural language to SQL, 30+ mappings
Performance Tips indexes, optimization, daily_stat vs transactions

"I need to understand the database schema"

Document Keywords
Schema Overview ER diagram, table relationships, foreign keys
Enums Reference TransactionType, AccountType, AccountFlags, all enum values
Indexes database indexes, query optimization

"I need details about a specific table"

Table Document Key Fields
accounts accounts.md id, name, type, currency, current_balance
transactions transactions.md source/destination amounts, dates, category_id, tag_ids
categories categories.md id, name
tags tags.md id, name, tag_ids array
currencies currencies.md id, rate, decimal_places
daily_stat stats.md account_id, date, amount (running balance)
double_entries double_entry.md is_debit, amount, ledger
rules rules.md Lua scripts, sort_order, group
users users.md login, password (bcrypt)

"I need to understand how transactions work"

Document Keywords
Transaction Overview creation flow, processing pipeline
Transaction Types expense, income, transfer, adjustment behavior
Amount Calculations base currency conversion, FX, formulas
Double-Entry debit/credit rules, ledger entries
Import Deduplication import dedup, internal_reference_numbers, skip & remember, import_ignored_transactions, MarkTransactionsIgnored

"I need to understand accounts"

Document Keywords
Account Types asset, liability, expense, income, which accounts for which tx
Balance Tracking current_balance updates, daily_stat recalculation

"I need to understand the API"

Document Keywords
Authentication JWT, RS256, service tokens, login flow
Endpoints all endpoints, request/response schemas, Connect protocol

"I need to understand the MCP server"

Document Keywords
MCP Overview read-only queries, AI integration
Client Setup go-money-mcp-client stdio bridge, Claude config, flags, token
Tool Reference query tool spec, parameters, output format
Query Safety blocked statements, limits, allowed tables
Golden Rules must-read for agents before generating queries
Examples natural language → SQL mappings

Query Patterns by Topic

Topic Document Example Query
Net Worth balance-queries.md SUM(CASE WHEN type=1 THEN balance...)
Monthly Spending transaction-queries.md WHERE transaction_type=3 AND DATE_TRUNC...
Category Breakdown category-analysis.md GROUP BY category_id
Tag Filtering tag-analysis.md WHERE tag_id = ANY(tag_ids)
Trends Over Time time-series.md DATE_TRUNC, LAG, rolling averages

Key Constants

Transaction Types

Value Name Use
1 Transfer Between asset/liability accounts
2 Income Money received
3 Expense Money spent
5 Adjustment Balance correction

Account Types

Value Name Use
1 Asset Bank accounts, cash, investments
4 Liability Credit cards, loans
5 Expense Spending categories
6 Income Revenue sources
7 Adjustment Balance adjustments

Essential WHERE Clauses

WHERE deleted_at IS NULL           -- Active records only
WHERE transaction_type = 3         -- Expenses only
WHERE type IN (1, 4)               -- Assets and liabilities (for net worth)

Code Examples

File Description
lua/set_category_by_title.lua Auto-categorize by transaction title
lua/convert_from_withdrawal_to_transfer.lua Convert withdrawal to transfer
lua/scheduled_withdrawal.lua Scheduled recurring transaction
reporting/queries/withdrawals_by_tag.sql SQL report example

Utility Documentation

File Description
debug.md Frontend debugging (custom API host)

Cross-Reference Map

If you're reading... Also see...
schema/tables/transactions.md business-logic/transactions/types.md
schema/tables/accounts.md business-logic/accounts/types.md
schema/tables/double_entry.md business-logic/double-entry/overview.md
schema/tables/stats.md business-logic/statistics/daily-stats.md
analytics/common-queries.md mcp/examples.md
api/authentication.md api/endpoints.md
business-logic/transactions/import-deduplication.md schema/QUICK-REF.md (import_ignored_transactions)