{"id":20195840,"url":"https://github.com/ralphv/gallifrey-rules-sample","last_synced_at":"2026-06-23T17:31:43.515Z","repository":{"id":252335770,"uuid":"840132348","full_name":"ralphv/gallifrey-rules-sample","owner":"ralphv","description":"A minimal sample application utilizing gallifrey-rules","archived":false,"fork":false,"pushed_at":"2024-08-19T21:03:06.000Z","size":57,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-10T17:08:13.706Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ralphv.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-08-09T03:29:07.000Z","updated_at":"2024-08-19T21:03:09.000Z","dependencies_parsed_at":"2024-11-14T04:20:22.994Z","dependency_job_id":"1db03e1a-678e-40e3-8c16-59eaea5c62d7","html_url":"https://github.com/ralphv/gallifrey-rules-sample","commit_stats":null,"previous_names":["ralphv/gallifrey-rules-sample"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ralphv/gallifrey-rules-sample","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ralphv%2Fgallifrey-rules-sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ralphv%2Fgallifrey-rules-sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ralphv%2Fgallifrey-rules-sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ralphv%2Fgallifrey-rules-sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ralphv","download_url":"https://codeload.github.com/ralphv/gallifrey-rules-sample/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ralphv%2Fgallifrey-rules-sample/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34700904,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-23T02:00:07.161Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-14T04:19:22.540Z","updated_at":"2026-06-23T17:31:43.498Z","avatar_url":"https://github.com/ralphv.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://gallifre-rules.dev\"\u003e\n      \u003cimg src=\"https://raw.githubusercontent.com/ralphv/gallifrey-rules/main/docs/resources/gallifrey-rules-25.png\" alt=\"Logo\" width=\"150\" height=\"150\"\u003e\n    \u003c/a\u003e\n    \u003ch3 align=\"center\"\u003eGallifrey Rules Sample\u003c/h3\u003e\n    \u003cp align=\"center\"\u003e\n        A modern robust framework for handling real-time events \n    \u003c/p\u003e\n\u003c/p\u003e\n\n## What is it\n\nGallifrey Rules Sample is a sample application using the library [gallifrey-rules](https://github.com/ralphv/gallifrey-rules)\n\nThis sample application use case does the following:\n\n1. Listen to a kafka topic called `new-orders`\n2. Translate the message into a gallifrey-rules event using the event dispatcher [new-order-dispatcher](https://github.com/ralphv/gallifrey-rules-sample/blob/main/src/modules/providers/NewOrdersDispatcher.ts)\n3. Runs the **rule** [notify-customer-new-order-rule](https://github.com/ralphv/gallifrey-rules-sample/blob/main/src/modules/plugins/rules/NotifyCustomerNewOrderRule.ts)\n4. The **rule** will call the **data object** [customer-info-data-object](https://github.com/ralphv/gallifrey-rules-sample/blob/main/src/modules/plugins/data-objects/CustomerInfoDataObject.ts) to get customer info, prepare an email \nand then use the **action** [send-email-action](https://github.com/ralphv/gallifrey-rules-sample/blob/main/src/modules/plugins/actions/SendEmailAction.ts) to email the customer that his new order was received.\n\n### Getting started\n\nThis will install modules, build and start off the application locally.\n```shell\nnpm start\n```\n`Note: this will fail because of missing environment variables and this is expected`\n\nTo build your application docker image `gallifrey-rules-sample`\n### Building docker image\n```shell\nnpm run docker-build\n```\n\nTo start your docker image\n```shell\ndocker run --rm -it gallifrey-rules-sample\n```\n\n### Test it all together\n```shell\ndocker compose up -d \n```\n\nThis will start a kafka server and your application image, once running, you can call\n```shell\nnpm run produce-message\n```\nTo send a message into the kafka topic. \nThe sample application should consume it nicely, check the logs using\n```shell\ndocker logs gallifrey-rules-sample -f\n```\nYou should be able to see in the logs at least\n\n```\nEmail sent to: \"Doctor Who\" \u003cdoctor@gallifrey-rules.dev\u003e\n----------------------------------------------------------\n\nHello Doctor Who\n\nThank you so much for your recent order ID: 13\n\nYour order contains the following items:\n\nName: Children of Earth, Qty: 1, Price: 12.43\nName: Type 40 TT Capsule, Qty: 500, Price: 26\n\nHave a great day!\n\n----------------------------------------------------------\n```\n\nYou can also open [http://localhost:8080](http://localhost:8080) to open kafka ui and produce messages directly from there.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fralphv%2Fgallifrey-rules-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fralphv%2Fgallifrey-rules-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fralphv%2Fgallifrey-rules-sample/lists"}