This repository contains two services:
- Authentication Service: Manages user accounts and profiles.
- OTP Generation Service: Dedicated to generating OTPs.
- For each service, install dependencies by moving into respective folders and running
go mod tidy
.
To start the authentication service, run the following command:
cd auth-service
go run ./cmd/server/main.go
To start the OTP generation service, run the following command:
cd otp-service
update .env with your credentials for twilio
go run ./cmd/server/main.go
To install grpcurl follow command in install.sh
in each folder.
cd auth-service
To signup with a phone number:
./grpcurl -protoset <(buf build -o -) -plaintext -d '{"first_name": "deepak", "phone_number": "8888760147", "email": "deepak.r.poojari@gmail.com", "last_name": "poojari"}' localhost:8080 auth.v1.AuthService/SignupWithPhoneNumber
To Verify Account:
./grpcurl -protoset <(buf build -o -) -plaintext -d '{"phone_number": "8888760147", "otp": "3842"}' localhost:8080 auth.v1.AuthService/LoginWithPhoneNumber
To Login:
./grpcurl -protoset <(buf build -o -) -plaintext -d '{"phone_number": "8888760147", "otp": "3842"}' localhost:8080 auth.v1.AuthService/ValidatePhoneNumberLogin
To Get Profile:
./grpcurl -protoset <(buf build -o -) -plaintext -d '{"phone_number": "8888760147"}' localhost:8080 auth.v1.AuthService/GetProfile
cd otp-service
To generate an OTP using gRPC:
./grpcurl -protoset <(buf build -o -) -plaintext \ -d '{"phone_number": "8888760147"}' \ localhost:8081 otp.v1.OtpService/VerifyPhoneNumber
buf generate
For more information on getting started with gRPC, refer to the ConnectRPC documentation.