A Go-based backend service for OTP-based authentication and user management using Fiber, Postgres, and Redis. Built with Hexagonal Architecture for maintainability and testability.
- OTP-based login/registration with JWT tokens.
- Rate limiting (3 OTP requests per phone number in 10 minutes).
- User management (get user by ID, list users with pagination and search).
- Postgres for user storage, Redis for OTPs and rate limiting.
- Swagger API documentation at
/api/v1/swagger. - Dockerized with automated migrations.
- Unit and integration tests.
- Go 1.24+
- Docker and Docker Compose
swagCLI (go install github.com/swaggo/swag/cmd/swag@latest)migrateCLI (go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/migrate@latest)
- Clone the repository:
git clone https://github.com/mehrbod2002/otp-service-go cd otp-service