Backend Server for a bank Infrastructure (Go and Postgres)
[x] Design Database Schema
[x] Create a postgres instance using docker and docker volume
using docker-compose.yaml
file
[x] Connect to a Postgres instance
[x] Create Tables In DB using sql file Future Improvements:
[x] Make CRUD API for accounts table
[x] Write Unit test for the API's
[x] Dockerize (create a docker image) for the go app and db See Dockerfile here
[x] Create CI using Github Actions on master branch
[x] Handle DB Transactions use the idea
BEGIN
if Succeed
COMMIT
else
ROLLBACK
[x] Deploy on Kubernetes using AWS EKS and
[x] Setup Monitoring Using Prometheus steps
[x] Write Unit Tests by using gomock to mock DB.
[x] Create Docker Network to let the image connect with the db
docker network create bank-network
docker network connect bank-network postgres12
[x] Make Auth API using PASETO ( also support extension for JWT )
[x] Use UUID to store transaction data in DB.
go1.16 or above installed
make postgres
for making a postgres db using DOCKERuser: admin
and password: password
and db = default_db
.make server
the server will be up and running on localhost:8080POST /account for creating a new account
{
"owner_email":"sample@getmail.com",
"currency":"USD"
}
{
"from_account_id": 2,
"to_account_id": 1,
"amount": 15
}