Part I · Boundaries and vocabularyRepository atlas
Chapter 3source checked

Repository and dependency atlas

The monorepo is a product graph—five apps, shared contracts and runtime packages, protocol bridges, remote infrastructure, native modules, and release machinery.

What this chapter resolves
  • Map repository folders to runtime and distribution responsibilities.
  • Distinguish dependency edges from process and protocol boundaries.
  • Understand how the source inventory is reproduced from the pinned Git object.

The repository is large enough that folder-by-folder reading obscures the design. Treat it as a directed product graph: contracts define the language, runtime packages implement reusable algorithms, apps choose a process topology, and infrastructure/native/build layers complete delivery.

fa219001dPinned source commit
1,844Production/build source files
533,213Production/build source lines

These counts are not hand-maintained marketing numbers. source:check enumerates tracked files at the locked Git commit, applies versioned extension and test-path rules, and counts lines from Git objects. Assets and the .repos reference clones are excluded; generated protocol source remains part of the implementation surface.

The atlas

Major repository areas and what they build or own
AreaPrimary outputArchitectural role
apps/serverpublished t3 CLI/serverexecution authority, persistence, HTTP/WS, providers, workspace services
apps/webReact browser bundlelocal, hosted, and Electron-renderer product UI
apps/desktopElectron applicationbackend ownership, WSL/SSH, exposure, preview, native IPC, updater
apps/mobileExpo iOS/Android appsremote-native UI, durable outbox/share, native terminal/diff, notifications
apps/marketingAstro/Vercel static sitedownload and publication surface, separate from product web
packages/contractsEffect schemas/typescanonical product, RPC, auth, provider, usage, and relay vocabulary
packages/client-runtimenon-visual client libraryconnection, RPC, snapshot/cursor state, caches, capability logic
packages/effect-*protocol bridgestyped Codex app-server and ACP clients
packages/ssh / tailscalereachability librariesremote launch/forward and endpoint provisioning
infra/relayCloudflare Worker/control planeidentity, tunnel allocation, connection credentials, agent awareness
nativeRust/native artifactsGhostty VT and resource monitoring
scripts / packaging / .githubartifacts and releasesversioning, signing, installers, CI, stores, AUR, hosted aliases

Dependency is not the same as deployment

Figure 3.1 · Typed product graphsolid: package/build · dotted: separately deployed control plane
T3 Code monorepo build dependency graphDiagram loading

Zoom with the controls, +/, or Ctrl/ + trackpad scroll. Enable Pan to drag, use two-finger scrolling, or use the arrow keys. 0 fits the diagram; Esc leaves Pan or expanded view.

T3 Code monorepo build dependency graph
Text equivalent

Contracts feed the server, shared client runtime, web, desktop, and mobile by package dependency. The client runtime feeds web and mobile. Web has a build-order and copy edge into the server distribution and also becomes the Electron renderer and hosted app. The server and web are packaged into local CLI and desktop shapes. Relay infrastructure is separately deployed and connected by a control-plane relationship, not a package dependency.

Figure 3.1. This deliberately heterogeneous map distinguishes shared-package imports and build/copy edges from the relay's separately deployed control-plane relationship. The npm server package copies the already-built web output as static assets.

The arrow from web to server is a build edge: apps/server copies apps/web/dist into its published client directory. At runtime, a browser still communicates with the server over authenticated HTTP/WebSocket boundaries. Likewise, Electron imports shared code and bundles a server, but its renderer remains isolated behind preload IPC.

Interactive flow

Follow one contract into a shipped surface

Move through the build graph; notice where shared code stops and a process boundary begins.

1 / 5

Step 1 of 5: Define

packages/contractsDurable stateDefine

Contracts establish the canonical language

Effect schemas describe domain commands, RPC methods, provider runtime events, authentication, capabilities, and query shapes before any product chooses a renderer or process topology.

  1. 1. Define · Contracts establish the canonical language (Durable state)

    Effect schemas describe domain commands, RPC methods, provider runtime events, authentication, capabilities, and query shapes before any product chooses a renderer or process topology.

    packages/contracts/package.json:1–34
  2. 2. Reuse · Client runtime implements non-visual behavior (Client state)

    Connection supervision, RPC sessions, caches, snapshot reconciliation, sequence cursors, and capability logic are shared without importing a browser or native UI.

    packages/client-runtime/package.json:1–172
  3. 3. Render · The web application binds behavior to React (Client state)

    Runtime selection composes local, hosted, and desktop-renderer contexts around the same route tree; this is still build-time reuse, not server co-location.

    apps/web/src/main.tsx:21–59
  4. 4. Package · The server distribution copies a completed web build (Transport boundary)

    The npm package depends on the web build and copies static output into its client directory so one CLI can serve both API and assets.

    apps/server/scripts/cli.ts:143–176
  5. 5. Execute · Runtime communication crosses HTTP and WebSocket boundaries (Runtime work)

    Once launched, the browser is a client and the environment server is the trusted executor. A dependency edge has become a protocol and authority boundary.

    docs/internals/overview.md:5–28apps/server/src/server.ts:123–472
T3
Source-locked editionRead against fa219001d · 23 Aug 2026
Book search

Find a concept, module, or source path

Type two or more characters.