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
You can run Microbank in several different ways:
- 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 --build
Microbank implements HTTP, gRPC Gateway and gRPC servers
gRPC Gateway server serves both HTTP and gRPC requests
- Homebrew
- PostgreSQL. Run
brew install postgresql
- Go
- golang-migrate. Run
brew install golang-migrate
- Install redis
- 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
make postgres PG_CONTAINER_NAME=<name>
- Create microbank database
make createdb
- Start redis server
make redis
- Start server
make server
- Query the endpoints using the microbank.rest.http file or any rest client out there
- 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
make postgres PG_CONTAINER_NAME=<name>
- Create microbank database
make createdb
- Start redis server
make redis
- Start server
make server
- Query the endpoints using the microbank.gateway.http file or any rest client out there
- 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)
- Download the evans gRPC client on your machine
- Run the command
make evans