Under the hood
This bucket is for plugin authors, adapter writers, and contributors. If you only want to build a backend on top of Nwire, the build path is what you want — this one assumes you're reaching for the framework's machinery.
Where to start
- Architecture sketch — the engineering reasoning behind every primitive. Read this first.
- Hook contract matrix — the §07 table from the sketch, expanded with examples.
- Framework events + tense-based dispatch —
AppRegistering/AppBooting/AppBooted/AppReady/AppShuttingDown/AppShutdownand how tense maps to dispatch mode.
Authoring
- Plugin authoring (definePlugin closure form) —
provide/on/before/after/middleware/boot/shutdowninside one closure. - Writing an adapter — the contract pattern for storage / mail / queue / bus. Ship a contract package; ship N adapter packages opt-in.
Runtime topics
- Cross-service bus + integration events —
module.needs.externalEvents+@nwire/bus+@nwire/bus-nats. Topology stays flexible: same modules run monolith or split. - Telemetry pipeline (OTel bridge) —
runtime.onTelemetrytagged-union stream; how@nwire/telemetry-otelmaps 22 kinds to OTLP spans + events. - Studio internals — what
.nwire/*.jsonlooks like, how the scanner produces it, how/__nwire/*middleware serves it, how Studio's runner supervisor works.
Repo invariants
- Domain code never imports from wires. Modules don't own routes; transports live at the app layer.
- Contract packages ship in-memory defaults. Persistent adapters are separate packages a consumer adds explicitly.
- One author, one voice. Every file should look like the same engineer wrote it; drift is the enemy.
See AGENTS.md for the full repo conventions.