Skip to content

A simple backend service built using go and gRPC.

Notifications You must be signed in to change notification settings

jwambugu/bridge-v2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

38a757e · May 12, 2024
Mar 6, 2024
Oct 17, 2023
Mar 6, 2024
Mar 6, 2024
Mar 6, 2024
Mar 6, 2024
Mar 11, 2023
Mar 6, 2024
Mar 6, 2024
Oct 12, 2023
Mar 6, 2024
May 12, 2024
Mar 6, 2024
Feb 2, 2024
Feb 2, 2024
Mar 30, 2023
Apr 3, 2023

Repository files navigation

[WIP] - Bridge

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.

Endpoints

TODO: Add gRPC and grpc-gateway endpoints

Roadmap

  • Store credentials on vault
  • [] Add observability using OpenTelemetry
  • [] Add a worker to run background tasks

Running on Docker [Requires docker]

To run the project on docker, run the following command:

  make compose-up

Run Locally

⚠️ 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

Running Tests

⚠️ Requires postgres and updated config - see above.

To run tests, run the following command:

  make test