A modern and lightweight user authentication API built with Bun, Hono, TypeScript, and Supabase.
This project provides a full auth flow with clean and reusable controllers for sign-up, login, logout, email change, OTP verification, and session management.
- Bun — super-fast JS runtime
- Hono — ultra-light, TypeScript-first web framework
- TypeScript
- Supabase — powerful BaaS for auth and database
git clone https://github.com/hakisolos/user-auth-system.git
cd user-auth-systembun installCreate a .env file at the root and add your Supabase keys:
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_ANON_KEY=your-anon-keyYou can find these in your Supabase project → Settings → API.
bun index.tsServer will be running on http://localhost:3000
| Route | Method | Description |
|---|---|---|
/signup |
POST | Register a new user |
/login |
POST | Log in an existing user |
/logout |
POST | Log out the current session |
/change-email |
POST | Change user’s email |
/get-user |
GET | Get current logged-in user |
/verify-otp |
POST | Verify OTP or magic link |
{
"email": "example@mail.com",
"password": "password123"
}{
"newEmail": "new@mail.com"
}{
"email": "example@mail.com",
"options": {
"emailRedirectTo": "https://yourdomain.com/welcome"
}
}Found a bug or need help? Feel free to open an issue and wifey will be right there to fix it 💖
Wanna add some love to the codebase? Fork it, push your changes, and open a pull request! PRs are warmly welcomed 💕
shell haki about a
MIT © Shell haki