A simple back-end project using Golang, PostgreSQL.
- Golang
- PostgreSQL
- Docker
- sqlc
- migrate (for migrate database)
- Paseto (create token for authentication)
- Create network
bank-network
:
make network
- Start postgres container:
make postgres
- Create
simple_bank
database:
make createdb
- Run db migration up all versions (install migrate):
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
- Generate SQL CRUD with sqcl:
make sqlc
- Generate DB mock with gomock:
make mock
- Create a new db migration:
make new_migration name=<migration_name>
- Generate dbdocs from
doc/db.dbml
:
make dbdocs
- Generate db schema:
make db_schema
- Run server:
make server
- Run test:
make test