# Zever > Zever is a schema-driven scaffolding compiler for Go. Describe services in a .zen schema and it compiles database access, caching, queues, routing and other backend plumbing, never your business logic. Key facts: - Language and version: Go 1.27+. License: Apache-2.0. Repository: https://github.com/zenta-dev/zever - Install: `curl -fsSL https://raw.githubusercontent.com/zenta-dev/zever/main/install.sh | sh` (Linux, macOS); Windows PowerShell: `irm https://raw.githubusercontent.com/zenta-dev/zever/main/install.ps1 | iex` - Input: `.zen` schema files. Output: typed ORM, OpenAPI, migration DDL, routing glue. Business logic is never generated. - Every backend (db, cache, queue, auth, storage, mail, search and more) is a small interface with swappable adapters, resolved lazily through one container. Switching adapters is a config change. - Zero-infrastructure defaults (sqlite, memory, local, log) so a clean machine builds and tests with no external services. - Each page below is also available as raw Markdown (append `.md`); `llms-full.txt` contains every page in one file. ## Start - [Introduction](https://zenta-dev.github.io/zever/start/introduction.md): What Zever is, how the compiler and container fit together, and where to go next. - [Quickstart](https://zenta-dev.github.io/zever/start/quickstart.md): Install, scaffold a project, and serve a working endpoint in three commands. - [Installation](https://zenta-dev.github.io/zever/start/installation.md): Install Go 1.27, the Zever CLI, and the modules you need, then verify with a smoke test. - [Project layout](https://zenta-dev.github.io/zever/start/project-layout.md): Find any Zever package fast: core interfaces, adapter modules, shared helpers, container, ORM, compiler, and CLI. - [Versioning](https://zenta-dev.github.io/zever/start/versioning.md): One lockstep version across every Zever module, per-module tags, and replace-less consumption. ## Tutorials - [Tutorials overview](https://zenta-dev.github.io/zever/tutorials/overview.md): Map of the runnable example apps under examples/, from focused ORM ports to full showcase apps. - [Build a booking API](https://zenta-dev.github.io/zever/tutorials/build-a-booking-api.md): Run the examples/bookings app end to end: migrate, seed, serve, start the worker, and book a space over HTTP. - [Explore the showcase app](https://zenta-dev.github.io/zever/tutorials/explore-the-showcase-app.md): Tour examples/showcase, one schema using every DSL feature, served over HTTP and gRPC from one implementation. - [Build an agent app](https://zenta-dev.github.io/zever/tutorials/build-an-agent-app.md): Wire an agent loop, RAG grounding, and an MCP server into a working support assistant. ## Contribute - [Contribute](https://zenta-dev.github.io/zever/contribute.md): How to contribute to Zever and preview this documentation site. - [Writing docs](https://zenta-dev.github.io/zever/contribute/writing-docs.md): The style guide, page types, and templates for Zever documentation. ## HTTP APIs - [Routing](https://zenta-dev.github.io/zever/guides/http/routing.md): Register HTTP routes on the fiber or stdhttp driver with path params, groups, and method checks. - [Middleware](https://zenta-dev.github.io/zever/guides/http/middleware.md): Compose logging, recovery, rate limiting, tracing, and timeouts over HTTP and gRPC. - [CORS](https://zenta-dev.github.io/zever/guides/http/cors.md): Allow browser calls from other origins with strict, fail-closed cross-origin headers. - [Requests and responses](https://zenta-dev.github.io/zever/guides/http/requests-responses.md): Decode JSON bodies, read params and headers, paginate lists, and write consistent JSON responses. - [Validation](https://zenta-dev.github.io/zever/guides/http/validation.md): Validate input with .zen rules and handler checks, and fail with precise, field-named errors. - [Errors](https://zenta-dev.github.io/zever/guides/http/errors.md): Match typed errors, map them to stable HTTP statuses, and keep secrets out of error text. - [Codec](https://zenta-dev.github.io/zever/guides/http/codec.md): Serialize typed values to bytes with composable Encoder and Decoder pairs, JSON by default. - [Sessions](https://zenta-dev.github.io/zever/guides/http/sessions.md): Keep server-side sessions in memory, Redis, or a database, and send an opaque secure cookie to the browser. - [Internationalization](https://zenta-dev.github.io/zever/guides/http/i18n.md): Translate user-facing strings with an embedded catalog locally and a remote catalog in production. ## Data and storage - [Query builder](https://zenta-dev.github.io/zever/guides/data/query-builder.md): Query sqlite and postgres with the typed ORM, including joins, transactions, pagination, and dialect checks. - [Migrations and seeding](https://zenta-dev.github.io/zever/guides/data/migrations-seeding.md): Plan and apply schema migrations from .zen files, roll them back, and seed data deterministically. - [Redis](https://zenta-dev.github.io/zever/guides/data/redis.md): Switch cache, queue, session, lock, and rate limit services from memory to Redis, with no code changes. - [Cache](https://zenta-dev.github.io/zever/guides/data/cache.md): Cache values with a TTL, in memory or in Redis, with typed helpers and compare-and-swap. - [CDN](https://zenta-dev.github.io/zever/guides/data/cdn.md): Purge cached content at the edge with the noop or Cloudflare adapter. - [Search](https://zenta-dev.github.io/zever/guides/data/search.md): Index documents and run ranked full-text queries on sqlite, postgres, or Meilisearch. - [Vector store](https://zenta-dev.github.io/zever/guides/data/vectorstore.md): Store embeddings and query closest matches by cosine similarity on sqlite, pgvector, or Qdrant. - [Storage and media](https://zenta-dev.github.io/zever/guides/data/storage-media.md): Store files behind policy-gated presigned URLs, locally or on S3 and R2, with a media pipeline on top. - [Media processing](https://zenta-dev.github.io/zever/guides/data/media.md): Upload, probe, transform, and serve images and video with bounded size, pixel, and URL limits. - [Documents](https://zenta-dev.github.io/zever/guides/data/document.md): Render document sources to PDF, PNG, or JPG with a local, LaTeX, or remote renderer. ## Background work - [Background jobs overview](https://zenta-dev.github.io/zever/guides/background/overview.md): How jobs, the queue, workers, the scheduler, the outbox, the event bus, workflows, and sagas fit together, and which one to reach for. - [Queue](https://zenta-dev.github.io/zever/guides/background/queue.md): Push, pop, ack, and nack durable jobs on memory, Redis, or a database table. - [Scheduler and jobs](https://zenta-dev.github.io/zever/guides/background/scheduler-jobs.md): Dispatch background jobs onto the shared queue and fire them on cron schedules. - [Events and event bus](https://zenta-dev.github.io/zever/guides/background/events.md): Publish and subscribe to in-process events, and fan out across instances with Redis. - [Outbox](https://zenta-dev.github.io/zever/guides/background/outbox.md): Record events in the same transaction as your data and deliver them at-least-once, with an inbox for idempotent consumers. - [Outbox Ops](https://zenta-dev.github.io/zever/guides/background/outbox-ops.md): Relay metrics, Prometheus alert rules, the DLQ runbook, and stalled-relay readiness. - [Workflows](https://zenta-dev.github.io/zever/guides/background/workflows.md): Run durable multi-step workflows that survive restarts, with start, signal, query, and cancel. - [Saga](https://zenta-dev.github.io/zever/guides/background/saga.md): Run multi-step operations with pivot roll-forward and reverse compensation. - [Webhooks](https://zenta-dev.github.io/zever/guides/background/webhooks.md): Deliver signed outbound webhooks with per-target secrets over HTTP or the retrying queue. - [Mailer](https://zenta-dev.github.io/zever/guides/background/mailer.md): Send transactional email through a log-by-default mailer, and switch to SMTP for production. - [Notifications](https://zenta-dev.github.io/zever/guides/background/notifications.md): Send push and SMS through one Notifier interface, with a safe log default and FCM or Twilio. - [gRPC client](https://zenta-dev.github.io/zever/guides/background/grpc-client.md): Dial gRPC services with round-robin balancing, retry, tracing, timeouts, and a resilience guard. ## Security - [Authentication](https://zenta-dev.github.io/zever/guides/security/auth.md): Issue and verify caller identity with JWT, session, or OIDC behind one interface. - [Authorization](https://zenta-dev.github.io/zever/guides/security/authz-permissions.md): Guard routes and RPCs with allow or deny checks using noop, RBAC, or Casbin. - [Password hashing](https://zenta-dev.github.io/zever/guides/security/password-hashing.md): Hash and verify passwords with Argon2id and rehash when parameters change. - [Crypto and secrets](https://zenta-dev.github.io/zever/guides/security/crypto-secrets.md): Encrypt and sign data with one key service, and read named credentials from env or Vault. - [Secrets](https://zenta-dev.github.io/zever/guides/security/secrets.md): Read named credentials from the environment or Vault, separate from layered config. - [Rate limiting](https://zenta-dev.github.io/zever/guides/security/ratelimit.md): Bound request rates per key with token buckets in memory or shared over Redis. - [Locks and idempotency](https://zenta-dev.github.io/zever/guides/security/lock-idempotency.md): Guard critical sections with distributed locks and make retried jobs and webhooks take effect once. ## Operate - [Configuration](https://zenta-dev.github.io/zever/guides/operate/configuration.md): Service configuration via environment variables (no config files) - [Logging](https://zenta-dev.github.io/zever/guides/operate/logging.md): Log structured events through one interface and swap slog, zerolog, pretty, or noop by config. - [Observability](https://zenta-dev.github.io/zever/guides/operate/observability.md): Emit traces and metrics from noop to stdout to an OTLP collector with one provider. - [Cross-Service Tracing](https://zenta-dev.github.io/zever/guides/operate/cross-service-tracing.md): W3C trace propagation, baggage keys, span kinds, and the OTel semconv attribute migration. - [Resilience](https://zenta-dev.github.io/zever/guides/operate/resilience.md): Protect your process from failing dependencies with timeout, retry, circuit breaker, and bulkhead guards. - [Feature flags](https://zenta-dev.github.io/zever/guides/operate/flags.md): Gate code paths with typed flags from a static file or Firebase Remote Config. - [Tenants](https://zenta-dev.github.io/zever/guides/operate/tenants.md): Resolve which tenant owns a request, from single-tenant to header-based SaaS. - [Deployment](https://zenta-dev.github.io/zever/guides/operate/deployment.md): Ship Zever to production with one checklist for build, config, secrets, shutdown, health, scaling, and hardening. - [Deploy to Kubernetes](https://zenta-dev.github.io/zever/guides/operate/kubernetes.md): Run the generated server and worker on Kubernetes with probes, graceful shutdown, config and secrets, a PodDisruptionBudget, and an HorizontalPodAutoscaler. - [Upgrade](https://zenta-dev.github.io/zever/guides/operate/upgrade.md): Bump a pre-1.0 Zever version safely, read breaking changes, and fix the common breaks. - [Migrate from v0.7 to v0.8](https://zenta-dev.github.io/zever/guides/operate/migration.md): Move service config to environment variables, wire adapters with Provide, and run generated servers through serve.Main. - [Test your app](https://zenta-dev.github.io/zever/guides/operate/testing-your-app.md): Test a Zever app with in-memory adapters, httptest routes, per-test sqlite files, conformance kits, and leak checks. - [FAQ and troubleshooting](https://zenta-dev.github.io/zever/guides/operate/faq-troubleshooting.md): Quick answers to the questions that come up most, and a symptom-to-fix list for configuration, adapters, jobs, and the CLI. ## Integrations - [AI](https://zenta-dev.github.io/zever/guides/integrations/ai.md): Generate text, stream tokens, and create embeddings with Anthropic, OpenAI, Gemini, or Ollama behind one interface. - [Analytics](https://zenta-dev.github.io/zever/guides/integrations/analytics.md): Track events, identify users, and group them with a log adapter in dev and PostHog in production. - [Billing](https://zenta-dev.github.io/zever/guides/integrations/billing.md): Manage customers, subscriptions, and invoices with a stub, Stripe, or Paddle adapter. - [Payments](https://zenta-dev.github.io/zever/guides/integrations/payment.md): Create, refund, and fetch payments and verify provider webhooks with a stub, Stripe, or Paddle adapter. - [Geo](https://zenta-dev.github.io/zever/guides/integrations/geo.md): Geocode addresses, reverse geocode coordinates, and compute distances with static, OSM, or Google backends. ## Extend - [Choosing batteries and adapters](https://zenta-dev.github.io/zever/guides/extend/choosing-batteries.md): A decision guide for picking the adapter behind each battery, from zero-infrastructure defaults to production backends. - [Write a plugin](https://zenta-dev.github.io/zever/guides/extend/write-a-plugin.md): Add a new adapter to an existing battery or ship an entirely new battery as a standalone Go module. - [Customizing and leaving zever](https://zenta-dev.github.io/zever/guides/extend/customizing-and-leaving.md): Use orm and core batteries standalone, write a custom codegen backend, tell generated code from owned code, and leave the framework without rewriting your app. - [Editor setup](https://zenta-dev.github.io/zever/guides/extend/editor-setup.md): Set up the zever-lsp language server, Neovim, and VS Code for .zen files, plus the CLI inspection loop. - [Agent skill](https://zenta-dev.github.io/zever/guides/extend/agent-skill.md): Install and use the Zever Claude Code skill. ## Concepts - [How Zever works](https://zenta-dev.github.io/zever/concepts/how-zever-works.md): One-page overview of the path from a .zen schema through the compiler and container to swappable adapters. - [Lifecycle](https://zenta-dev.github.io/zever/concepts/lifecycle.md): Follow one Zever process from config load to container close, and which failures belong to which phase. - [Container](https://zenta-dev.github.io/zever/concepts/container.md): How the container resolves services lazily, retries on error, shares Job and Scheduler queues, and closes in order. - [Providers and adapters](https://zenta-dev.github.io/zever/concepts/providers-adapters.md): How small interfaces, self-registering adapters, and the container make backend swaps a config change. - [Compiler boundary](https://zenta-dev.github.io/zever/concepts/compiler-boundary.md): Why runtime packages never import the DSL compiler, how module layering enforces it, and the separate schema-module rule. - [Resolver and IR](https://zenta-dev.github.io/zever/concepts/resolver-ir.md): How the compiler frontend resolves .zen schemas into an IR and reports every diagnostic in one run. - [Backends](https://zenta-dev.github.io/zever/concepts/backends.md): How pluggable codegen backends turn a resolved schema into ORM bindings, protobuf, OpenAPI, and migrations. ## Reference - [Reference](https://zenta-dev.github.io/zever/reference.md): Lookup pages for the Zever CLI, configuration keys, adapters, package entry points, errors, and benchmarks. - [CLI Reference](https://zenta-dev.github.io/zever/reference/cli.md): Flags-only toolkit shell with exact CLI invocations for every command. - [Config reference](https://zenta-dev.github.io/zever/reference/config.md): Every Zever config service, adapter, option key, default, and environment variable, plus the layering and strictness rules. - [Flag reference](https://zenta-dev.github.io/zever/reference/flag.md): Feature-flag adapters, config keys, options, defaults, and error index for the flag battery. - [Ratelimit reference](https://zenta-dev.github.io/zever/reference/ratelimit.md): Rate-limiter adapters, config keys, options, defaults, and error index for the ratelimit battery. - [Session reference](https://zenta-dev.github.io/zever/reference/session.md): Session-store adapters, config keys, options, defaults, and error index for the session battery. - [.zen syntax](https://zenta-dev.github.io/zever/reference/zen-syntax.md): Reference for the Zever schema language: entities, relations, services, RPCs, jobs, schedules, sagas, types, and attributes. - [Adapters matrix](https://zenta-dev.github.io/zever/reference/adapters-matrix.md): Every service, adapter, package, and container accessor in one table. - [API index](https://zenta-dev.github.io/zever/reference/api-index.md): Package entry points with container accessors for every service. - [Errors](https://zenta-dev.github.io/zever/reference/errors.md): The repo error conventions for messages, sentinels, wrapping, and branching. - [Benchmarks](https://zenta-dev.github.io/zever/reference/benchmarks.md): Point-in-time micro-benchmarks for router, ORM, queue, and other hot paths, plus how to reproduce them. - [Minimal runtime profile](https://zenta-dev.github.io/zever/reference/minimal-profile.md): What the db/orm/router/config/log floor costs versus the full CLI, and how to reproduce the numbers. - [Compatibility matrix](https://zenta-dev.github.io/zever/reference/compatibility-matrix.md): Which modules the API gates protect, and what may break per release type. ## More - [Guides](https://zenta-dev.github.io/zever/guides.md): Task-focused how-tos for HTTP, data, background work, security, operations, integrations, and extending Zever. ## Optional - [Full documentation in one file](https://zenta-dev.github.io/zever/llms-full.txt): every page concatenated - [Source code](https://github.com/zenta-dev/zever): Go module, examples and changelog - [Changelog](https://github.com/zenta-dev/zever/blob/main/CHANGELOG.md): release notes