{"id":20485309,"url":"https://github.com/runnable/reactive-demo","last_synced_at":"2025-08-08T18:51:54.384Z","repository":{"id":70965094,"uuid":"80587387","full_name":"Runnable/reactive-demo","owner":"Runnable","description":"demo for reactive systems meetup","archived":false,"fork":false,"pushed_at":"2019-11-02T23:09:13.000Z","size":22,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-01-16T04:31:04.758Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/Runnable.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2017-02-01T03:49:16.000Z","updated_at":"2019-06-14T13:49:07.000Z","dependencies_parsed_at":"2023-05-12T06:15:52.745Z","dependency_job_id":null,"html_url":"https://github.com/Runnable/reactive-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Runnable%2Freactive-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Runnable%2Freactive-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Runnable%2Freactive-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Runnable%2Freactive-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Runnable","download_url":"https://codeload.github.com/Runnable/reactive-demo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242059083,"owners_count":20065221,"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":[],"created_at":"2024-11-15T16:29:21.743Z","updated_at":"2025-03-05T16:23:40.095Z","avatar_url":"https://github.com/Runnable.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Reactive Demo\n=============\n\nThis repo contains a demo stack for a reactive architecture.\n\n# Architecture\n\n## Services\n\n### `./frontend`\n\n#### Description\nThe front-end is responsible for serving the main web page.\nIt creates a websocket connection back to itself to pass messages.\nWhen a user comments, it is emitted over the websocket connection to the app.\nThis app takes this and publishes the `comment.received` event to the #MessageBus\nThis app listens for `comments.updated` events and upon receiving one, published a message on the socket so the web page can update itself.\n\n#### Environment Variables\n* `PORT` set this to the port you want the service to serve from\n* `RABBITMQ_HOSTNAME` the host address of your rabbitmq service\n\n#### Running\n```\nPORT=80 npm start\n```\n\n### `./parser`\n\n#### Description\nThe parser is a service which \"normalizes\" comments.\nThis app listens for `comment.received` events and upon receiving one it truncates the message to 100 characters and publishes the event `comment.normalized` with the truncated data.\nIf the comment has the word `hate` in it, it publishes the event `comment.normalize-error`.\n\n#### Environment Variables\n* `RABBITMQ_HOSTNAME` the host address of your rabbitmq service\n\n#### Running\n```\nnpm start\n```\n\n### `./db`\n\n#### Description\nThe db is a service which saves comments.\nThis app listens for `comment.normalized` events and upon receiving one it saves the message into the database (currently redis)\nAfter saving it publishes `comments.updated` event with all the comments in the database\nIt also listens for `user.connected` events and upon receiving one it publishes `comments.updated` event with all the comments in the database\n\n#### Environment Variables\n* `RABBITMQ_HOSTNAME` the host address of your rabbitmq service\n* `REDIS_HOST` the host address of your redis service\n\n#### Running\n```\nnpm start\n```\n\n### `./emailer`\n\n#### Description\nThe emailer is a service which sends emails.\nThis app listens for `comment.received` events and upon receiving one it it sends an email to the address defined by `EMAIL_ADDR`\n\n#### Environment Variables\n* `RABBITMQ_HOSTNAME` the host address of your rabbitmq service\n* `EMAIL_ADDR` the email address to send emails to\n\n#### Running\n```\nnpm start\n```\n\n## Message bus\nThe message bus is RabbitMQ\n\n## Data Store\nThe datastore is Redis\n\n# Deploying\n\n## Compose\nThere are 3 compose files.\n\n* `docker-compose.yml` - Use to launch the entire application\n* `docker-compose-local.yml` - Use to launch everything but front-end and rabbit\n* `docker-compose-remote.yml` - Use to launch front-end and rabbit.\n\nI split local and remote because `remote` should be launched on a server which everyone should have access to and `local` for services that do not need access.\n\n## Kubernetes\nThe configuration files for Kubernetes live in `./deployments`\nThe files at the root of `deployments` are deploy files and the files in the `deployments/services` define all the k8 services.\n\n## Docker\nEvery service has a `Dockerfile` at the root. Simply run `docker build .` to build docker images.\nThese docker images are also build on docker hub with the following format:\n\n* runnable/reactive-demo:frontend\n* runnable/reactive-demo:parser\n* runnable/reactive-demo:db\n* runnable/reactive-demo:emailer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frunnable%2Freactive-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frunnable%2Freactive-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frunnable%2Freactive-demo/lists"}