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

Overview

Backend Service

Instalation

Set up variable environment on your device. export PATH_CONF = "../config" export FILE_CONF = "local.conf"

When you want to start this service, set up this aliases. alias backend-run = "gin --port 8080 --appPort 8081 --path . --build ./app run main.go" and running with alias backend-run

Introduction

Merupakan service core (Security) yang bisa di duplikasi ke beberapa aplikasi. Mulai dari register user, login dll. Service ini menggunakan bahasa Google Language (golang) yang di support Framework Gin Gonic.

Guide Styling Code

Kita harus memiliki aturan dalam menerapkan code. Agar code yang dihasilkan mudah dibaca, dipahami & di maintenance. Beberapa hal yang harus diperhatikan adalah :

  • Design Pattern
    • Service ini mengadopsi Structural Pattern (Decorator Pattern)
    • Terdiri dari beberapa layer
      • Delivery -> Layer untuk menerima request dari client / service dan juga bertugas melakukan validasi dari setiap request yang diterima.
      • Usecase -> Business layer, hanya untuk management proses atau flowchart dari api tersebut.
      • Entity -> Entitas layer, untuk mendapatkan data pada database atau data dari request api.
  • Penamaan function
    • Pada endpoint handler harus sesuai dengan usecase yang digunakan (Get, Create, Edit & Remove) sebagai awalan penamaan function pada Usecase & Delivery.
    • Pada repository harus menggunakan awalan (Read, Insert, Update & Delete).
  • Penamaan variable tidak boleh di singkat dan harus jelas merepresentasikan isi dari variable tersebut.
  • Handle error pada Usecase layer harus menggunakan logs.
  • Clean code menerapkan comment atau instruction pada setiap baris line.
  • Bahasa untuk penamaan Function, Variable & Comment wajib menggunakan Bahasa Inggris.
  • Struct / Object dibuat terpisah antara object table & object request response. Untuk object request response harus menggunakan akhiran (NamaFunctionRequest / NamaFunctionResponse).
  • Endpoint harus menerapkan sebagai berikut
    • /api/v1/example -> Digunakan untuk method (POST & PUT)
    • /api/v1/examples -> Digunakan untuk method (GET) listing, request payload on header
    • /api/v1/example/:id -> Digunakan untuk method (GET & DELETE)
    • /api/v1/example?car=toyota&type=yaris -> Digunakan untuk method (GET), ketentuan berlaku

Pemrograman Modular

Service ini masih menggunakan metode monolith, tetapi menggunakan teknik modular. Agar setiap modul dapat di pisahkan dan kedepannya dapat di pecah menjadi beberapa microservices. Setiap modul hanya dapat mengkonsumsi tablenya sendiri. Dilarang keras untuk melakukan join cross modul. Pemrograman Modular di pisahkan menjadi beberapa modul, yaitu :

  • Modul Security Security memiliki beberapa table antara lain :
    1. mst_user
    2. mst_user_status
    3. mst_group
    4. trx_register_user
    5. mst_register_user_status
    6. mst_service
    7. mst_api
    8. mst_group_access_api
    9. mst_device
    10. mst_module
    11. mst_group_access_module
    12. mst_forgot_password
    13. mst_forgot_password_status

Unit Test

Setiap proses yang ada di entity wajib dibuatkan Unit Test (Integration Test) agar memudahkan dalam proses pengembangan.

Owner
Muhammad Rivaldy
Backend Developer
Muhammad Rivaldy
Rpcx-framework - An RPC microservices framework based on rpcx, simple and easy to use, ultra fast and efficient, powerful, service discovery, service governance, service layering, version control, routing label registration.

RPCX Framework An RPC microservices framework based on rpcx. Features: simple and easy to use, ultra fast and efficient, powerful, service discovery,

ZYallers 1 Jan 5, 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.

Michael Stack 91 Jul 31, 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

Mario Carrion 491 Aug 7, 2022
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

null 303 May 30, 2021
Demo Fully Isolated System Architecture

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

Muhamad Surya Iksanudin 28 Jul 9, 2022
Hexagonal Architecture implemented in GO

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

Vincent Villaluna 38 Jul 26, 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 ├──

Ali Baran Eser 7 Feb 26, 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

Nurali Virani 0 Nov 10, 2021
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

Rudraksh Pareek 3 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

João Paulo Vanzuita 8 Jan 8, 2022
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

null 0 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

null 6 Jul 17, 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.

Gabriel Goh 1 Jan 26, 2022
Microservice - A sample architecture of a microservice in go

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

null 0 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

Matheus Araujo 1 Jan 22, 2022
Collection of personal Dapr demos (bindings, state, pub/sub, service-to-service invocation)

Dapr demos Collection of personal Dapr demos. Note, some of these demos require latest version of Dapr, Ingress gateway, Observability components, or

Mark Chmarny 152 Jul 27, 2022
Go Micro is a framework for distributed systems development

Go Micro Go Micro is a framework for distributed systems development. Overview Go Micro provides the core requirements for distributed systems develop

Asim Aslam 18.8k Aug 6, 2022
Micro is a platform for cloud native development

Micro Overview Micro addresses the key requirements for building services in the cloud. It leverages the microservices architecture pattern and provid

Micro 11.2k Aug 8, 2022
a microservice framework for rapid development of micro services in Go with rich eco-system

中文版README Go-Chassis is a microservice framework for rapid development of microservices in Go. it focus on helping developer to deliver cloud native a

null 2.5k Aug 1, 2022