Budgetin - User Service
Overview
User Service is one of the microservices in Budgetin that responsible for user authentication and user authorization by managing the user roles and permissions.
This repository contains an application written in Go that utilizes Protocol Buffers and gRPC for communication. This README provides step-by-step instructions on how to install, compile, and run the application.
Installation and Setup
Before running the application, ensure you have Go installed on your machine. You can download and install it from the Go Official Website.
Once Go is installed, follow these steps:
-
Clone the repository:
git clone https://github.com/budgetin-app/user-service.git
-
Change directory into the project folder:
cd user-service
-
Install Protocol Buffers Compiler (protoc):
You need to have Protocol Buffers Compiler installed. You can download it from the Protocol Buffers GitHub releases page.
-
Install protoc-gen-go:
To generate Go files from .proto files, you need to install protoc-gen-go. You can do this using the following command:
go install google.golang.org/protobuf/cmd/protoc-gen-go
Compilation and Running
-
Compile the proto file
The first step is to compile the .proto
file using protoc. Navigate to the directory where the .proto
file is located and execute the following command:
protoc --go_out=paths=source_relative:. --go-grpc_out=paths=source_relative:. ./app/proto/*.proto
-
Build the generated wire injection file
After compiling the .proto
file, you need to generate the wire injection file. Run the following command:
wire ./config
-
Build and run the application through main.go
file
Finally, you can build and run the application using the main.go
file. Execute the following commands:
go build -o main.exe ; ./main
Contributing
Contributions are welcome! If you find any bugs or have suggestions for improvements, please feel free to open an issue or submit a pull request.
License
This project is licensed under the MIT License.