Examples
zero ships complete, runnable apps in its examples/ directory on GitHub (pinned to the v0.5.0 release). They're the fastest way to see zero wired up for real. Copy one to use as your starting point.
Every example below is a self-contained app. Clone the repo and run any of them:
git clone https://github.com/im-ng/zero
cd zero/examples/<example-name>
zig build run # boots the demo (port varies per example)Reference apps
zero-basic
A full HTTP microservice that runs zero's main paths: REST handlers, Postgres/SQLite, Redis caching, GraphQL, structured logging, metrics, and health endpoints. It also ships a multi-stage Dockerfile.multi-stage and is the reference app for the Kubernetes) deployment guide.
cd zero/examples/zero-basic
zig build run
# or containerize it
podman build -f examples/zero-basic/Dockerfile.multi-stage -t zero-basic .zero-cli
A command-line app built on App.newCmd / app.runCmd. It has sub-commands, flag parsing via ctx.Param, and app.onStartup hooks. See CLI Apps) for the API.
cd zero/examples/zero-cli
zig build run -- helpzero-bench
The benchmark harness lives at src/bench/main.zig (built with zig build bench). It boots a real zero.App and drives it with a concurrency ramp to measure throughput, latency, and memory. Details and the regression gate are in Benchmark).
Relational & analytical data
| Example | Showcases | Docs |
|---|---|---|
zero-sqlite | SQLite handler | SQLite) |
zero-duckdb | DuckDB analytics | DuckDB) |
zero-nosql | NoSQL via Cassandra | Cassandra) |
zero-timeseries | Time Series via InfluxDB | InfluxDB) |
zero-search | Search via Solr | Solr) |
Caching, storage & files
| Example | Showcases | Docs |
|---|---|---|
zero-redis | Redis caching | Using Redis) |
zero-filestore | File Store (Local backend) | File Store) |
zero-s3 | File Store (S3 backend) | File Store) |
Messaging & pub/sub
| Example | Showcases | Docs |
|---|---|---|
zero-kafka-publisher | Kafka producer | Kafka Publisher) |
zero-kafka-subscriber | Kafka consumer | Kafka Subscriber) |
zero-mqtt-publisher | MQTT producer | MQ Publisher) |
zero-mqtt-subscriber | MQTT consumer | MQ Subscriber) |
zero-nats-publisher | NATS producer | NATS Publisher) |
zero-nats-subscriber | NATS consumer | NATS Subscriber) |
HTTP, APIs & services
| Example | Showcases | Docs |
|---|---|---|
zero-service-client | Outbound HTTP service-to-service calls | Http Services) |
zero-graphql | GraphQL-over-HTTP | GraphQL) |
zero-proto | Protobuf-over-HTTP | Protobuf) |
zero-autocrud | Auto CRUD resource handlers | Auto CRUD) |
zero-auth | Authentication (OAuth, API Key, Basic, RBAC) | Authentication) |
zero-websocket | Websockets | Websockets) |
zero-stream | WebSocket streaming / push updates to clients | Websockets) |
Scheduling, migrations & observability
| Example | Showcases | Docs |
|---|---|---|
zero-cronz | Scheduled tasks (cron) | Schedule Tasks) |
zero-migration | Manual migrations flow | Migrations) |
zero-otel | Experimental OpenTelemetry (traces + logs) | OpenTelemetry) |
UI
| Example | Showcases | Docs |
|---|---|---|
zero-todo-htmx | HTMX CRUD (uses automated migrations) | HTMX CRUD) |