A simple backend service built using go and gRPC. This implementation uses the Hexagonal architecture which allows the business logic to not rely on the data sources which can be easily swapped on demand.
The projects also uses gRPC gateway to proxy gRPC to JSON following the gRPC HTTP spec.
The service can:
- Login an existing user.
- Register a new user.
- Get auth user details.
- Update auth user details.
For unit tests, we use dockertest to boot up containers used to make integration tests easier and also vault for managing secrets.
TODO: Add gRPC and grpc-gateway endpoints
- Store credentials on vault
- [] Add observability using OpenTelemetry
- [] Add a worker to run background tasks
To run the project on docker, run the following command:
make compose-up
⚠️ Requires postgres
Clone the project
git clone https://github.com/jwambugu/bridge-v2.git
Go to the project directory
cd bridge-v2
Copy the config file internal/config/.example.env
file to internal/config/.test.env
Update the config as per your credentials.
cp internal/config/.example.env internal/config/example.env
Run the migrations
make build-goose && sh scripts/goose.sh up
Start the two webservers
- gRPC server
- grpc gateway server
go run cmd/api/*.go
⚠️ Requires postgres and updated config - see above.
To run tests, run the following command:
make test