Work / Expense tracking bot / 2026

Ledger on WhatsApp

Text a WhatsApp number what you spent and it keeps the books: budgets, transfers, reminders and plain-language answers about your money.

Role
Solo. Bot, intents, deployment
Status
Deployed on Railway
Stack
Python, FastAPI, MongoDB (Motor), APScheduler, Docker, Railway
Link
Private for now

The boundary

Stays inside

  • The ledger in MongoDB
  • Budgets and reminders
  • WhatsApp and model credentials in env

Allowed to cross

  • Incoming WhatsApp messages
  • Replies and scheduled reminders

The model reads a message and picks an intent. The ledger does the arithmetic.

Context

Expense apps fail because opening them is a chore. Everyone already has a chat open all day.

Idea

Make the chat the interface and keep the model away from the numbers: it classifies each message into one of seven intents, and plain code updates the ledger.

Craft

  1. Seven intent handlers: expense, budget, transfer, query, reminder, analyst and chat.
  2. A scheduler sends reminders and summaries on time zones that are set, not guessed.
  3. Every inbound webhook is verified with an HMAC SHA-256 signature and hmac.compare_digest before a byte is parsed.
  4. Containerised with a single compose file and deployed to Railway behind a /health check.

Threat model

AssetThreatControl
Financial historyModel hallucinating totalsTotals computed in code, never by the model
Bot tokensLeak in the image or repoEnv file at runtime, ignored by git
WebhookForged requestsHMAC SHA-256 signature check, constant-time compare

Outcome

Deployed on Railway from a Docker image and used through an ordinary WhatsApp chat.