all templates
API & Backend

Rust CRUD API — Warp · Postgres

A JWT-secured REST API in Rust: Warp handlers, sqlx, Postgres, role-based routes.

A production-shaped Rust boilerplate. Warp 0.4 handlers over sqlx 0.9 and Postgres 18, argon2id password hashing, JWT auth with User / Admin role checks, and a full users / articles / comments CRUD surface — laid out as routes → handlers → service per module. The schema is applied on startup, and one `docker compose up --build` runs the API with its database.

What's inside

  • Full users + articles CRUD, with comments
  • JWT auth with role-based route guards
  • sqlx over Postgres — typed row mapping, no ORM
  • argon2id password hashing
  • compose: API + Postgres 18, schema applied on startup
  • Multi-stage Dockerfile → distroless, non-root

Quickstart

$ git clone https://github.com/devai-io/devai_boilerplates.git$ cd devai_boilerplates/rust-crud-sql-api$ 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

One of the devai.io advanced Rust boilerplates — a real, batteries-included starting point for a Rust web API, brought up to date.