{"id":20992796,"url":"https://github.com/shnartho/stock-analysis-real-time","last_synced_at":"2026-04-18T12:03:02.983Z","repository":{"id":236505511,"uuid":"792742431","full_name":"shnartho/stock-analysis-real-time","owner":"shnartho","description":"stock-analysis-real-time","archived":false,"fork":false,"pushed_at":"2024-04-28T08:26:22.000Z","size":3419,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-20T08:32:55.695Z","etag":null,"topics":["athena","crawlar","docker","ec2","glue","kafka","kubernetes","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/shnartho.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-04-27T12:56:10.000Z","updated_at":"2024-04-28T08:25:01.000Z","dependencies_parsed_at":"2024-11-19T07:12:52.113Z","dependency_job_id":"db9f780d-aaa1-45ae-a008-8b51ac8a3979","html_url":"https://github.com/shnartho/stock-analysis-real-time","commit_stats":null,"previous_names":["shnartho/stock-analysis-real-time"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shnartho%2Fstock-analysis-real-time","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shnartho%2Fstock-analysis-real-time/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shnartho%2Fstock-analysis-real-time/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shnartho%2Fstock-analysis-real-time/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shnartho","download_url":"https://codeload.github.com/shnartho/stock-analysis-real-time/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243403988,"owners_count":20285482,"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":["athena","crawlar","docker","ec2","glue","kafka","kubernetes","python"],"created_at":"2024-11-19T07:12:42.873Z","updated_at":"2025-12-27T16:03:31.920Z","avatar_url":"https://github.com/shnartho.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Real-Time Stock Market Analysis using Kafka\n\nThis project offers a hands-on approach to building an end-to-end data engineering solution for processing real-time stock market data with Apache Kafka. By working through this project, you'll dive into the practical aspects of managing and analyzing data streams in real-time.\n\n## Architecture\n![Architecture Diagram](./statics/arch.jpg)\n\n## Steps\n1. Install Kafka [!kafka_installation](https://medium.com/@neupane.krishna33/how-to-install-apache-kafka-and-rsyslog-on-ubuntu-20-04-90fea750d8f5). Incase of insufficient pysical memory use swap memory. Here are the commands, \u003cbr\u003e\nexport KAFKA_HEAP_OPTS=\"-Xmx512M -Xms512M\"\u003cbr\u003e\nsudo fallocate -l 2G /swapfile\u003cbr\u003e\nsudo chmod 600 /swapfile\u003cbr\u003e\nsudo mkswap /swapfile\u003cbr\u003e\nsudo swapon /swapfile\u003cbr\u003e\n2. Make the space permanent -\u003e echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab\u003cbr\u003e\n3. View the changes using -\u003e sudo swapon --show and Restart kafka.\u003cbr\u003e\n4. Make sure to run zookeeper and kafka seperately using similar comand \"bin/kafka-server-start.sh config/server.properties\"\u003cbr\u003e\n5. Once kafka is running in EC2, it should have accept requests on public ip 35.172.219.231:9092\n![ks](./statics/kafka_server.png)\n6. Up docker compose, it will run both producer and consumer (simulate env)\n![dc](./statics/dc_up.png)\n![log](./statics/log.png)\n7. S3 bucket \n![s3](./statics/s3.png)\n8. AWS athena live query \n![athena](./statics/query.png)\n9. use Terraform as IaC \u003cbr\u003e\n![tf](./statics/tf.png)\n\n\n## Important Commands:\n\n```\nwget https://downloads.apache.org/kafka/3.3.1/kafka_2.12-3.3.1.tgz\ntar -xvf kafka_2.12-3.3.1.tgz\nbin/zookeeper-server-start.sh config/zookeeper.properties\nexport KAFKA_HEAP_OPTS=\"-Xmx256M -Xms128M\"\nbin/kafka-server-start.sh config/server.properties\nsudo nano config/server.properties\nbin/kafka-topics.sh --create --topic demo_testing2 --bootstrap-server {Put the Public IP of your EC2 Instance:9092} --replication-factor 1 --partitions 1\nbin/kafka-console-producer.sh --topic demo_testing2 --bootstrap-server {Put the Public IP of your EC2 Instance:9092}\nbin/kafka-console-consumer.sh --topic demo_testing2 --bootstrap-server {Put the Public IP of your EC2 Instance:9092}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshnartho%2Fstock-analysis-real-time","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshnartho%2Fstock-analysis-real-time","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshnartho%2Fstock-analysis-real-time/lists"}