Building Yarphel: a GST-ready shop app for Bhutan in seven weeks.
How a billing and stock app went from an empty monorepo to a store-ready release - the API rewrite, offline sales, an AI helper called Otto, and the rules that kept 210 commits honest.

On 1 January 2026 Bhutan introduced a 5% GST. Overnight, the thing every shop needed at the counter stopped being an inventory spreadsheet and became a correct, GST-ready bill. Yarphel is my answer to that: billing and stock for Bhutanese businesses, on the phone they already carry. It lives at yarphel.com.
This is how it was built, from the first commit on 14 October to a store-ready Android release seven weeks later.
Billing first, because the law said so
Before writing code I wrote the strategy down. There are about 12,000 retail trade licences in Bhutan, and roughly 13,000 to 16,000 businesses that could realistically pay for software. Most sit under the Nu 5M turnover line where GST registration is mandatory, so billing is useful to them rather than forced.
That shaped one decision above all others: stock is only right when the sale updates it. An inventory-only app loses. So the counter came first, and every bill writes straight into stock.
One repo, four apps
Yarphel is a pnpm and Turborepo monorepo. There is a Flutter shop app (Yarphel Business), a Flutter shopper app, a Next.js website with sign-up and an admin, and one API behind all of them. Both Flutter apps share a design system package, so a fix to a button ships in both apps at once.
apps/
api/ Go API: auth, businesses, team, products, sales
web/ Next.js 16: website, sign-in, superadmin
business/ Flutter: the shop app
consumer/ Flutter: the shopper app
packages/
yarphel_ui/ shared Flutter design systemRewriting the API in Go
The first API was TypeScript. By early November I had removed it and replaced it with a Go monolith: chi for routing, pgx for Postgres on Neon, and numbered SQL migrations embedded in the binary and run on start. One package per domain - auth, business, sale, stock, report, ask - each with a handler for HTTP and a service for the logic and SQL.
Errors were the part I cared about most. Every failure has one shape, and the message is written for a person, because the apps show it exactly as sent.
{ "error": { "code": "validation_failed", "message": "...", "details": {}, "requestId": "..." } }Sign-in uses 15-minute access tokens and refresh tokens that are stored only as a hash and rotated on every use. Reusing an old refresh token revokes the whole session, which turns a stolen token into a signed-out device instead of a quiet breach.
The counter has to work offline
Shops lose signal. A sale cannot wait for the network, so the phone records it and queues the change as a sync job, then flushes the queue when it is back online. Most of the hard bugs lived here: jobs discarded in the middle of a flush, a sync indicator that could get stuck, two scans of the same item. Each one got a fix and a test, and the app now shows a quiet banner while it catches up.
A detour through native
In the second week of November I tried the apps fully native: SwiftUI with Liquid Glass on iOS 26 and Jetpack Compose on Android, with design kits for both and strings generated from the same translation files. It looked beautiful. It also doubled the surface area for one developer. Flutter stayed the main product, and the native work fed back into it as better motion, glass headers and platform-native dialogs.
An audit week
On 7 November I stopped adding features and audited the business app area by area: core, stock, products, scanning and customers, team, auth, notifications and sync. Each area got its own branch of fixes and tests, then they merged back together. It is the least glamorous week in the history and the one I would repeat first.
Otto, and AI where it earns its place
AI is a selling point, not the product. Otto is the in-app helper: ask questions about your own business in plain language from the Search tab, or photograph a supplier bill and let Otto turn it into stock. Photo imports are kept for 90 days, and AI use is metered in credits per plan so the feature pays for itself.
Shipping
The last stretch was the work no one sees: store-ready iOS and Android config, a one-command production Android release, a Google Play runbook, an account deletion page, Sentry for the API, PostHog for product analytics, and a privacy policy that actually describes what the phone app does. The business app is on its fifth release build.
The rules that kept it honest
A few constraints did more for the code than any framework. Files stay small - one widget per file in the design system. Repositories never throw; they return a failure the UI can show. Copy uses plain hyphens and plain words. And every new screen copies the shape of one reference feature, so the codebase reads like it was written by one person. It was.
210 commits later, Yarphel is ready for the counter. The next chapter is getting it into shops.