Zero boilerplate
Databases, queues, auth and observability plug in with no glue code. Everything is wired through .env.
Zero is a batteries-included web framework for Zig. Wire REST, SQL, NoSQL, cache, pub/sub, auth, GraphQL and observability into a single static binary, configured almost entirely through .env.
zig fetch --save https://github.com/im-ng/zero/archive/refs/heads/main.zipDatabases, queues, auth and observability plug in with no glue code. Everything is wired through .env.
Compile to one dependency-free binary. Tiny RSS (~16–65 MiB), no managed runtime, ships anywhere, including Kubernetes.
ships anywhere ↘Structured JSON logs, Prometheus metrics, distributed tracing and health endpoints are wired in from the first request.
from req #1Tens of thousands of requests/sec at ~50 MiB RSS. No GC pauses, no JIT warm-up, explicit memory control.
no GC pauses! Everything on the right is driven by the config on the left — the same .env that drives a real zero app. Handlers come from your code; config decides which backends they can reach.
registered in code — config connects their backends
src/main.zigconfigs/.envzig build run gives you a JSON API with structured logs/metrics already live.Everything else (Postgres, Redis, Kafka, auth, GraphQL and metrics) is opt-in through configuration. Nothing to wire by hand.
Full walkthroughconst std = @import("std");
const zero = @import("zero");
const App = zero.App;
pub const std_options: std.Options = .{ .logFn = zero.logger.custom };
pub fn main(init: std.process.Init) !void {
var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator);
defer arena.deinit();
const app = try App.new(arena.allocator(), init.io, init.environ_map);
try app.get("/json", jsonResponse);
try app.run();
}
fn jsonResponse(ctx: *zero.Context) !void {
try ctx.json(.{ .msg = "hello zero!" });
}Zero keeps the surface small. Write the endpoint as a handler, boot it with a few lines of config, and call it with a single curl — no framework magic in between.
Zero's limiter is a fixed window, on by default — no handler code. This mirrors it: hit RATE_LIMIT_MAX and every extra request gets 429 until the window resets.
# on by default — no handler code to enable
RATE_LIMIT_ENABLE=true
RATE_LIMIT_MAX=5 # requests per window (default 100)
RATE_LIMIT_WINDOW=10 # window, seconds (default 60)
RATE_LIMIT_KEY=ip # or header:X-Forwarded-For
# over max? -> 429 Too Many Requests + Retry-Afterfixed window — resets every 10s, and Retry-After counts down with it
App.new.Every piece is opt-in through configuration. Hover or focus a node to see what it does.
Hover or focus any node in the map to reveal what Zero wires in for you.
Drag the divider to compare a Zero service with a typical Go / Node setup.
← drag →
The bundled benchmark harness drives a concurrency ramp and reports throughput, latency percentiles and per-level RSS. CI runs it for regression.
One dependency-free binary. No GC. Everything else is configuration.
zig fetch --save https://github.com/im-ng/zero/archive/refs/heads/main.zip