Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sazid/simplebank

A small implementation of a transaction service to learn about ACID properties of db, gin, sqlc, github actions and token based auth.
https://github.com/sazid/simplebank

gin go sqlc

Last synced: about 2 months ago
JSON representation

A small implementation of a transaction service to learn about ACID properties of db, gin, sqlc, github actions and token based auth.

Awesome Lists containing this project

README

        

# Simple Bank

A toy project to learn about production coding.

## Docker

1. Build docker image: `docker build -t simplebank:latest .`

2. Create a network for running both the PostgreSQL container and the app binary
they can discover each other: `docker network create bank-network`

3. Run docker container: `docker run --name simplebank --network bank-network -p 8300:8300 -e GIN_MODE="release" -e DB_SOURCE="postgresql://postgres:password@db:5432/simple_bank?sslmode=disable" simplebank:latest`

## How to generate code

- Generate SQL CRUD with sqlc:

```bash
make sqlc
```

- Create a new DB migration:

```bash
migrate create -ext sql -dir db/migration -seq
```

## How to run

- Run server:

```bash
make server
```