Giter Site home page Giter Site logo

hexagonal-architecture-sample-jokes's Introduction

Hexagonal architecture sample

This is a sample application, for educational purposes in order to experiment and better understand the hexagonal architecture.

The hexagonal architecture is based on three principles and techniques:

  • Explicitly separate User-Side, Business Logic, and Server-Side
  • Dependencies are going from User-Side and Server-Side to the Business Logic
  • We isolate the boundaries by using Ports and Adapters hexagonal-architecture-design

Jokes app

Based on the architecture presented above, I tried to separate the project in 4 Maven modules:

  1. service - the main module, which holds all the business rules, and is the cleanest module. It has few dependencies (Lombok, JUnit, Mockito, Assertj), mainly tried not to clutter it with too many dependencies.
  2. console-ui - module responsible for being the user-side, which will start the interaction with the rest of the application modules.
  3. repository - module responsible for supplying data for the service module, which is responsible for the communication of the service layer with the database.
  4. context-launcher - module responsible for actually running the application. It gathers all the modules between them.

Running the project

Simply clone the project, and import it as a Maven project in your favorite IDE (mine was Intelijj IDEA). Should be able to run the project as is.

Or you can do it without the IDE, running the usual mvn clean install in order to compile, run unit tests & build the project in the parent module. Then into the context-launcher folder and run the command mvn spring-boot:run in order to run the app.

hexagonal-architecture-sample-jokes's People

Contributors

abezu195 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.