all templates
Blog Engines

Blog Engine — Zig · MongoDB

Zig meets MongoDB through libmongoc — the systems-programming take on documents.

The Zig implementation on MongoDB, wrapping the battle-tested MongoDB C driver via @cImport — a realistic pattern for using mature C libraries from Zig today. Same API contract, argon2 local auth, self-contained JWTs, and the standard provider-swap examples.

What's inside

  • Full CRUD + publish flow for markdown posts
  • Local auth: users collection, argon2, HS256 JWT
  • Drop-in Clerk & Auth0 JWT verifier examples
  • libmongoc via @cImport — real C interop, documented
  • Indexes ensured on startup
  • compose stack — MongoDB state in ./data, healthchecked

Quickstart

$ git clone https://github.com/devai-io/devai_boilerplates.git$ cd devai_boilerplates/blog-zig-mongo$ docker compose up --build   # API on http://localhost:8080

Browse the code

The full source, exactly as it ships in the repo.

loading…
Download .zip
loading tree…

about this series

Part of the devai.io blog engine series: one contract, eight backends — compare languages on identical ground.