micro-bank

command module
v0.0.0-...-4a8a371 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 15, 2025 License: MIT Imports: 16 Imported by: 0

README

Microbank

A minimalist implementation of a banking server, exposing endpoints for the following purposes:

  • creating a banking customer
  • creating an account for a particular customer using one of the accepted currencies
  • transfering money between customer accounts
  • retrieving all accounts created by the customer in the current session
  • retrieving one account created by the customer in the current session

Read NOTE.md for detailed information about this project

Run Microbank

You can run Microbank in several different ways:

1. Docker Compose - (The easiest)
  • Download Docker
  • Clone this repository
  • Comment out the environment variables for localhost and uncomment the ones for docker compose environment in app.env
  • Start services
docker compose up
2. Localhost (Macbook) - (Requires more installations on your machine)

Microbank implements HTTP, gRPC Gateway and gRPC servers

gRPC Gateway server serves both HTTP and gRPC requests

Pre-requisites
  1. Homebrew
  2. PostgreSQL. Follow the download instructions on the download section of the Postgres App install page
  3. Go
  4. golang-migrate. Run brew install golang-migrate
  5. gow or go watch
  6. Install redis
Run HTTP server
  • Ensure these lines of code are commented out in the main function
go runGatewayServer(config, store)
runGrpcServer(config, store)
  • Comment out the environment variables for docker environment and uncomment the ones for localhost in app.env file.

  • Download all dependencies

 go mod download
  • Start postgresql server

  • Start server

make server
  • Query the endpoints using the microbank.rest.http file or any rest client out there
Run gRPC Gateway server
  • Ensure this line of code is commented out in the main function
runGinServer(config, store)
  • Ensure these lines of code are uncommented in the main function
go runGatewayServer(config, store)
runGrpcServer(config, store)
  • Comment out the environment variables for docker environment and uncomment the ones for localhost in app.env

  • Download all dependencies

go mod download
  • Start postgresql server

  • Start server

make server
  • Query the endpoints using the microbank.gateway.http file or any rest client out there
Run only gRPC server
  • Ensure these lines of code are commented out in the main function
runGinServer(config, store)
go runGatewayServer(config, store)
  • Ensure this line of code is uncommented in the main function
runGrpcServer(config, store)
make evans

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
db
mock
Package mockdb is a generated GoMock package.
Package mockdb is a generated GoMock package.
Package docs Code generated by swaggo/swag.
Package docs Code generated by swaggo/swag.
Package pb is a reverse proxy.
Package pb is a reverse proxy.
mock
Package mockwk is a generated GoMock package.
Package mockwk is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL