Перейти к содержанию

OneWallet — Platform Overview

OneWallet is a licensed e-money wallet for Thailand. It works in Thai baht and is regulated by the Bank of Thailand. It isn't one app — it's a small family of services that let people top up, send money to each other, pay shops by QR, and open partner "mini-apps" right inside the wallet.

Here's the short tour, focused on the parts I think are actually worth talking about.

The big idea

Two early decisions shaped almost everything else.

All money moves through one door. Every payment — no matter who starts it — goes through a single endpoint on the Payment Manager, and every request is signed. There are no quiet "trusted" shortcuts that skip the check.

Each service minds its own business. Personal data, the payment engine, and the ledger are kept apart. A service can only touch what it owns, right down to the database: identity lives in one schema, payments in another, and the two never overlap.

Together those two rules are what make the system safe to audit for a regulator, and safe to extend with code we didn't write ourselves.

How it fits together

flowchart LR
    A["📱 Flutter apps"] --> N["nginx"]
    N --> AC["Auth Center<br/>identity · KYC · mini-app catalog"]
    AC -->|signed request| PM["Payment Manager<br/>the one payment endpoint<br/>rule engine · limits"]
    PM --> TB[("TigerBeetle<br/>the ledger")]
    PM -->|Redis Streams| PSP["PSP adapters<br/>bank rails"]
    AC -.->|balance · status| A

A few rules keep the money side honest:

  • Only the Payment Manager is allowed to write to the ledger. Everyone else reads.
  • The ledger keeps itself balanced — by design, money can't quietly appear or disappear.
  • Every payment carries the same trace id from start to finish, so you can follow it through the logs.

Fees and limits aren't hard-coded. The Payment Manager runs a small rule engine. Every transaction is tagged — its type, who's involved, which channel it uses — and the engine matches those tags against fee rules and limit rules kept in the database. Operators edit them in the admin panel, and can even preview a new fee rule before it goes live, without anyone changing code or shipping a release. The same tag-matching idea decides who sees which mini-app, so one simple concept covers pricing, limits, and targeting.

The services

Service What it does Built with
Auth Center Login, KYC, personal data, the mini-app catalog. Stays a thin layer in front of payments. Serverpod (Dart)
Payment Manager The payment engine — the single signed endpoint, rules, limits, and the ledger. Node + Fastify + TigerBeetle
One Wallet app The consumer wallet: P2P, QR, mini-apps, news feed. Flutter
Merchant app A point-of-sale app: take payments by QR invoice (backlog). Flutter
Admin panel The operator console: users, KYC review, mini-apps, fees, monitoring. SvelteKit
Blog CMS The "What's on" content the apps show. SvelteKit
KYC worker Reads ID documents and matches faces. Node
Notifications Push notifications. Node + Firebase

All three Flutter apps share the same generated client and the same UI kit. What changes between them is the theme, the artwork, and which endpoints each one is allowed to call.

Mini-apps — the part I like most

A mini-app is just a web app that opens inside the wallet — the same idea as Telegram's mini-apps. The user never logs in: the wallet quietly tells the app who they are, hands it the theme and colours to use so it blends in with the host, and exposes a small bridge for native features like the PIN screen. It works in three steps.

1. The catalog decides who sees what. Each mini-app is tagged — some tags are worked out automatically (your account type, language), others are set by hand for things like partner programs or beta access. So the right people see the right mini-apps, and the list is cached cleverly so the app barely re-fetches it.

2. Opening one hands it a short-lived pass. When you tap a mini-app, the wallet asks Auth Center for a signed token that lasts five minutes and works only once. The mini-app checks the signature against a public key, then swaps the pass for a normal session.

3. Inside, it talks to the wallet two ways. Its backend asks the wallet for the bits it's allowed to see — profile, balance, history — always masked, never raw. Its frontend uses a small bridge to ask the wallet to do things, like pop up the native PIN screen to confirm a payment.

The whole point: a mini-app never sees the ledger and never holds the signing key. It only gets masked data, and any payment goes out through its own backend, which signs the call to the Payment Manager. So even if a mini-app is compromised, the user's money stays safe.

Mini-apps we've built

Mini-app What it is Notes
demo-miniapp The template every new mini-app starts from, with a playground for the whole SDK. Reference
coupons-app Shows a user's coupons and vouchers, pulled from an external Odoo system. Live
prepaid-cards Buy a prepaid card with an outside card payment, then activate it to top up the wallet. Being rebuilt
exchange-app Helps tourists find nearby money-exchange booths on a map, with rates and shop details. Live
esim A shop for local Thai eSIM data plans — sign up, pass a quick KYC, pay, and the eSIM is yours. Live
one-dining-app Lets tourists find a restaurant and book a table from inside the wallet. In progress
one-apartments A property marketplace — search homes to buy or rent, with a map and filters. Live
travel-guide-app A travel guide for tourists: places to see and things to do, by city. Live
one-insta-app A stories-style feed for short, visual updates inside the wallet. In progress

It's worth noting how all of this is organised. The platform isn't one big codebase — the whole project spans 31 separate repositories, with each service and each mini-app living on its own. That keeps them independent: every app has its own stack, its own releases, and can ship on its own schedule.

If I had to sum it up

  • Several services in different languages (Dart, Node, SvelteKit, Flutter) working as one product, on top of a dedicated ledger.
  • Real fintech discipline: one signed payment path, traceable end to end, with strict boundaries between services.
  • Built for the regulator: KYC tiers, a mandatory PIN plus biometrics, auto-lock, and personal data masked everywhere.
  • A mini-app platform that lets partners add features without ever touching the core.

A portfolio summary. The technical source of truth is projects/onewallet_base/docs/dev/modules/miniapps.md and docs/business/03-apps.md.