~/adnan-ahmed
Adnan Ahmed
All projects

Mizan (ሚዛን)

Live

Production-grade multi-tenant sales & billing analytics SaaS for Ethiopian enterprises, with real-time MRR telemetry and Chapa ETB billing.

Next.jsNode.jsPostgreSQLChapa APIRechartsTailwind CSS

Live Application: mizan-saas-pied.vercel.app
Source Repository: github.com/PROFESSOR-ADNAN/mizan-saas

The problem

Ethiopian businesses and growing startups often operate in an analytical blind spot: retail sales happen across fragmented physical POS terminals, unorganized paper notebooks, and Telegram merchant channels. Business owners have no single place to track real-time Monthly Recurring Revenue (MRR), cohort retention, channel-by-channel sales volume, or customer churn. Furthermore, international billing SaaS tools (like Stripe Billing or ChartMogul) do not support domestic Ethiopian Birr (ETB) payment infrastructure or local business workflows.

The solution

Mizan (ሚዛን, meaning "scale" or "balance" in Amharic) provides a centralized, multi-tenant analytics and subscription platform. Businesses can connect their sales telemetry via REST APIs or batch imports, view instantaneous revenue trends, manage team permissions, issue scoped developer API keys, and collect customer subscription fees in Ethiopian Birr through the Chapa payment gateway.

Engineering highlights

  • Multi-tenant organization boundary enforcement: Complete data isolation enforced at the database query layer via tenant IDs and middleware checks. Each organization maintains its own team members, RBAC roles (Owner, Admin, Analyst, Viewer), and distinct data sources.
  • Financial metrics calculation engine: Real-time computation of vital SaaS and retail KPIs: MRR, ARR, Average Revenue Per Account (ARPA), customer churn rate, and cohort lifetime value (LTV).
  • Chapa ETB subscription billing: Automated recurring billing workflows integrated with Chapa webhooks, processing Telebirr, CBE Birr, and domestic card transactions with HMAC-SHA256 signature verification.
  • Developer API key system: Enterprise API key provisioning (mzn_live_...) with permission scopes (read-only telemetry vs. write access), SHA-256 database hashing, and per-key rate limiting.
  • Shareable read-only dashboard tokens: Time-limited, cryptographically signed tokens allowing founders to generate secure, view-only links for investors or external accountants without granting full dashboard access.

Review & architectural takeaways

Designing multi-tenant SaaS requires deciding tenant isolation boundaries early. Row-level tenancy with strict Prisma/PostgreSQL foreign key constraints allowed Mizan to maintain high query efficiency and atomic transactional rollbacks while providing clean operational separation between distinct business organizations.