Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 5 days 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.
- Host: GitHub
- URL: https://github.com/sazid/simplebank
- Owner: sazid
- Created: 2022-03-11T02:07:50.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-03-19T20:29:32.000Z (over 2 years ago)
- Last Synced: 2024-06-20T20:51:52.519Z (5 months ago)
- Topics: gin, go, sqlc
- Language: Go
- Homepage:
- Size: 137 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
```