Welcome to ZenBank, a simple Go application, simulating bank transactions between multiple accounts. Developed to showcases various technologies and practices in the Go ecosystem. The application includes a robust backend implemented in Go, a Postgres database, and modern deployment techniques using Kubernetes and AWS.
- Golang: The primary programming language for the backend.
- PostgreSQL: The relational database system.
- Docker: Containerization tool for the database and application.
- Kubernetes: For container orchestration and deployment on AWS.
- gRPC: For high-performance communication between services.
- Gin: Web framework for the RESTful API.
- GoDotEnv: Configuration management.
- AWS: Cloud platform for hosting the application.
- GitHub Actions: CI/CD pipeline for automated testing and deployment.
- Redis: Used for background tasks.
- Cert-manager and Let's Encrypt: For handling TLS certificates.
- Database Schema Design: Using dbdiagram.io to design and generate SQL code.
- CRUD Operations: Generate CRUD operations from SQL using sqlc.
- Database Transactions: Implementation of database transactions and handling deadlocks.
- RESTful API: Built using Gin to handle HTTP requests.
- Authentication: Secure user authentication using PASETO tokens.
- Role-Based Access Control (RBAC): To manage user permissions.
- gRPC API: For communication between microservices.
- Docker and Kubernetes: Containerization and orchestration for scalable deployment.
- Automated CI/CD: Using GitHub Actions for continuous integration and deployment.
- Async Tasks: Integration with Redis for background processing.
To run this application locally, follow the steps below:
- Docker
- Go (> v1.15)
- Sqlc
- Migrate
-
Clone the Repository
git clone https://github.com/kaayce/zen-bank.git cd zenbank
-
Environment Variables Create a
.env
file in the project root with the following content:POSTGRES_USER=your_postgres_user POSTGRES_PASSWORD=your_postgres_password POSTGRES_DB=zen_bank POSTGRES_CONTAINER_NAME=zenbank_postgres POSTGRES_IMAGE=postgres:latest DB_SOURCE=postgres://your_postgres_user:your_postgres_password@localhost:5434/zen_bank?sslmode=disable SCHEMA_DIR=path/to/migrations
-
Start PostgreSQL Container
make startdb
-
Create Database
make createdb
-
Run Database Migrations
make migrate-up
-
Generate SQL Code
make sqlc
-
Build and Run the Application
make start
-
Running Tests
make test
To stop and remove the PostgreSQL container (only for development or local environment):
make reset
TBA
For any questions or issues, please feel free to contact me at [[email protected]].