{"id":17076909,"url":"https://github.com/codeterrayt/streamguard","last_synced_at":"2026-02-27T00:01:21.581Z","repository":{"id":256986092,"uuid":"857011184","full_name":"codeterrayt/StreamGuard","owner":"codeterrayt","description":"StreamGuard is a high-performance data management script using Kafka and MongoDB to efficiently handle and process real-time data streams. Ideal for scenarios like live GPS tracking, it features real-time data processing, reduced database load, and bulk data insertion.","archived":false,"fork":false,"pushed_at":"2024-09-14T10:11:06.000Z","size":25,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-23T12:15:23.047Z","etag":null,"topics":["api-integration","bulk-insert-query-optimization","data-management","data-streaming","event-driven-architecture","high-velocity-data","kafka","microservices","mongodb","nodejs","nodejs-kafkajs","performance-optimization","real-time-data-processing","scalability","system-design","system-design-project","zookeeper"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codeterrayt.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":"2024-09-13T16:23:53.000Z","updated_at":"2024-12-26T18:43:37.000Z","dependencies_parsed_at":"2024-09-14T07:36:19.703Z","dependency_job_id":null,"html_url":"https://github.com/codeterrayt/StreamGuard","commit_stats":null,"previous_names":["codeterrayt/streamguard"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeterrayt%2FStreamGuard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeterrayt%2FStreamGuard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeterrayt%2FStreamGuard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeterrayt%2FStreamGuard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codeterrayt","download_url":"https://codeload.github.com/codeterrayt/StreamGuard/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245097835,"owners_count":20560319,"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":["api-integration","bulk-insert-query-optimization","data-management","data-streaming","event-driven-architecture","high-velocity-data","kafka","microservices","mongodb","nodejs","nodejs-kafkajs","performance-optimization","real-time-data-processing","scalability","system-design","system-design-project","zookeeper"],"created_at":"2024-10-14T12:10:26.758Z","updated_at":"2025-10-03T22:36:41.795Z","avatar_url":"https://github.com/codeterrayt.png","language":"JavaScript","readme":"# StreamGuard\n\n**StreamGuard** is a powerful data management NodeJS Application designed to efficiently handle high-velocity data streams and reduce the load on MongoDB. It leverages Kafka to streamline the processing of real-time data, making it ideal for scenarios such as live GPS tracking and other applications requiring rapid data handling.\n\n## Features\n\n- **Real-Time Data Processing**: Handles fast-moving data streams efficiently.\n- **Reduced MongoDB Overload**: Uses Kafka to alleviate pressure on MongoDB.\n- **Bulk Insertion**: Performs bulk data operations to optimize performance.\n\n## Installation\n\nClone the repository and install the dependencies:\n\n```bash\ngit clone https://github.com/codeterrayt/StreamGuard.git\ncd StreamGuard\nnpm install\n```\n\n## Running the Application\n\n1. **Start the Required Services**:\n\n   - MongoDB:\n     ```bash\n     docker run -p 27017:27017 mongo\n     ```\n   - Zookeeper:\n     ```bash\n     docker run -p 2181:2181 zookeeper\n     ```\n   - Kafka:\n     ```bash\n     docker run -p 9092:9092 -e KAFKA_ZOOKEEPER_CONNECT=\u003cIPv4-Address\u003e:2181 -e KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://\u003cIPv4-Address\u003e:9092 -e KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1 confluentinc/cp-kafka\n     ```\n\n2. **Run the Server and Consumer Applications**:\n\n   ```bash\n   node server.js\n   node consumer-app.js\n   ```\n\n## Environment Variables\n\n- **`MAX_DATA_LENGTH_BUFFER`**: Defines the maximum number of data entries to buffer before performing a bulk insertion. Set this to `10` to trigger bulk operations after accumulating 10 data entries.\n\n   Example configuration in `.env` file:\n\n   ```env\n   MAX_DATA_LENGTH_BUFFER=100\n   ```\n\n## Usage\n\n- **Server**: Manages data flow and interacts with Kafka.\n- **Consumer**: Processes incoming data and performs bulk insertions based on the configured buffer length.\n\n## Testing\n\nTo test the data ingestion and processing, you can use the provided test script:\n\n1. **Run the Test Script**:\n\n   ```bash\n   node test/test.js\n   ```\n\n   This script sends 3 requests per second with incrementing latitude and longitude values to simulate data streaming.\n\n\n## Contributing\n\nFeel free to contribute by submitting issues or pull requests. For any questions or feedback, open an issue on the [GitHub repository](https://github.com/codeterrayt/StreamGuard).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeterrayt%2Fstreamguard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodeterrayt%2Fstreamguard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeterrayt%2Fstreamguard/lists"}