all templates
API & Backend

Rust CRUD API — Actix · MongoDB

Actix-web 4 + MongoDB with JWT from cookie or Bearer, and structured logging.

An Actix-web 4 take on the Rust API: public and private endpoints, JWT parsed from either a cookie or an Authorization: Bearer header, bcrypt hashing, role grants via actix-web-grants, and log4rs structured logging. Includes a docker-compose for prod + dev app instances and MongoDB. Catalogued as-provided (the source ships without an app Dockerfile — bring your own) — see its README to build and run.

What's inside

  • Public + private REST endpoints
  • JWT from a cookie or a Bearer header
  • Role-based access via actix-web-grants
  • bcrypt password hashing
  • log4rs structured logging
  • docker-compose: prod + dev + MongoDB

Quickstart

$ curl -LO https://devai.io/downloads/rust-crud-actix-mongo-api.zip$ unzip rust-crud-actix-mongo-api.zip && cd rust-crud-actix-mongo-api$ cat README.md   # requirements + how to run

Browse the code

The full source, exactly as the zip ships it.

loading…
Download .zip
loading tree…

about this series

One of the devai.io advanced Rust boilerplates — the Actix-web flavor, with cookie/Bearer auth and logging, catalogued as-is.