Coder Social home page Coder Social logo

zen-bank's Introduction

ZenBank - Full featured bank application backend [Golang + Postgres + Kubernetes + gRPC]

Overview

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.

Technologies Used

  • 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.

Features

  • 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.

Getting Started

To run this application locally, follow the steps below:

Prerequisites

  • Docker
  • Go (> v1.15)
  • Sqlc
  • Migrate

Setup Development Environment

  1. Clone the Repository

    git clone https://github.com/kaayce/zen-bank.git
    cd zenbank
  2. 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
  3. Start PostgreSQL Container

    make startdb
  4. Create Database

    make createdb
  5. Run Database Migrations

    make migrate-up
  6. Generate SQL Code

    make sqlc

Running the Application

  1. Build and Run the Application

    make start
  2. Running Tests

    make test

Stopping and Removing Docker Container

To stop and remove the PostgreSQL container (only for development or local environment):

make reset

Deployment

TBA

For any questions or issues, please feel free to contact me at [[email protected]].

zen-bank's People

Contributors

kaayce avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.