Mobile Mini Apps
Architectural design docs for the Based Mini-Apps platform — a sandboxed, JS-runtime-based mini-app system embedded in the Based Super App, modeled loosely on WeChat Mini-Programs.
Status: Design phase. Nothing in this directory is implemented yet. These documents define the target architecture; they will be revised as we prototype.
Why this exists
The Based app is a multi-tenant crypto super-app (trading, prediction markets, credit cards, e-commerce). To scale beyond first-party features without inflating the binary, slowing review cycles, or coupling partner code to our internals, we need a way for third-party developers and internal feature teams to ship sandboxed UI experiences that run inside the host app.
We chose Option C — Embedded JS Runtime (over server-driven UI and compile-time modules) because the long-term north star is a WeChat-style ecosystem: dozens of independent mini-apps, partner-built, hot-updatable, sandboxed, against a stable API surface that we control.
Reading order
If you're new to this project, read in this order. Earlier docs are prerequisites for later ones.
Glossary
Host app — the Based super-app binary (
flutter/based_app/). Owns auth, signing, networking, native APIs.Mini-app — a third-party or first-party UI experience packaged as a JS bundle + manifest, executed inside the host. Sandboxed.
Host contract (
BasedMiniAppHost) — the Dart interface that defines every native capability a mini-app can request. Equivalent of WeChat'swx.*.Bridge — the Dart↔JS message channel that exposes
BasedMiniAppHostto mini-app code as abased.*global.Manifest (
based.json) — declarative metadata for a mini-app: id, version, permissions, entry point, theme overrides.UiNode — the renderable tree shape produced by mini-app code. Rendered natively by host using
based_uiwidgets.Bundle — the deployable artifact:
main.js+based.json+ assets, signed and distributed via CDN.based_ui— the host's shared widget library (extracted fromflutter/based_app/lib/presentation/widgets/common/). Mini-apps render against this viaUiNode.based_mini_app_sdk— the Dart package that defines the host contract, manifest parser, and permission enforcer.based_js_runtime— the Dart package that wraps the JS engine and runs mini-app bundles.
Out of scope (for the design phase)
These are deliberately deferred until after the first runnable prototype:
Mini-app marketplace / discovery UX
Revenue share / billing
Partner onboarding and review workflows
Localization tooling for partner mini-apps
Native module extension API (mini-apps calling custom platform code)
How to contribute to these docs
Each doc owns a Status banner at the top:
Draft,Reviewed,Approved.Substantive changes to an
Approveddoc require a PR with at least one reviewer from the platform team.Cross-cutting decisions go in
12-open-questions.mdas a numbered entry; resolved entries are moved to the relevant doc and crossed out in the decision log.
Last updated