GithubHelp home page GithubHelp logo

ftgo-services's Introduction

ftgo-services

This repository contains three microservices which were implemented within the scope of my master thesis. The purpose is to show the decomposition of a monolithic system into microservices using architecture patterns.

Architecture

Package Architecture

As shown in the graphic above, this repository consists of 3 services:

  • ftgo-gateway-service: An API-Gateway which forwards HTTP Requests to the other two services.
  • ftgo-consumer-service: A microservice which handles consumer related business functionality.
  • ftgo-courier-service: A microservice which handles courier related business functionality.

Both, ftgo-consumer-service and ftgo-courier-service are implemented with the hexagonal architecture approach. Each service consists of the following sub-modules:

  • ftgo-<service-name>-common
  • ftgo-<service-name>-inbound
  • ftgo-<service-name>-inbound-api
  • ftgo-<service-name>-logic
  • ftgo-<service-name>-logic-api
  • ftgo-<service-name>-outbound
  • ftgo-<service-name>-starter

The entry point of each service (@SpringBootApplication-Annotation) is located in the ftgo-service-name-starter module. The business logic is located in ftgo-service-name-logic. The main idea of the hexagonal architecture is to separate the business logic from inbound functionality like http or grpc requests and outbound functionality like database connections or requests to other services). The business logic exposes both, one inbound interface (port) for inbound adapters and one outbound interface (port) for outbound adapters. Modules with an -api suffix own contracts (domain classes like Consumer in ftgo-consumer-logic-api or ConsumerDto in ftgo-consumer-inbound-api) for the corresponding abstraction layer.

In contrast to the traditional layered architecture, the logic modules are completely independent. They do not dependend on inbound or outbound "stuff". Allowed dependencies between modules:

  • ftgo-<service-name>-starter
    • ftgo-<service-name>-inbound
      • ftgo-<service-name>-inbound-api
      • ftgo-<service-name>-logic-api
      • ftgo-<service-name>-logic
      • ftgo-<service-name>-common
    • ftgo-<service-name>-logic
      • ftgo-<service-name>-logic-api
      • ftgo-<service-name>-common
    • ftgo-<service-name>-outbound
      • ftgo-<service-name>-logic
      • ftgo-<service-name>-logic-api
      • ftgo-<service-name>-common

Consumer Service Example: That way a new inbound adapter can easily be added by implementing the logic inbound interface. In the same way a new outbound adapter (eg. replace the current db) can be added by implementing the logic outbound interface.

Hexagonal architecture readings:

Deployment

  1. Database (for development): docker-compose
  2. Services + Databases (check comments in file): docker-compose

ftgo-services's People

Contributors

michael-neuhold avatar

Watchers

 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.