Architecture

How the loader, the client, addons and unbound.rip fit together.

Unbound runs in four layers inside the stock Discord app. GitHub Actions build it and unbound.rip serves it.

Overview of Unbound's architecture: the build pipeline, the four layers inside Discord on the phone, unbound.rip, and the developer tooling

Full Diagram

Every part of the loader, client and server, plus what happens at launch. Click either diagram to open it on Excalidraw, where you can zoom and pan.

Unbound's full architecture

Layers

LayerLives inWhat it does
AddonsUsers' devicesPlugins, themes, icon packs and fonts, built against @unbound-app/api. See Concepts.
Unbound clientpackages/clientFinds Discord's modules through Metro, patches them, and starts and stops addons. See Metro.
DiscordThe stock appIts module registry, React Native UI, Flux stores and native views. It stays unmodified on disk.
Native loaderpackages/loaderRuns Unbound's bundle before Discord's, updates it, guards against crashes, and backs the native bridge. See The Loader.

At Launch

  1. LoaderReads settings.json, scans addon folders, runs the signed bundle before Discord's
  2. ClientTraps Metro so every Discord module is searchable
  3. Built-insUnbound's own features start
  4. AddonsEach manager starts its addons
  5. DiscordRenders with every patch applied

If an addon crashes or freezes Discord, Unbound blames the addon whose code was running and disables it, so Discord keeps working.