Skip to content

lazycatlabs/auth_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

We stand with Palestine

Auth API

Auth API written in Rust 🦀 using Actix-Web framework

This is a simple API that allows you to create users and authenticate them using JWT tokens.

Installation ⚙️

  • Install Rust from here
  • Install Postgres via Docker
docker compose up -d
  • Install Diesel CLI from here
cargo install diesel_cli --no-default-features --features postgres
  • Run the migration
diesel migration run

Generate RSA Key

  • Generate RSA Key in here and select a key size to 4096 bits.
  • Then click Generate New Keys
  • Encode the PRIVATE KEY and PUBLIC KEY to base64
  • Copy the PRIVATE KEY and PUBLIC KEY to .env file as ACCESS_TOKEN_PRIVATE_KEY and ACCESS_TOKEN_PUBLIC_KEY

Run the project

  • Install cargo watch and run the project on your local machine
cargo install cargo-watch
cargo watch -q -c -w src/ -x run

For macOS users

If you face an error like this

note: ld: library 'pq' not found

you can fix it by running this command

brew link --force libpq
cargo clean
cargo build

API Collection 📚

Run in Postman

TODO 📝

  • Health Check
  • General Token
  • Auth Token
  • Register
  • Login
  • Login with Social (Google, Apple)
  • Profile
    • Get
    • Update
    • Delete
  • User session
  • Logout
  • Refresh token
  • Forgot password
  • Update password
  • Send Email via MailJet
  • Email verification
  • Create Tests
  • Create docker-compose to build the project
  • List of user with pagination

Buy me coffee if you love my works ☕️

buymeacoffe      ko-fi      paypal saweria



Releases

No releases published

Packages

No packages published

Languages