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

https://github.com/sulemaanhamza/gobank

A classic example of a secure REST API in Golang, PostgreSQL & Kubernetes
https://github.com/sulemaanhamza/gobank

api docker golang jwt kubernetes paseto postgresql

Last synced: about 2 months ago
JSON representation

A classic example of a secure REST API in Golang, PostgreSQL & Kubernetes

Awesome Lists containing this project

README

          

# GoBank

A simple & secure bank API in Go

### Dependencies

- [Golang Migrate](https://github.com/golang-migrate/migrate/tree/master/cmd/migrate)
- [Sqlc](https://github.com/kyleconroy/sqlc#installation)
- [Gomock](https://github.com/golang/mock)

### Infrastructure Setup (Makefile)

- Create the gobank-network

``` bash
make network
```

- Start postgres container:

```bash
make postgres
```

- Create simple_bank database:

```bash
make createdb
```

- Run db migration up all versions:

```bash
make migrateup
```

- Run db migration down all versions:

```bash
make migratedown
```

### Sqlc

- Generate SQL CRUD with sqlc:

```bash
make sqlc
```

- Generate DB mock with gomock:

```bash
make mock
```

### How to run

- Run server:

```bash
make server
```

- Run test:

```bash
make test
```

## License

[MIT](https://choosealicense.com/licenses/mit/)