Zig Systems Framework
View as MarkdownNeutron for Zig is a composable systems library and application framework. Lower layers can be built without the layers above them. The full SDK includes a Nucleus client over the PostgreSQL wire protocol.
Layers
| Source directory | Role |
|---|---|
| src/layer0/ | Binary codecs, HTTP parser, pgwire, WebSocket framing |
| src/layer1/ | TCP, connection pooling, timers |
| src/layer2/ | HTTP server, database client, SSE, static files, WebSockets |
| src/layer3/ | App/router, middleware, errors, auth, cache, OpenAPI, lifecycle |
| src/nucleus/ | Feature detection, transactions, retry, and data-model modules |
Wire codecs are allocation-free. Higher-level components, including the full database client, use an allocator. Embedded-target suitability depends on the selected layers and target validation.
Build
The repository pins Zig 0.15.2. From zig/:
zig build test
zig build -Dlayer2=false -Dlayer3=false
The second command selects the lower layers. Check build.zig for the full flag set and build.zig.zon for the toolchain requirement.
See the quickstart, layer guide, and Nucleus client guide for more detail. The source layout above is the current layout; older examples using wire/, hal/, protocol/, or app/ directory names refer to an earlier design.