Hexa-go

Based on the Hexagonal architecture which:

aims at creating loosely coupled application components that can be easily connected to their software environment by means of ports and adapters. This makes components exchangeable at any level and facilitates test automation

The goal of this repository is to provide a blueprint to quickly implement and deploy business logic that can be consumed as a webhook and/or asynchronous job with AuthN/AuthZ, centralised logging and monitoring features.

Just implement the call function in hexagon.rb and you're good to go 🙂 Use one of the "pre-configured" providers and :shipit:!

The core of the hexagon is the function that implements the business logic. Such function interacts with the external world by means of adapters and clients. With reference to the picture below:

  • adapters
    • webhook: makes the function invokable from external systems via HTTP
    • worker: makes the function queueable by an external system such
    • security: provides AuthN/AuthZ functionalities (Auth0) as Sidekiq
  • clients
    • http: used to invoke downstreams via HTTP
    • Kafka: used to read/write from/to Kafka stream
    • logs: used to push logs to a centralised system such as Splunk
    • monitoring: used to ping the system (e.g. Pingdom) and/or to publish event to a centralised system such as Honeybadger
    • others as required

Hexagon

Adapters

  • [WIP] Security: provides machine-to-machine AuthN/AuthZ functionalities
  • Webhook: makes the function invokable by an upstream but also monitorable (e.g. Pingdom) through an healthcheck endpoint
  • [WIP] Worker: makes the function enqueuable

Clients

  • [WIP] HTTP: used to post payloads to downstreams
  • [WIP] Kafka: reads/write to/from Kafka
  • [WIP] Logs: push logs to a centralised system such as Splunk
  • Monitoring: push messages to a monitoring system (e.g. Honeybadger)

Deployment

  • Heroku: webhooks and/or workers, any language
  • Render: webhooks and/or workers, any language
  • [WIP] Netlify: webhooks only, JavaScript and Go only

Use cases