Demo Fully Isolated System Architecture

Fully Isolated System Architecture (Microservices)

Arsitektur

  Request
    |
    |
    |
Api Gateway --- Auth Provider
    |\__________________________
    |           |               |
    |           |               |
 Service-1   Service-2      Service-3

File Konfigurasi

Setiap service terdapat file konfigurasi (.env) yang dapat disesuaikan dengan runtime environment

Cara Install

  • Buat database microservices

  • Ubah file .env yang terdapat pada service security (security/.env), sesuaikan dengan konfigurasi database

  • Build dan jalankan docker-compose

  • Seeding data melalui endpoint POST http://localhost:2727/api/seed

  • Login melalui endpoint POST http://localhost:2727/api/login

{
    "email": "[email protected]",
    "password": "admin"
}

Maka akan mengembalikan response

{
    "token": "[TOKEN]"
}
  • Panggil endpoint GET http://localhost:2727/api/hello dengan header Authorization: Bearer [TOKEN] maka akan mengembalikan response
{
    "message": "Hello Service 1"
}

Endpoint

  • Publik
POST   /login 
POST   /seed
  • Privat (Butuh header authorization)
POST   /api/users
PUT    /api/users/:id
DELETE /api/users/:id
GET    /api/users/:id
GET    /api/users 
POST   /api/validate
GET    /api/hello
GET    /api/hi
GET    /api/hey

Pengembangan Independen

Setiap service dapat dikembangkan secara independen tanpa perlu terkoneksi dengan Api Gateway atau Arsitektur secara utuh. Untuk melakukan simulasi privat endpoint (Api) cukup dengan mengirimkan header User-Id dan User-Email pada request.

Ini karena Api Gateway dirancang untuk melakukan validasi token dan kemudian mengubah token menjadi header User-Id dan User-Email melalui endpoint /api/validate yang mengembalikan informasi user. Header (User-Id dan User-Email) kemudian diteruskan ke endpoint service (sesuai dengan mapping) sebagai tanda bahwa request telah divalidasi oleh Api Gateway

Owner
Muhamad Surya Iksanudin
Symfony Developer, Backend Engineer, System Administrator, Linux Enthusiast
Muhamad Surya Iksanudin
Similar Resources

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

Assignment2 - A shared project making use of microservice architecture

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.

Jan 26, 2022

Microservice - A sample architecture of a microservice in go

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

Feb 3, 2022

Go-hexagonal - Go Hexagonal architecture implemented with interfaces, tests and mockgen

Go Hexagonal Go Hexagonal architecture implemented with interfaces, tests and mo

Jan 22, 2022

Demo project for unit testing presentation @ GoJKT meetup

go-demo-service Demo project for unit testing presentation @ GoJKT meetup This is a demo project to show examples of unit testing for GoJKT meetup Use

Jul 10, 2021

OpenFunction Demo Repo

OpenFunction Demo Installation Setup a Cluster minikube start -p demo --kubernetes-version=v1.22.2 --network-plugin=cni --cni=calico Install OpenFunct

Nov 21, 2021

A microservices-demo service that provides catalogue/product information.

A microservices-demo service that provides catalogue/product information. This service is built, tested and released by travis.

Nov 22, 2021

A microservices-demo service that provides catalogue/product information.

A microservices-demo service that provides catalogue/product information. This service is built, tested and released by travis.

Nov 28, 2021

Demo for my talk at ArgoCon '21 showing how to use Go to create and submit dynamic Argo Workflows.

Demo for my talk at ArgoCon '21 showing how to use Go to create and submit dynamic Argo Workflows.

argocon-21-demo Demo for my talk at ArgoCon '21 showing how to use Go to create and submit dynamic Argo Workflows. This repo implements a Go-based CLI

Oct 12, 2022
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
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
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
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
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
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