command
module
Version:
v0.0.0-...-10b8bc0
Opens a new window with list of versions in this module.
Published: Sep 25, 2022
License: MIT
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
Bank Server
Backend Server for a bank Infrastructure (Go and Postgres)
RoadMap + Learnings
- Design Database Schema
- Create a postgres instance using docker and docker volume
using
docker-compose.yaml
file
- Connect to a Postgres instance
- Create Tables In DB using sql file
Future Improvements:
- Make CRUD API for accounts table
- Write Unit test for the API's
- Dockerize (create a docker image) for the go app and db
See Dockerfile here
- Create CI using Github Actions on master branch
- Push Docker Image to AWS ECR via actions
- Run go build and test
- Add Datree in CI for misconfig checking
- Handle DB Transactions use the idea
BEGIN
if Succeed
COMMIT
else
ROLLBACK
-
Deploy on Kubernetes using AWS EKS and
- Install Kubecost for cost management
- install ArgoCD for GitOps
-
Setup Monitoring Using Prometheus steps
-
Write Unit Tests by using gomock to mock DB.
-
Create Docker Network to let the image connect with the db
docker network create bank-network
docker network connect bank-network postgres12
-
Make Auth API using PASETO ( also support extension for JWT )
-
Use UUID to store transaction data in DB.
TODO
- Handle race condition in transaction.
- Handle deadlock in DB due to multiple threads of transaction
- Create UI form for login signup
- Create a UI for the user to access the Transactions
- Create Policy engine for Permission on a Account
How to Use ?
- Makefile has necessary commands
Pre-requisite :
- go1.16 or above installed
- Install essential go modules
- run
make postgres
for making a postgres db using DOCKER
- Connect to the DB using
user: admin
and password: password
and db = default_db
.
- run the bank-server.sql file to create db tables.
- run
make server
the server will be up and running on localhost:8080
- POST /account for creating a new account
{
"owner_email":"sample@getmail.com",
"currency":"USD"
}
- GET /account?owner_email=email@email.com for gettiing account details using email
- POST /transfer for transferring money to other bank account
{
"from_account_id": 2,
"to_account_id": 1,
"amount": 15
}
Documentation
¶
There is no documentation for this package.
Source Files
¶
Directories
¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sqlc
Package db is a generated GoMock package.
|
Package db is a generated GoMock package. |
store
Package store is a generated GoMock package.
|
Package store is a generated GoMock package. |
|
|
|
|
|
|
|
|
Click to show internal directories.
Click to hide internal directories.