This service manages user authentication and profile operations using Docker and Traefik.
To start the user service in development mode, run:
make start-user-app-devThis command will spin up the service container.
To apply database migrations, run the following inside the running container:
docker exec -it beehive-user-service-1 sh -c "go run cmd/user/main.go migrate --up"The service uses Traefik as a reverse proxy for authentication routing.
You can find the Swagger UI for the API here:
http://beehive.local/users/v1/swagger/index.html
curl --location 'http://beehive.local/users/v1/users/signup' \
--header 'Content-Type: application/json' \
--data '{
"name": "firoozeh",
"phone_number": "09390815723"
}'If the user already exists, an OTP code will be sent to the phone number.
curl --location 'http://beehive.local/users/v1/users/login' \
--header 'Content-Type: application/json' \
--data '{
"phone_number": "09390315707"
}'curl --location 'http://beehive.local/users/v1/users/verify/otp' \
--header 'Content-Type: application/json' \
--data '{
"phone_number": "09390315707",
"otp_code": 52632
}'Update user profile with a valid Bearer token:
curl --location --request PUT 'http://beehive.local/users/v1/users/verify/otp' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <your-jwt-token>' \
--data '{
"name": "beehive"
}'Use a GET request to view the profile (endpoint URL example):
curl --location --request GET 'http://beehive.local/users/v1/users/profile' \
--header 'Authorization: Bearer <your-jwt-token>'