Assignment2 - A shared project making use of microservice architecture

Table of Contents
  1. About The Project
  2. Getting Started
  3. Roadmap
  4. License
  5. Contact

About The Project

This project is a shared project making use of microservice architecture, API's and a simple frontend to implement a start-up new concept called EduFi. The concept combines education and financial systems to create profit from studying.

There are a total of 23 different Microservices that uses API to communicate with each other, this specific part is handling the transactions and the student's wallet. The package encompasses Listing of all tokens, Listing of a specific token, Viewing all transactions of each token and Sending/Recieving of tokens. To ensure that all alternate scenarios is covered, Atomicity and Validations have been considered and implemented in the algorithms.

To allow the services to be scaled horizontally, docker images have been built and push to the public repository to pull and run it as a container.

Passenger page for getting current status, viewing trips and requesting for trips. [Passenger_Screen_Shot]

Driver page for getting current status, starting and ending ride. [Driver_Screen_Shot]

This assignment's requirements are to create 2 or more microservices which will be ran in the background while a frontend such as website can be used to interact with the functions in the microservices.

This assignment's requirements are to depoly and run each package's Microservices on the server though docker images, and the objective is to ensure that each of the packages microservices has minimal coupling ion with one another. Through API it will allow different microservices to communicate with one another even if the technologies used is different.

There are a total of 2 microservices: (the functions will be shown in each microservice.)

  1. Transactions
  • Creating Transaction
  • Updating Transaction
  • Ping Reciever Wallet(DATA):Recieve Token
  • Deduct Sender Wallet(DATA):Send Token
  • Show Transactions(Student,Token)
  1. Wallet
  • Initialize Wallet(During Student Creation)
  • Inject tokens(Wallet,Module List)
  • Get all Tokens(Wallet)
  • Get specific Token(Wallet)

Design Consideration of Microservices

Why 2 Microservice:

  • Wallet and transaction usually replies on each other, which was the reason why they were designed to be in seperated Microservices so that it allows lesser Coupling between the two microservices when they communicate.
  • Wallet will be the end point througout the sending and recieving of the tokens and transaction will act as a hub for all type of transaction to communicate with than after validation transaction will ping and send data to the correct reciever wallet and deduct the amount from the sender after the ping return a status code 200 which indicates the successful transaction to the receiver, this will improve the overall atomicity of the transactions.
  • Wallet Microservice will focus on functions like Initializing Wallet and token and Listing all or a specific Token.
  • Transaction Microserice will focus on functions like Creating and updating a transaction, handling the sending and recieving of tokens with validations and showing all transactions for a token.
  • This allows each area of focus to be seperated in case if one microservice is required to be shut down for enhancement or errors the other microservices can still operate thus ensuring user experience from the running microservices.
  • Example: If Transaction is shut down to update the algorithm or when error occurs, wallet functions like initializing wallet and token and showing tokens can still operate thus ensuring user satisfaction. The opposite can also occur if the wallet is shut down the transactions can still be operational to a certain extend upholding the SLA level.

(back to top)

To better understand, below is a diagram of the assignment's structure and how communications are made. [ArchitectureDiagram-screenshot] [ArchitectureDiagramEach-screenshot]

(back to top)

Built With

The main objective of this assignment is to put the knowledge and skills learnt about Golang to use. Vanilla Javascript and HTML CSS is used for the frontend.

(back to top)

Getting Started

Prerequisites

Make sure that MySQL and Golang is downloaded on your device.

Installation from Github

  1. Clone the repo
    git clone https://github.com/gabgohkb/Assignment2.git
  2. Install necessary libraries
    go get -u github.com/go-sql-driver/mysql
    go get -u github.com/gorilla/mux
    go get -u github.com/gorilla/handlers
  3. Execute database start script in /DB/ExecuteDB_Transaction_Wallet.sql

(back to top)

Installation from Docker

  1. Clone the repo
    git clone https://github.com/gabgohkb/Assignment2.git
  2. Install necessary libraries
    go get -u github.com/go-sql-driver/mysql
    go get -u github.com/gorilla/mux
    go get -u github.com/gorilla/handlers
  3. Execute database start script in /DB/ExecuteDB_Transaction_Wallet.sql

(back to top)

## Usage

To start using the Wallet platform, follow the below steps:

  1. Run all microservices in each directory
cd Assignment2\Transaction
go run transac.go
cd Assignment2\Wallet
 go run wallet.go 
  1. Open frontend by opening WalletHome.html in Assignment2\Frontend

(back to top)

Roadmap

  • Backend using Golang
  • Frontend using HTML JavaScript
  • Tidy up both backend and frontend

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Gabriel Goh - School Email

Project Link: https://github.com/gabgohkb/Assignment2.git

Container-Transaction_Microservice Link: https://hub.docker.com/repository/docker/gabgkb/etiassignment2_transactionmicroservice

Container-Wallet_Microservice Link: https://hub.docker.com/repository/docker/gabgkb/etiassignment2_walletmicroservice

Container-MySQLDB_Microservice Link: https://hub.docker.com/repository/docker/gabgkb/etiassignment2_dbtransacwallet

(back to top)

Similar Resources

ftgogo - event-driven architecture demonstration application

ftgogo (food-to-gogo) is a Golang implementation of the FTGO application described in the book "Microservice Patterns" by Chris Richardson. A library edat was developed to provide for Golang many of the solutions that Eventuate, the framework used by FTGO, provides for Java.

Jan 3, 2023

CRUD API server of Clean Architecture with Go(Echo), Gorm, MySQL, Docker and Swagger

CRUD API server of Clean Architecture with Go(Echo), Gorm, MySQL, Docker and Swagger

CRUD API Server of Clean Architecture Go(echo) gorm mysql docker swagger build docker-compose up -d --build API Postman and Fiddler is recommended to

May 30, 2021

Demo Fully Isolated System Architecture

Fully Isolated System Architecture (Microservices) Arsitektur Request | | | Api Gateway --- Auth Provider |\________________________

Dec 13, 2022

Hexagonal Architecture implemented in GO

MSGO - Microservices in Go Hexagonal Architecture (Ports & Adapter) Wiki: Hexagonal Architecture Architecture benefits: loosely coupled interchangeabl

Aug 14, 2022

🚀 link shortener which is using hexagonal architecture in Go

🚀 go-link-shortener-hexagonal Link Shortener which is using Hexagonal Architecture that compliant with clean code guidelines in Go. ├── README.md ├──

Feb 26, 2022

This is a template service for development first with go monolithic architecture

This is a template service for development first with go monolithic architecture

Nov 27, 2022

Hexagonal architecture bank account example

Hexagonal architecture bank account example Esse repositório contém um pouco dos meus estudos sobre arquitetura hexagonal. Go Lang é a linguagem utili

Jan 8, 2022

The microservices have a loosely coupled architecture design

The microservices have a loosely coupled architecture design

ETI_Assignment1 5.1.3.1 Design consideration The microservices have a loosely coupled architecture design. The microservices created include Passenger

Dec 12, 2021

Hands-on Labs on Microservices Architecture

Giới thiệu Khóa học Building Distributed Applications with Microservices sẽ giúp bạn tìm hiểu nhanh chóng về công nghệ Microservices để ứng dụng xây c

Jul 17, 2022
Microservice - A sample architecture of a microservice in go

#microservice Folder structure required. service certs config config.yaml loggin

Feb 3, 2022
Go microservice tutorial project using Domain Driven Design and Hexagonal Architecture!

"ToDo API" Microservice Example Introduction Welcome! ?? This is an educational repository that includes a microservice written in Go. It is used as t

Jan 4, 2023
A pastebin clone implemented as microservice architecture.
A pastebin clone implemented as microservice architecture.

pastebean Implementing a pastebin clone as a microservice architecture. Written using go-gin and gorm alongwith many other awesome open source Go liba

Jan 24, 2022
Go-rifa-microservice - Clean Architecture template for Golang services
Go-rifa-microservice - Clean Architecture template for Golang services

Test CI Go Clean template Clean Architecture template for Golang services Overvi

Sep 22, 2022
Authentication-microservice - Microservice for user authentication built with golang and gRPC

Authentication-microservice - Microservice for user authentication built with golang and gRPC

May 30, 2022
Microservice - Microservice golang & nodejs
Microservice - Microservice golang & nodejs

Microservice Gabungan service dari bahasa pemograman go, nodejs Demo API ms-auth

May 21, 2022
Customer-microservice - Microservice of customer built with golang and gRPC

?? Building microservices to manage customer data using Go and gRPC Command to g

Sep 8, 2022
This is demo / sample / example project using microservices architecture for Online Food Delivery App.

Microservices This is demo / sample / example project using microservices architecture for Online Food Delivery App. Architecture Services menu-servic

Nov 21, 2022
Trying to build an Ecommerce Microservice in Golang and Will try to make it Cloud Native - Learning Example extending the project of Nic Jackson

Golang Server Project Best Practices Dependency Injection :- In simple words, we want our functions and packages to receive the objects they depend on

Nov 28, 2022
Golang Caching Microservice (bequant.io test project to get hired)

bequant test project How to use: Simply type docker-compose up -d --build db warden distributor in terminal while in project's directory. MySQL, Warde

May 14, 2022