I'm really proud of this setup for the upcoming NEAR merch store. It's the culmination of a lot of work... inspired by
near.social and its decentralized frontends/modules.
It combines runtime module federation for both the UI and the API -- the "host" is just a lightweight rsbuild shell that reads a JSON config, and then hydrates the entire application from remote modules. This means I can swap out the entire backend or frontend just by updating a single line in config: the remote entry.
Modules are strongly-typed and can be deployed standalone as well, UI communicates with API over oRPC and API comes with OpenAPI spec automatically.
It's pretty wild, I get deja-vu all the time... "gateways", bos-workspace, near-bos-webcomponent... and now this! Micro-frontends & micro-services built with
@rspack_dev, oRPC (@unnoqcom),
@EffectTS_,
@ZephyrCloudIO, and
@tan_stack router.
It's not perfect, but it's working! The vision?
@NEARProtocol accounts that can dictate, secure, and orchestrate highly-configurable, interconnected applications... stick this host in a TEE with a codehash attestation (via something like
@out_layer) and I think you've got something pretty amazing, especially in this new world of AI generated applications. The more type-safe and scoped for the AI, the better!