all templates
Blog Engines

Blog Engine — Zig · Postgres

The blog engine in Zig — std.http, pg.zig, and a hand-rolled HS256.

The most bare-metal member of the series: Zig's std.http.Server, pg.zig for Postgres, argon2 from std.crypto.pwhash, and a small self-contained HS256 JWT implementation — no framework anywhere. The same eight endpoints as every sibling, in a codebase you can read top to bottom in one sitting.

What's inside

  • Full CRUD + publish flow for markdown posts
  • Local auth: users table, argon2, hand-rolled HS256 JWT
  • Drop-in Clerk & Auth0 JWT verifier examples
  • pg.zig — direct Postgres, no ORM
  • schema.sql applied on startup
  • docker-compose with healthchecked Postgres

Quickstart

$ curl -LO https://devai.io/downloads/blog-zig-postgres.zip$ unzip blog-zig-postgres.zip && cd blog-zig-postgres$ cp .env.example .env$ docker compose up --build

Browse the code

The full source, exactly as the zip ships it.

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.