Skip to content

Abdulrahman-02/G-Bank

Repository files navigation

G-Bank

This repository contains the codes of the Backend Master Class course.

This course is a step-by-step guide on how to design, develop, test and deploy a backend web service from scratch.

The backend service is a simple bank system that allows:

  • Create and manage accounts and users.
  • Record all balance changes to each account.
  • Make transfers between accounts.

Course Outline

Section 1: Working with database [Postgres]

  • Design the database schema
  • Generate codes to talk to the DB
  • Understand the DB isolation levels
  • How to use Docker
  • How to use Git and GitHub Actions to automate the CI/CD process

Section 2: Building RESTful HTTP JSON API [Gin]

  • Build a RESTful API using Gin
  • Loading app configs
  • Mocking DB for more robust unit tests
  • Handling errors
  • Authentication and authorization using JWT & PASETO

Section 3: Deploying the application to production [Kubernetes + AWS]

  • Build app with Docker and deploy to Kubernetes Cluster on AWS
  • Setup free tier AWS account
  • Create a production DB on AWS RDS
  • Store and retrieve production secrets using AWS Secrets Manager
  • Create a Kubernetes Cluster with EKS
  • Use GitHub Actions to automatically build and deploy the image to the Kubernetes Cluster
  • Buy a domain name and route traffics to the service
  • Secure with HTTPS and auto-renew SSL certificates from Let's Encrypt

Section 4: Advanced Backend Topics [Sessions + gRPC]

  • Managing user sessions
  • Building gRPC API
  • Using gRPC Gateway to serve both gRPC and HTTP requests at the same time
  • Embedding Swagger UI to document the API
  • Updating a record using optional parameters
  • Writing structured logger HTTP middlewares and gRPC interceptors

Section 5: Asynchronous processing with background workers [Asynq + Redis]

  • Asynchronous processing using background workers and Redis as its message queue
  • Create and send emails to users via Gmail SMTP server
  • Writing Unit Test for our gRPC services that might involve multiple dependencies at once

Section 6: Improve the stability and security of the server

  • Improve stability and security of the server
  • Updating dependenby packages to the latest version
  • Use Cookies to make the refresh token more secure
  • How to gracefully shutdown the server to protect the processing ressources

Docs