Go Simple Bank is a backend service for managing bank accounts, tracking balances, and enabling secure money transfers. The backend is built with Golang, PostgreSQL, Gin, gRPC, and Kubernetes, ensuring performance, security, and scalability.
- PostgreSQL schema design, migrations, transactions, and isolation levels
- Handling deadlocks, using pgx for optimized database access
- Implementing authentication with PASETO/JWT and enforcing RBAC-based access control
- Background workers and async task processing with Redis + Asynq
- Secure session management and CORS policy enforcement
- Developing RESTful APIs with Gin, implementing middleware for access control
- Creating gRPC APIs with Protobuf, extracting metadata, and integrating Swagger documentation
- Mocking databases for unit testing and error handling
- Containerizing with Docker, managing secrets with AWS Secrets Manager
- Deploying to AWS EKS using Kubernetes, setting up AWS RDS
- Configuring ingress, TLS encryption, and auto-scaling
- Ensuring graceful server shutdown and optimizing AWS costs
- Implementing CI/CD pipelines with GitHub Actions
- Logging, monitoring, and error handling
- Sending verification emails via Gmail
- Account Management: Create and manage bank accounts with owner name, balance, and currency.
- Transaction History: Record every balance change to ensure accurate tracking.
- Money Transfers: Securely transfer funds between accounts using transactions to ensure consistency.
- Language: Golang
- Database: PostgreSQL
- Web Framework: Gin
- Authentication: PASETO, JWT, Bcrypt
- Deployment: Docker, Kubernetes, AWS (EKS, RDS, ECR, Route53)
- Async Processing: Redis, Asynq
- CI/CD: GitHub Actions
-
Using scoop
scoop install migrate
-
scoop install sqlc
-
go install github.com/golang/mock/[email protected]
-
Create the bank-network
make network
-
Start postgres container:
make postgres
-
Create simple_bank database:
make createdb
-
Run db migration up all versions:
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 sqlc:
make sqlc
-
Generate DB mock with gomock:
make mock
-
Create a new db migration:
make new_migration name=<migration_name>
-
Run server:
make server
-
Run test:
make test