Skip to content

Repository files navigation

eventhos-api

What is eventhos?

Eventhos is an open source platform that applies event-driven architecture principles to allow the user to orchestrate their system integrations using a simple user interface instead of complicated publisher and subscriber source codes in applications. You only need webhooks and rest APIs to integrate all your systems.

Full details in the wiki

How it works?

Basically you have to identify the producers (webhooks) and consumers (apis). Then using th UI you can make a contract between the incoming event produced by a webhook (source system) to the rest api in in the target system. So with this you will have a real time integration between the producer and consumer systems without the complexity of kafka or similars.

image

Here a sample of contract between producers and consumers

create-contract-2024-04-05_17.50.51.mp4

More uses cases and deep explanation here and here

Features

  • Register all systems (producers and consumers)
  • Create contracts between your systems
  • Oauth2 Security
  • Manual retry on error
  • Event Dashboard to see the received events and all the details (request/response)
  • Reply-To option
  • Json binding to match between the webhook json and target api json
  • Vanilla javascript to binding to match between the webhook json and target api json
  • Mail on error with the details
  • User Management

More details here

Dependencies

Here a minimalist High Level Diagram

To know more about each dependency check their git repositories.

Demo

In this repository you will find the code of the web artifact called eventhos-api. You will need the api to get all the eventhos platform ready to use or develop

To build and start this platform you need knowledge about nodejs and mysql. To get your own version in less than 3 minutes, follow this guide:

If you don't have errors, you will be able to perform a get request to http://localhost:2109. You should see ok as response.

Technologies

  • Nodejs
  • Knex
  • Mysql

Requirements

  • nodejs >= 16
  • mysql >= 5.5 (user with all privileges)

Environment variables

Following the third commandment we use environment variables to handle the configurations

VariableDescriptionSample Value
CPU_COUNTHow many cpu cores use1
CRYPTO_KEYThe secret key to encryptsecret_key
DATA_BASE_ACQUIRE_CONNECTION_TIMEOUTThe timeout to acquire a connection using knex10000
DATA_BASE_HOSTThe eventhos platform database hostlocalhost
DATA_BASE_NAMEThe eventhos platform database nameeventhos
DATA_BASE_PASSWORDThe eventhos platform database passwordabcdefg
DATA_BASE_POOL_MAXThe maximum knex connection pool300
DATA_BASE_POOL_MINThe minimum knex connection pool100
DATA_BASE_PORTThe eventhos platform database port3306
DATA_BASE_TIMEZONERequired to sync the datetime in mysql2 nodejs library+00:00
DATA_BASE_USERThe eventhos platform database userusr_eventhos
ENVIRONMENT_ALIASUsed in the subject on email error report, example: dev,prod,et.Test
HTTP_BODY_SIZE_LIMITSupported size of the json that interacts with the app50mb
JWT_SECRETThe secret for the JWTsecret
LOG_FILE_PATHUse a file for the logsfalse
LOG_LEVELSet the logger leveldebug
PORTThe application port2109
RAW_SENSIBLE_PARAMSWord to be obfuscated in mails and uicredit_card, address
SMTP_CREDENTIAL_PASSWORDPassword of your mail serverchangeme
SMTP_CREDENTIAL_USERUser of your mail servernoreply@acme.com
SMTP_DEFAULT_RECIPIENTDefault recipients if there aren't recipients in a contract or if there are error before event's sendjane@acme.com
SMTP_ENABLE_SSLEncrypt.
If your host is for gmail, your value should be true.
If your host is for office 365, your value should be false
true
SMTP_FROM_ALIASShould be able equal to the value of SMTP_CREDENTIAL_USERnoreply@acme.com or custom if your smtp allow it
SMTP_HOSTSender identifiersmtp.gmail.com
SMTP_PORTCommunication endpoint that defines the routing of email transactions587
SMTP_TLS_CIPHERSAre algorithms that help secure network connections that use Transport Layer SecuritySSLv3
TZOs timezoneAmerica/Lima

To use these variables in your developer workspace, check this

Security

Authentication and authorization are based on a custom oauth2 implementation oauth2-starter library.

This library will create a credentials.txt file with the admin credentiaLS in the /tmp folder.

📢 Change it after the first login

Automated start

Just run docker-compose up -d

Manual start (developers)

Export the required env variables or create a .env

npminstallnpmrundev

By default the app runs in the 2109 port.

Manual start (production)

Export the required env variables or create a .env

npminstallnpmrunbuildnpmrunstart

By default the app runs in the 2109 port.

Also you can use docker following this guide

Usage

For correct easy operation, the ui is required.

Once the application is running you can either use the eventhos UI (recommended) or use the rest endpoints whic are documented here in the section Endpoints

Developed libraries

Keeping in mind that software should be reused, we have developed the following libraries to build eventhos-api

nameurlbranchdescription
advanced-settingshttps://github.com/nodeboot/advanced-settingsmainuse env variables in the json settings
nodeboot-oauth2-starterhttps://github.com/usil/nodeboot-oauth2-starter#fix-validator-middleware1.0.1oauth2 autonconfigure database and endpoints

Integration tests

If you startup the local demo you can run the integration and e2e tests.

We use docker, selenium and a mock api to test almost all the ui forms and rest api endpoints. Check this for more details:

How to Contribute

Check this https://github.com/usil/eventhos-api/wiki/Contributions

License

MIT

Contributors


Luis Huertas

JRichardsz

Diego Ramos

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages