Build a Simple Blog Service with gRPC and goFiber
- Configure a database with entgo
- User CRUD API
- Blog CRUD API
- Configure Edges Between User and Post
- User Login API with JWT
- Support GRPC
- gRPC Interceptor for JWT
- Apply gRPC-gateway
- GitHub Actions CI
- Error Handle with logging
- Swagger Docs
- Go version 1.20 or greater
- MySQL
- Clone this Repository
git clone `{this repository URL}`
cd grpc_identity
- Configure .env file
DB_HOST=
DB_PORT=
DB_USER=
DB_PASSWORD=
DB_NAME=blog
# grpc or http
SERVER=grpc
HTTP_PORT=
GRPC_PORT=
GATEWAY_PORT=
GATEWAY_ENABLED= # If you want to enable, grpc-gateway write `true`
- Build and Run
make build
make clean build // If the codes updated, use this command
make test // Check the Unit test
./main // Run Go Binary File
If you configure the server to http
in .env
, you can check swagger docs in http://localhost:{your_http_port}/swagger/index.html
.