Sanchay Hisab

Sanchay Hisab (সঞ্চয় হিসাব) is a profit calculator for Bangladesh Sanchaypatra, the government savings certificates, in English and Bengali. For any amount across five schemes it shows the net profit per payout after source tax, the dated payout schedule, and what cashing out early pays, with the calculation running in the browser.

Timeline
2026
Role
Full-Stack Engineer
savings schemes covered
5savings schemes covered
languages: English and Bengali
2languages: English and Bengali
government rate sets on file
3government rate sets on file
share images, one per route per locale
28share images, one per route per locale

Key takeaways

  • Sanchay Hisab computes each certificate with the rate set in force on its purchase date, because a Sanchaypatra keeps that rate for its whole tenure; the September 2021, January 2025 and July 2025 rate sets ship side by side.
  • Sanchay Hisab picks the rate slab and the source-tax rate from the investor's total Sanchaypatra holding, not from the single certificate being calculated.
  • Every number in Sanchay Hisab's calculator, guides, share images and llms.txt is derived from one rate file, so a government rate revision is one appended entry rather than an edit across the site.
Screenshot of Sanchay Hisab — Next.js 16, TypeScript, next-intl project by Shafin Ahmed

The problem

A Sanchaypatra's headline rate says little about what it actually pays. The rate slab depends on the investor's total holding across every scheme, the source-tax rate depends on that same holding, and a certificate keeps whichever rate set was in force on its purchase date even after the government revises rates, which it usually reviews every January and July. Cashing out early swaps in a lower premature rate and recovers profit already paid out of the principal. Purchases above ৳10 lakh also need an e-TIN and proof of return submission.

The approach

The rules live as data in one rate file: each scheme's tenure, payout frequency, purchase ceilings and denominations, and every government rate set with its effective date, slab ceilings, maturity and premature tables, and the source it was read from with the date that source was last checked. A pure calculation engine picks the rate set from the purchase date and the slab from total holding, then returns the net per payout after source tax, the dated schedule and the maturity totals, or the early-encashment result with its clawback; a separate alerts module flags eligibility, purchase-ceiling and e-TIN/PSR requirements. The calculator keeps its state in the URL, so a result can be shared as a link. English is served at / and Bengali at /bn through next-intl, with Bengali digits in the Bengali interface. The per-page share images are drawn at build time with text shaped by HarfBuzz through harfbuzzjs and handed to resvg as glyph paths, because satori cannot shape Bengali and resvg-js 2.6 gives Bengali spacing vowel signs zero advance.

What it does

  • Five schemes: 3-month profit-based, 5-year Bangladesh Sanchaypatra, Paribar, Pensioner, and the Post Office fixed deposit
  • Net profit per payout after source tax, with the rate slab picked from total holding
  • Dated payout schedule and totals at maturity
  • Early-encashment result, including profit clawed back from the principal
  • Eligibility, purchase-ceiling and e-TIN/PSR alerts
  • Rates locked by purchase date, so past purchases compute with the rate set that applied then
  • Calculator state in the URL, so a result can be shared as a link
  • Full English and Bengali interfaces at / and /bn, with Bengali digits
  • Content pages: scheme comparison, rates and history, a guide per scheme, tax and rules, FAQ
  • 28 build-time share images, one for each of 14 routes in both locales, with HarfBuzz text shaping for Bengali
  • Results labelled as estimates, with the issuing bank, post office or savings bureau confirming the final figure
  • Deployed to Cloudflare Workers via OpenNext

Stack

Next.js 16TypeScriptnext-intlTailwind CSS v4Cloudflare WorkersOpenNextJest

Outcome

Live at sanchay.shadev-tech.com in English, and at /bn in Bengali

A rate revision is one appended entry in the rate file; the calculator, content pages, share images, llms.txt and sitemap pick it up on the next build

Bengali share images render with correct vowel-sign spacing, which neither satori nor resvg-js 2.6 managed on their own

References

Sanchay Hisab — questions

Common questions about Sanchay Hisab and how it was built.

Building something similar?

I'm open to new opportunities and project work.