Skip to content

robby1012/rby-rocket-api

Repository files navigation

Rocket + Mongo + JWT Boilerplate

A minimal Rust Rocket API with MongoDB, registration/login, Argon2 password hashing, and JWT auth.

Quick start

  1. Create .env (see .env.example).
  2. Run the server.

Env

  • MONGO_URI e.g. mongodb://localhost:27017
  • MONGO_DB default myapp
  • JWT_SECRET any random string
  • JWT_ISSUER default myapp

Endpoints

  • GET /health health check
  • POST /api/auth/register { email, password }
  • POST /api/auth/login { email, password } -> { token }
  • GET /api/auth/me with Authorization: Bearer <token>

Run

  • Debug: cargo run

Notes

  • Uses Argon2 for password hashing.
  • Issues? Check Rocket and Mongo versions.

About

My first Rust Rocket application

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published