Own product · free to use · live on Netlify · source private

Mizan: Household Budget Companion

A household money companion: log spending in seconds from Telegram or the web, and get one number back, what you can safely spend today.

01 // Problem

I kept my family's budget in an Excel sheet for four years, then stopped. Entering a purchase meant opening a laptop and finding the row, and only one person could do it, so the rest of the family never joined in. Mizan's goal is a purchase logged in under five seconds from apps the family already uses, turned into a number everyone trusts.

languages: Arabic, English, Turkish
3
test files
102
database migrations
24
commits
114

02 // Architecture

  1. L1ClientsA Telegram bot that takes text, voice notes and receipt photos, and a right-to-left Next.js PWA with a quick-entry keypad. Both call the same services.
  2. L2APIA Hono app mounted inside Next.js at /api/v1, with zod schemas that drive validation, types and the OpenAPI output. Routes stay thin and hand off to a service layer, then to Drizzle repositories.
  3. L3AIThe Vercel AI SDK over free tiers: Gemini Flash-Lite, then Gemini Flash, then two Groq models for text; Groq Whisper, then Gladia, then Gemini for voice.
  4. L4DataSupabase Postgres and Auth through Drizzle, with SQL migrations.
  5. L5OperationsNetlify through OpenNext, a service worker built with Serwist, Sentry for errors, and scheduled GitHub Actions for jobs and the weekly backup.

03 // Key_Decisions

D.01

Code before the model

A pattern parser reads the common cases, such as "bread 500" or a currency exchange, in Arabic or Latin digits. Only what it cannot read goes to a model, which keeps free quotas for the hard messages.

D.02

A message never waits on one quota

A limit, an outage, a timeout or an answer that misses the schema moves the message to the next provider in the chain. A real bug stops instead, keeps the message for review, and tells the sender the fault is ours.

D.03

Money keeps the rate of its day

Amounts are numeric columns, never floats, and every transaction stores its currency, its rate to the base currency and its base amount. Prices move fast, so history keeps the rate that applied when the money was spent.

D.04

Access is checked in the service layer

The ORM connects with full rights, so database row policies cannot be the guard. Every service checks household membership before it reads or writes.

D.05

A webhook that answers fast and once

The Telegram route checks the secret header in constant time, records each update_id once so a retry is ignored, answers at once and does the work in Next.js after().

D.06

Weekly encrypted backups

A scheduled workflow takes an encrypted pg_dump every Friday and keeps it for 90 days.

04 // Stack

  • Next.js
  • Hono
  • Supabase
  • Drizzle
  • Telegram Bot API
  • Gemini
Next // SYS.MOD_03Max CLI: Terminal Assistant