这是indexloc提供的服务,不要输入任何密码
Skip to content

Mehrbod2002/otp-service-go

Repository files navigation

OTP Service

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.

Features

  • 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.

Prerequisites

  • Go 1.24+
  • Docker and Docker Compose
  • swag CLI (go install github.com/swaggo/swag/cmd/swag@latest)
  • migrate CLI (go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/migrate@latest)

Setup

  1. Clone the repository:
    git clone https://github.com/mehrbod2002/otp-service-go
    cd otp-service

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published