{"id":28259594,"url":"https://github.com/rahulsamant37/stock-anomaly_detection","last_synced_at":"2026-04-13T17:33:41.944Z","repository":{"id":293766624,"uuid":"982916681","full_name":"rahulsamant37/Stock-Anomaly_Detection","owner":"rahulsamant37","description":"A real-time data pipeline for e-commerce event streaming and analytics using Apache Kafka and Apache Druid. This system processes synthetic e-commerce data to demonstrate streaming analytics capabilities.","archived":false,"fork":false,"pushed_at":"2025-05-17T02:17:20.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-15T18:01:11.592Z","etag":null,"topics":["apache","docker-compose","druid","kafka","pipeline","postgresql","python"],"latest_commit_sha":null,"homepage":"","language":"Python","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/rahulsamant37.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-05-13T15:38:58.000Z","updated_at":"2025-06-05T07:31:17.000Z","dependencies_parsed_at":"2025-05-17T03:31:17.458Z","dependency_job_id":null,"html_url":"https://github.com/rahulsamant37/Stock-Anomaly_Detection","commit_stats":null,"previous_names":["rahulsamant37/stock-anomaly_detection"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rahulsamant37/Stock-Anomaly_Detection","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahulsamant37%2FStock-Anomaly_Detection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahulsamant37%2FStock-Anomaly_Detection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahulsamant37%2FStock-Anomaly_Detection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahulsamant37%2FStock-Anomaly_Detection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rahulsamant37","download_url":"https://codeload.github.com/rahulsamant37/Stock-Anomaly_Detection/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahulsamant37%2FStock-Anomaly_Detection/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31762589,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T15:25:13.801Z","status":"ssl_error","status_checked_at":"2026-04-13T15:25:09.162Z","response_time":93,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["apache","docker-compose","druid","kafka","pipeline","postgresql","python"],"created_at":"2025-05-20T03:12:24.229Z","updated_at":"2026-04-13T17:33:41.933Z","avatar_url":"https://github.com/rahulsamant37.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stock Anomaly Detection System\n\nA real-time data pipeline for e-commerce event streaming and analytics using Apache Kafka and Apache Druid. This system processes synthetic e-commerce data to demonstrate streaming analytics capabilities.\n\n## System Architecture\n\n```\n[Data Generator] -\u003e [Kafka Cluster] -\u003e [Apache Druid] -\u003e [Analytics Queries]\n```\n\n### Components\n- **Data Generator**: Python script generating synthetic e-commerce events\n- **Apache Kafka**: Distributed streaming platform (2 controllers, 2 brokers)\n- **Apache Druid**: Real-time analytics database\n- **PostgreSQL**: Metadata storage for Druid\n\n## Prerequisites\n\n- Docker and Docker Compose\n- Python 3.x\n- Required Python packages:\n  ```bash\n  pip install faker kafka-python\n  ```\n\n## Getting Started\n\n1. **Clone the repository**\n   ```bash\n   git clone https://github.com/yourusername/Stock-Anomaly_Detection.git\n   cd Stock-Anomaly_Detection\n   ```\n\n2. **Start the infrastructure**\n   ```bash\n   docker compose up -d\n   ```\n\n3. **Run the data generator**\n   ```bash\n   python main.py\n   ```\n\n## Service Endpoints\n\n- **Druid Console**: http://localhost:8888\n- **Kafka Brokers**: \n  - localhost:29092\n  - localhost:39092\n- **PostgreSQL**: localhost:5432\n- **Zookeeper**: localhost:2181\n\n## Data Schema\n\nThe system processes e-commerce events with the following structure:\n\n```json\n{\n    \"user_id\": \"integer\",\n    \"event_type\": \"string (click|view|purchase)\",\n    \"country\": \"string\",\n    \"city\": \"string\",\n    \"device\": \"string (mobile|desktop|tablet)\",\n    \"product_id\": \"integer\",\n    \"price\": \"float\",\n    \"quantity\": \"integer\",\n    \"timestamp\": \"unix_timestamp\"\n}\n```\n\n## Analytics Capabilities\n\nExample queries available in [`druid.sql`](druid.sql):\n\n1. Device-based analytics\n   - Total sales by device type\n   - Average price per device\n\n2. Geographic analysis\n   - Unique users per country\n   - Event distribution by location\n\n3. Product metrics\n   - Top selling products\n   - Revenue by product\n\n4. Time-based analysis\n   - Minute-by-minute event tracking\n   - Sales trends over time\n\n## Project Structure\n\n```\n├── docker-compose.yml    # Service orchestration\n├── main.py              # Data generator\n├── druid.sql            # Example queries\n└── environment          # Druid configuration\n```\n\n## Configuration\n\nThe system uses multiple containerized services:\n- 2 Kafka Controllers\n- 2 Kafka Brokers\n- Complete Druid stack (Coordinator, Broker, Historical, MiddleManager, Router)\n- Zookeeper for coordination\n- PostgreSQL for metadata storage\n\n## Contributing\n\n1. Fork the repository\n2. Create your feature branch\n3. Commit your changes\n4. Push to the branch\n5. Create a new Pull Request\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## Acknowledgments\n\n- Apache Kafka\n- Apache Druid\n- Python Faker library\n\n## Support\n\nFor support, please open an issue in the GitHub repository.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frahulsamant37%2Fstock-anomaly_detection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frahulsamant37%2Fstock-anomaly_detection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frahulsamant37%2Fstock-anomaly_detection/lists"}