A Go service for user authentication and profile management. It provides OTP-based sign-up and login, JWT-protected profile endpoints, database migrations, Traefik routing, and Swagger API documentation.
- OTP-based sign-up, login, and verification
- JWT-protected profile operations
- Database migration command
- Docker-based development workflow
- Traefik reverse-proxy integration
- Interactive Swagger documentation
Start the service in development mode:
make start-user-app-devApply database migrations inside the running container:
docker exec -it beehive-user-service-1 sh -c "go run cmd/user/main.go migrate --up"Swagger UI is available at:
http://beehive.local/users/v1/swagger/index.html
curl --location 'http://beehive.local/users/v1/users/signup' \
--header 'Content-Type: application/json' \
--data '{
"name": "example-user",
"phone_number": "09120000000"
}'If the user already exists, an OTP code is sent to the supplied number.
curl --location 'http://beehive.local/users/v1/users/login' \
--header 'Content-Type: application/json' \
--data '{
"phone_number": "09120000000"
}'curl --location 'http://beehive.local/users/v1/users/verify/otp' \
--header 'Content-Type: application/json' \
--data '{
"phone_number": "09120000000",
"otp_code": 12345
}'curl --location --request PUT 'http://beehive.local/users/v1/users/profile' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <your-jwt-token>' \
--data '{
"name": "updated-user"
}'curl --location 'http://beehive.local/users/v1/users/profile' \
--header 'Authorization: Bearer <your-jwt-token>'cmd/- application entry points and commandsadapter/- external adaptersuserapp/- user-service application codedeploy/- deployment configurationdocs/- generated API documentationpkg/- shared packages
All credentials, tokens, OTP values, and phone numbers shown above are placeholders. Never commit real secrets or personal data.