How fissionlife/expencetracker works
WalletLedger is a Telegram-first expense tracker: people send plain-language transactions or statements, the bot’s agent interprets requests and uses ledger tools, and deterministic guardrails check actions and replies. The same ledger powers analytics, charts, and a signed-link dashboard; onboarding and user-managed AI keys support setup. The graph also shows database and encryption layers. Some connections are documented only by the README or SOURCE INDEX; unsampled implementation details are not inferred.
Main entry points: ledger.py Ledger operations · agent.py Conversation agent · main.py Message router · db.py Database access
Components 21
App entry and bot
- Telegram adapter
app/bot/telegram.py - Message router
app/bot/main.py - Onboarding
app/bot/onboarding.py - FastAPI app
main.py
AI and controls
- Conversation agent
app/bot/agent.py - Guardrails
app/bot/guardrails.py - AI key management
app/bot/keys.py - LLM gateway
app/services_ai/ai_gateway.py - Statement parser
app/services_ai/transaction_parser.py - Tool client
app/services_ai/tool_client.py - MCP tool server
app/services_ai/mcp_server.py
Ledger and insights
- Ledger operations
app/services/ledger.py - Financial analytics
app/services/analytics.py - Bot screens and charts
app/bot/views.py - Web dashboard
app/web/dashboard.py
Data and security
- Database access
app/db.py - Finance and user models
app/models.py - Encryption at rest
app/crypto.py - Configuration
app/config.py
Other components
- Telegram user
- AI providers
Connections 29
- Telegram user → Telegram adapter: sends messages
- Telegram adapter → Message router: routes updates
app/bot/telegram.py - Message router → Conversation agent: handles messages
app/bot/main.py - Message router → Statement parser: parses statements
app/bot/main.py - Message router → Onboarding: starts setup
app/bot/main.py - Conversation agent → Guardrails: checks actions
app/bot/agent.py - Conversation agent → LLM gateway: requests completions
app/bot/agent.py - Conversation agent → Tool client: calls tools
app/bot/agent.py - Conversation agent → Ledger operations: uses ledger
app/bot/agent.py - AI key management → LLM gateway: manages keys
app/bot/keys.py - LLM gateway → AI providers: calls models
- Tool client → MCP tool server: calls over stdio
app/services_ai/tool_client.py - Tool client → Ledger operations: runs direct tools
app/services_ai/tool_client.py - MCP tool server → Ledger operations: dispatches tools
app/services_ai/mcp_server.py - Ledger operations → Database access: reads and writes
app/services/ledger.py - Financial analytics → Database access: queries records
app/services/analytics.py - Bot screens and charts → Financial analytics: builds reports
app/bot/views.py - Bot screens and charts → Ledger operations: reads balances
app/bot/views.py - Web dashboard → Financial analytics: builds reports
app/web/dashboard.py - Web dashboard → Ledger operations: reads ledger
app/web/dashboard.py - FastAPI app → Telegram adapter: starts adapter
main.py - FastAPI app → Message router: mounts router
main.py - FastAPI app → Web dashboard: mounts router
main.py - FastAPI app → Database access: initializes database
main.py - Database access → Finance and user models: creates tables
app/db.py - Finance and user models → Encryption at rest: encrypts fields
app/models.py - Configuration → Database access: configures database
app/db.py - Configuration → Encryption at rest: supplies secret
app/crypto.py - LLM gateway → Encryption at rest: protects API keys
app/services_ai/ai_gateway.py