{"id":30091832,"url":"https://github.com/minhajul/nodejs-kafka","last_synced_at":"2026-05-05T11:32:22.925Z","repository":{"id":301937961,"uuid":"1006386997","full_name":"minhajul/nodejs-kafka","owner":"minhajul","description":"This project demonstrates a basic Node.js application integrating with Apache Kafka using Docker.","archived":false,"fork":false,"pushed_at":"2025-06-29T17:06:50.000Z","size":68,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-29T18:21:02.285Z","etag":null,"topics":["docker-compose","kafka","nodejs"],"latest_commit_sha":null,"homepage":"","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/minhajul.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,"zenodo":null}},"created_at":"2025-06-22T06:34:48.000Z","updated_at":"2025-06-29T17:06:53.000Z","dependencies_parsed_at":"2025-06-29T18:21:06.386Z","dependency_job_id":"ee12ad4b-6a05-4159-b395-dc4ad294655b","html_url":"https://github.com/minhajul/nodejs-kafka","commit_stats":null,"previous_names":["minhajul/nodejs-kafka"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/minhajul/nodejs-kafka","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minhajul%2Fnodejs-kafka","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minhajul%2Fnodejs-kafka/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minhajul%2Fnodejs-kafka/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minhajul%2Fnodejs-kafka/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/minhajul","download_url":"https://codeload.github.com/minhajul/nodejs-kafka/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minhajul%2Fnodejs-kafka/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269548440,"owners_count":24436106,"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","status":"online","status_checked_at":"2025-08-09T02:00:10.424Z","response_time":111,"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":["docker-compose","kafka","nodejs"],"created_at":"2025-08-09T07:46:16.958Z","updated_at":"2026-05-05T11:32:17.901Z","avatar_url":"https://github.com/minhajul.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kafka Node.js App with Docker\n\nThis project demonstrates a basic Node.js application integrating with Apache Kafka using Docker.\n\n## Prerequisites\n\n- Docker and Docker Compose\n- Node.js and npm\n\n## Setup and Run\n\n1.  **Clone the repository:**\n\n```bash\ngit clone https://github.com/minhajul/nodejs-kafka\ncd nodejs-kafka\n```\n\n2.  **Start Kafka, Zookeeper and Kafka UI using Docker Compose:**\n\nTo spin up the required Kafka infrastructure using Docker Compose, run:\n```bash\ndocker-compose up -d\n```\n\nThis command will start the following services in detached mode:\n- **Zookeeper** – Coordinates and manages Kafka brokers\n- **Kafka** – The distributed event streaming platform\n- **Kafka UI** – A web-based user interface to inspect topics, messages, and consumers\n\nYou can access Kafka UI at: http://localhost:3000 (or your configured port)\n\n3.  **Install Node.js dependencies:**\n\n```bash\nnpm install\n```\n\n4.  **Run the server:**\n\n```bash\nnpm run dev\n```\n\nThis will launch the Express application and expose two API routes for producing events to Kafka topics:\n\n| Endpoint                  | Description              | Kafka Topic     |\n|---------------------------| ------------------------ | --------------- |\n| `GET /api/create-order`   | Produces an order event  | `order-topic`   |\n| `GET /api/create-payment` | Produces a payment event | `payment-topic` |\n\nEach endpoint sends a structured message to its corresponding Kafka topic using KafkaJS.\n\n5.  **Run the Kafka consumer (in a separate terminal):**\n\n```bash\nnpm run start:consumers\n```\n\nThis will start consuming order and payment from the `order-topic` and `payment-topic` and log them to the console.\n\n### Made with ❤️ by [[minhajul](https://github.com/minhajul)]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminhajul%2Fnodejs-kafka","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fminhajul%2Fnodejs-kafka","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminhajul%2Fnodejs-kafka/lists"}