Go Backend for auth.
- Install CockroachDB
- Run the below command to start a single node cockroachdb instance.
cockroach start-single-node --insecure --listen-addr=localhost:26257 --http-addr=localhost:8080
- Install Go
- Set Environment Variables. Execute the following command in the root directory of the project.
export DATABASE_URL=<database_url>
export MAILER_EMAIL=<mailer_email>
export MAILER_PASSWORD=<mailer_password>
export FRONTEND_URL=<frontend_url>
export HTTP_PORT=5000
export GRPC_PORT=5001
- Install the protobuf-grpc compiler.
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
export PATH="$PATH:$(go env GOPATH)/bin"
- Run the following command to start the server.
go run main.go
- Install protoc compiler
- Run the following command to generate the go files from the proto files.
protoc --go_out=./ --go_opt=paths=source_relative \
--go-grpc_out=./ --go-grpc_opt=paths=source_relative \
./proto/authenticate.proto