For four years, a developer named Abubakr Alsheikh tracked his familyβs spending in an Excel sheet that eventually died because logging purchases was too cumbersome. To fix this, he built Mizan, a Telegram bot that accepts text, voice notes, and receipt photos, all running on a strict $0 budget. The project demonstrates how to engineer a robust, multi-currency application using free-tier services and serverless architectures without compromising user experience.
The Zero-Cost Architecture
Alsheikh imposed a hard constraint: every service had to fit within a free tier, and no long-running server could sleep on idle, as a 30-second wake-up time feels broken to users. He ruled out NestJS on free container hosts and instead chose Next.js 16 App Router for the web and API layer, mounting Hono at /api/v1/*. The database and authentication are handled by Supabase Postgres and Auth, while hosting is managed via Netlifyβs free tier through OpenNext. Cron jobs are executed by GitHub Actions calling endpoints guarded by secrets, ensuring reliability without paid schedulers.
Handling AI Fallbacks and Free Quotas
Since free AI quotas run out and models get busy, the bot uses a provider interface that chains fallbacks. For text and receipts, it tries Gemini Flash-Lite, then Gemini Flash, and finally Groq gpt-oss-120b and gpt-oss-20b. Voice notes are processed by Groq whisper-large-v3, then Gladia, then Gemini with audio input. Crucially, the system skips the model entirely for common phrases like "bread 50" or previously logged items, resolving them locally. This approach not only saves quota but also makes the bot faster, with a test set of 95 real messages ensuring over 90% accuracy.
Arabic-First Design and Data Integrity
Mizan is designed Arabic-first, rendering right-to-left using Tailwindβs logical utilities like ms-* and pe-* to replace physical directions. This ensures the layout works seamlessly for Arabic, English, and Turkish users via next-intl. Financial data is stored in Postgres numeric types to avoid floating-point errors, with each amount carrying a currency_code for households managing Syrian pounds, dollars, and euros. Dates are calculated based on the householdβs timezone rather than the server clock, ensuring an 11 pm entry in Damascus belongs to the correct day.
Key Takeaways
- Use serverless after() hooks to handle slow AI calls without triggering Telegram retries.
- Implement local resolution for common commands to save on AI quotas and reduce latency.
- Store financial data in decimal-safe types and always associate amounts with currency codes.
- Use Tailwind logical utilities to build RTL-compatible layouts that work across languages.
The Bottom Line
Building a production-grade app on $0 is possible if you treat free-tier limits as design constraints rather than afterthoughts, forcing you to build faster, more resilient systems.