simple bank which is implemented using Golang

Banker

The service that we’re going to build is a simple bank. It will provide APIs for the frontend to do following things:

  1. Create and manage bank accounts, which are composed of owner’s name, balance, and currency.
  2. Record all balance changes to each of the account. So every time some money is added to or subtracted from the account, an account entry record will be created.
  3. Perform a money transfer between 2 accounts. This should happen within a transaction, so that either both accounts’ balance are updated successfully or none of them are.

Download

clone the repository:

git clone [email protected]:sakhaei-wd/banker.git

Setup local development

Install tools

Setup infrastructure

  • Create the bank-network

    make network
  • Start postgres container:

    make postgres
  • Create simple_bank database:

    make createdb
  • Run db migration up all versions:

    make migrateup
  • Run db migration up 1 version:

    make migrateup1
  • Run db migration down all versions:

    make migratedown
  • Run db migration down 1 version:

    make migratedown1

How to generate code

  • Generate SQL CRUD with sqlc:

    make sqlc
  • Generate DB mock with gomock:

    make mock
  • Create a new db migration:

    migrate create -ext sql -dir db/migration -seq <migration_name>

How to run

  • Run server:

    make server
  • Run test:

    make test
Similar Resources

A limited Flow Access API which runs outside of the Flow Network using the DPS

Access API Flow DPS implements the Flow Access API Specification, except for the following endpoints: SendTransaction GetLatestProtocolStateSnapshot G

Jul 28, 2022

This is a simple chat app which shows how to use Go with Hotwire.

This is a simple chat app which shows how to use Go with Hotwire.

chat-hotwire-go This is a simple chat app which shows how to use Go with Hotwire. Messages from another user are received via Turbo Streams over a web

Jul 2, 2022

Person is a simple CRUD application written in go which exposes API endpoint to create the person.

Person Person is a simple CRUD application written in go which exposes API endpoint to create the person. Installation Install docker in your local sy

Oct 18, 2021

QuickAbeHiroshi - The golang program to open a web site which is the fastest in the world

QuickAbeHiroshi - The golang program to open a web site which is the fastest in the world

The golang program to open a web site which is the fastest in the world.

Jan 2, 2022

A small project for a simple chatroom using golang.

A small project for a simple chatroom using golang.

chatroom_go A small project for a simple chatroom using golang. 项目编码流程的设计分析 通讯逻辑示意图 客户端部分 客户端登录功能 1.接收的输入id和密码 2.接收服务端的返回结果 3.判断是成功还是失败,并显示对应的页面 客户端发送

Jul 3, 2022

Build for all Go-supported platforms by default, disable those which you don't want.

bagop Build for all Go-supported platforms by default, disable those which you don't want. Overview bagop is a simple build tool for Go which tries to

Jul 29, 2022

A bin which will keep screen open by moving a mouse

Stay Awake This is a small program which will move mouse up and down to keep screen on. This stimulates like user is doing something. Motivation I had

Oct 21, 2021

PKSUID is a small extension for KSUID (K-Sortable Globally Unique IDs) which allows prefixing it with arbitrary up to 16 bytes strings

PKSUID is a small extension for KSUID (K-Sortable Globally Unique IDs) which allows prefixing it with arbitrary up to 16 bytes strings

Dec 1, 2022

Help to release a project which especially has multiple git repositories

This project aims to help to release a project which especially has multiple git repositories. Installation Install it to a Kubernetes cluster. You ca

Dec 15, 2022
Related tags
Simplebank - A simple bank with golang

Simple-Bank The service that we’re going to build is a simple bank. It will prov

Feb 1, 2022
Bank-End Master Class [ Golang, Postges, Docker ]

Simple Bank This repository contains the codes of the Backend master class course by TECH SCHOOL. In this backend master class, we’re going to learn e

Dec 14, 2021
http-theft-bank-LiujJian created by GitHub Classroom

http-theft-bank-start-template 木犀银行抢劫游戏模版 hope this can help you http-theft-bank-start-template To begin with Tips 附录 http URL http 工作流程 http 协议方法 HTT

Dec 2, 2021
Let's Go is task sharing app implemented in golang.

Let's Go - A sample GO app Overview Let's Go is an HTTP server. It has various apis to play with. It is a small app that can group users of a company

Dec 13, 2021
libFFM-gp: Pure Golang implemented library for FM (factorization machines)

libFFM-gp: Pure Golang implemented library for FM (factorization machines)

Oct 10, 2022
Seekable ZSTD compression format implemented in Golang.

ZSTD seekable compression format implementation in Go Seekable ZSTD compression format implemented in Golang. This library provides a random access re

Jan 7, 2023
It is a basic todo app which has CRUD operation using Buffalo and golang

It is a basic todo app which has CRUD operation using Buffalo and golang

Nov 1, 2021
FreeDesktop.org (xdg) Specs implemented in Go

xdg Package xdg provides access to the FreeDesktop.org (XDG) specs. Documentation Documentation is available via godoc. Here are direct links to the d

Nov 11, 2022
Go specs implemented as a scripting language in Rust.

Goscript A script language like Python or Lua written in Rust, with exactly the same syntax as Go's. The Goal Runs most pure Go code, probably add som

Jan 8, 2023
Geth client which picks the most profitable blocks to mine using a greedy algorithm

Greeden-Geth Greeden-Geth is a protocol-agnostic client which uses a greedy algorithm to pick the most profitable blocks to submit to the network out

Nov 16, 2022