all templates
Blog Engines

Blog Engine — Go · Postgres

A refined, minimalist blog API in Go on Postgres — auth to publishing in a dozen files.

One schema, one API contract, eight implementations. This is the Go + Postgres take: stdlib net/http with the 1.22 mux, pgx for storage, bcrypt-hashed local accounts issuing JWTs — plus drop-in Clerk and Auth0 verifier examples for when you'd rather not own passwords. Markdown posts, slugs, a publish flow, and nothing else.

What's inside

  • Full CRUD + publish flow for markdown posts
  • Local auth: users table, bcrypt, HS256 JWT
  • Drop-in Clerk & Auth0 JWT verifier examples
  • Raw SQL via pgx — no ORM
  • schema.sql applied on startup
  • docker-compose with healthchecked Postgres

Quickstart

$ curl -LO https://devai.io/downloads/blog-go-postgres.zip$ unzip blog-go-postgres.zip && cd blog-go-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.