{"id":21639724,"url":"https://github.com/dasmeta/event-manager-backend","last_synced_at":"2025-07-17T14:33:01.086Z","repository":{"id":43682033,"uuid":"444006444","full_name":"dasmeta/event-manager-backend","owner":"dasmeta","description":"Node.js backend that handles event store, monitoring and retries","archived":false,"fork":false,"pushed_at":"2025-04-29T08:19:27.000Z","size":1254,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-30T03:40:43.270Z","etag":null,"topics":["event-driven","event-store","fission","google-pubsub","kafka","mongodb"],"latest_commit_sha":null,"homepage":"https://www.dasmeta.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dasmeta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-01-03T09:32:14.000Z","updated_at":"2025-04-29T08:18:39.000Z","dependencies_parsed_at":"2025-05-23T03:34:24.225Z","dependency_job_id":"6902c54e-94cf-4a1d-b1c3-fed45cafb3ee","html_url":"https://github.com/dasmeta/event-manager-backend","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/dasmeta/event-manager-backend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dasmeta%2Fevent-manager-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dasmeta%2Fevent-manager-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dasmeta%2Fevent-manager-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dasmeta%2Fevent-manager-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dasmeta","download_url":"https://codeload.github.com/dasmeta/event-manager-backend/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dasmeta%2Fevent-manager-backend/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265616919,"owners_count":23798924,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["event-driven","event-store","fission","google-pubsub","kafka","mongodb"],"created_at":"2024-11-25T04:14:52.712Z","updated_at":"2025-07-17T14:33:00.584Z","avatar_url":"https://github.com/dasmeta.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Event Manager Backend (event-manager-backend)\nWelcome to Event Manager Backend (event-manager-backend)\n\n## Table of contents\n * [Introduction](#introduction)\n * [Requirements](#requirements)\n * [Installation](#installation)\n * [Configuration](#configuration)\n * [Troubleshooting \u0026 FAQ](#troubleshooting-faq)\n\n## Introduction\nThe service is based on Strapi JS framework.\n\n## Requirements\n- CPU cores \u003e= 1\n- RAM \u003e= 256MB\n- [Git 2.*](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)\n- [Docker 20.*](https://docs.docker.com/engine/install/)\n  \n## Installation\n- Set up git to have ssh access to the repository\n- Clone the source into local machine\n```shell\n$ git clone git@github.com:dasmeta/event-manager-backend.git\n```\n- Go to the project source `$ cd event-manager-backend`\n- Run make with prefered configuration to start development environment.\n- Run docker build to create a production ready image and install project dependencies.\n```shell\n$ docker build -t event-manager-backend:latest .\n```\n\n## Configuration\n- Create an environment file `.env` and defined variables\n```text\n# Web Server\nHOST=0.0.0.0\nPORT=1337\nSERVE_ADMIN_PANEL=\n\n# Database\n\n# mongo\nDATABASE_CLIENT=mongo\nDATABASE_URL=mongodb://strapi:strapi@mongo/strapi?authSource=admin\n// or\nDATABASE_HOST=strapi\nDATABASE_USERNAME=strapi\nDATABASE_PASSWORD=strapi\nDATABASE_NAME=strapi\nAUTHENTICATION_DATABASE=admin\n\n# postgres\nDATABASE_CLIENT=postgres\nDATABASE_HOST=postgres\nDATABASE_USERNAME=strapi\nDATABASE_PASSWORD=strapi\nDATABASE_NAME=strapi\n\n# JWT settings to validate token\nJWT_SECRET=\nJWT_ALGORITHM=\"HS256\"\n\n# Centralized Authentication\nAUTHENTICATION_SERVICE_API_HOST=\nAUTHENTICATION_IS_LIVE_MODE=\n\n# For aws lambda with sns trigger\nMQ_CLIENT_NAME=SNS\nAWS_REGION=\nAWS_ACCESS_KEY_ID=\nAWS_SECRET_ACCESS_KEY=\n```\n- Create and start a container ready to handle connections\n```shell\n$ make up-with-mongo \n$ make up-with-postgres\n```\n- The service will be accessible on http://0.0.0.0:8037\n\n### If data retention following env variables should be defined\n```\nENABLE_CRON=true\nDATA_RETENTION_DAYS=40 // event that are created more than 40 days ago will be remove, but only those which have 100% success\nDATA_CLEANUP_HOUR=04 // time in a day on which cleanup job will be executed, in UTC and 24 hour format \n```\n\n## Troubleshooting \u0026 FAQ\n- View service logs\n```shell\n$ docker logs -f --since 2m em-backend\n```\n- Run tests\n```shell\n$ docker exec em-backend bash -c \"yarn test\"\n```\n\n# pubSub\n\nExtended event publishing PubSub/Kafka package.\n\n`yarn add @dasmeta/event-manager-node-api`\n\n### start local pub/sub\n\n`$ gcloud beta emulators pubsub start`\n`$ DATASTORE_EMULATOR_HOST=localhost:8432 DATASTORE_PROJECT_ID=YOUR_GCLOUD_PROJECT_ID gcloud beta emulators datastore start`\n\n\n\n#### example1.js\n```\nconst { registerSubscriber, publish } = require(\"@dasmeta/event-manager-node-api\");\n\nasync function test1(data) {\n    console.log(\"test1\", data);\n}\n\nasync function test2(data) {\n    console.log(\"test2\", data);\n}\n\nasync function test3(data) {\n    console.log(\"test3\", data);\n}\n\nregisterSubscriber(\"dev.test\", \"dev-test_test1\", test1);\nregisterSubscriber(\"dev.test\", \"dev-test_test2\", test2);\nregisterSubscriber(\"dev.test.other\", \"dev-test_test3\", test3);\n\nsetInterval(async () =\u003e {\n    await publish(\"dev.test\", { key: Date.now() });\n}, 300);\n\nsetInterval(async () =\u003e {\n    await publish(\"dev.test.other\", { key2: Date.now() });\n}, 500);\n\n```\n\n`PUBSUB_EMULATOR_HOST=\"localhost:8085\" PUBSUB_PROJECT_ID=\"YOUR_GCLOUD_PROJECT_ID\" GCLOUD_PROJECT=\"YOUR_GCLOUD_PROJECT_ID\" node example1.js`\n\n#### example2.js\n```\nconst { publish, subscribeMulti } = require(\"@dasmeta/event-manager-node-api\");\n\n\nfunction subscribe1() {\n    subscribeMulti(\"test\", [\"dev.test\", \"dev.test.other\"], async (topic, data) =\u003e {\n        console.log('\\x1b[31m%s %s\\x1b[0m', \" 1 \", topic, data);\n    });\n}\n\nfunction subscribe2() {\n    // resubscribe\n    subscribeMulti(\"test\", [\"dev.test\"], async (topic, data) =\u003e {\n        console.log('\\x1b[32m%s %s\\x1b[0m', \" 2 \", topic, data);\n    });\n\n    subscribeMulti(\"test3\", [\"dev.test\", \"dev.test.other\"], async (topic, data) =\u003e {\n        console.log('\\x1b[33m%s %s\\x1b[0m', \" 3 \", topic, data);\n    });\n}\n\n\nsetInterval(async () =\u003e {\n    await publish(\"dev.test\", { key: Date.now() });\n}, 200);\n\nsetInterval(async () =\u003e {\n    await publish(\"dev.test.other\", { key2: Date.now() });\n}, 300);\n\nsubscribe1();\n\nsetTimeout(async () =\u003e {\n    subscribe2();\n}, 20 * 1000);\n\n```\n\n`PUBSUB_EMULATOR_HOST=\"localhost:8085\" PUBSUB_PROJECT_ID=\"YOUR_GCLOUD_PROJECT_ID\" GCLOUD_PROJECT=\"YOUR_GCLOUD_PROJECT_ID\" node example2.js`\n\n#### example3.js\n```\nimport { autoStart as AutoStart, subscribe as on, publish } from \"@dasmeta/event-manager-node-api\";\n\n@AutoStart\nclass Example {\n    @on(\"dev.test\")\n    async test1(data) {\n        console.log(\"test1\", data);\n    }\n\n    @on(\"dev.test\")\n    async test2(data) {\n        console.log(\"test2\", data);\n    }\n\n    @on(\"dev.test.other\")\n    async test3(data) {\n        console.log(\"test3\", data);\n    }\n}\n\nsetInterval(async () =\u003e {\n    await publish(\"dev.test\", { key: Date.now() });\n}, 300);\n\nsetInterval(async () =\u003e {\n    await publish(\"dev.test.other\", { key2: Date.now() });\n}, 500);\n\n```\n\n`PUBSUB_EMULATOR_HOST=\"localhost:8085\" PUBSUB_PROJECT_ID=\"YOUR_GCLOUD_PROJECT_ID\" GCLOUD_PROJECT=\"YOUR_GCLOUD_PROJECT_ID\" node example3.js`\n\n#### Kafka : run all examples with env variables\n`MQ_CLIENT_NAME='Kafka' KAFKA_BROKERS='127.0.0.1:29092'`\n\n#### PubSub : run all examples with env variables\n`PUBSUB_EMULATOR_HOST=\"localhost:8085\" PUBSUB_PROJECT_ID=\"YOUR_GCLOUD_PROJECT_ID\" GCLOUD_PROJECT=\"YOUR_GCLOUD_PROJECT_ID\"`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdasmeta%2Fevent-manager-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdasmeta%2Fevent-manager-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdasmeta%2Fevent-manager-backend/lists"}