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.
- 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 in here and select a key size to 4096 bits.
- Then click
Generate New Keys
- Encode the
PRIVATE KEY
andPUBLIC KEY
to base64 - Copy the
PRIVATE KEY
andPUBLIC KEY
to.env
file asACCESS_TOKEN_PRIVATE_KEY
andACCESS_TOKEN_PUBLIC_KEY
- Install cargo watch and run the project on your local machine
cargo install cargo-watch
cargo watch -q -c -w src/ -x run
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
- 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