{"id":16403054,"url":"https://github.com/bm777/predictive-maintenance","last_synced_at":"2026-05-15T22:40:20.249Z","repository":{"id":107402640,"uuid":"465682515","full_name":"bm777/predictive-maintenance","owner":"bm777","description":"Predictive maintenance using ML, hosted by FastAPI and Kafka","archived":false,"fork":false,"pushed_at":"2022-03-06T18:48:23.000Z","size":423,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-23T17:24:36.579Z","etag":null,"topics":["anomaly-detection","api-rest","fastapi","kafka-consumer","kafka-producer","predictive-maintenance"],"latest_commit_sha":null,"homepage":"","language":"Python","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/bm777.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2022-03-03T11:00:50.000Z","updated_at":"2022-03-03T18:37:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"c7f2d7c3-649f-43ac-b5c1-bcc0ced47cd8","html_url":"https://github.com/bm777/predictive-maintenance","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bm777/predictive-maintenance","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bm777%2Fpredictive-maintenance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bm777%2Fpredictive-maintenance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bm777%2Fpredictive-maintenance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bm777%2Fpredictive-maintenance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bm777","download_url":"https://codeload.github.com/bm777/predictive-maintenance/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bm777%2Fpredictive-maintenance/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272958613,"owners_count":25022052,"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-31T02:00:09.071Z","response_time":79,"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":["anomaly-detection","api-rest","fastapi","kafka-consumer","kafka-producer","predictive-maintenance"],"created_at":"2024-10-11T05:48:05.145Z","updated_at":"2026-05-15T22:40:15.215Z","avatar_url":"https://github.com/bm777.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Predictive-maintenance\nPredictive maintenance using ML, hosted by FastAPI and Kafka\n\n# Settings\nTry to clone the repo.\n\n```\ngit clone https://github.com/bm777/predictive-maintenance.git\n```\n\n#### 0. Set up the kafka env\n\n```\ncd kafka\nbin/zookeeper-server-start.sh config/zookeeper.properties\nbin/kafka-server-start.sh config/server.properties\n```\n\n#### 1. Create the transactions, anomalies and normals topics in Kafka Consumer\n\n```\ncd kafka\nbin/kafka-topics.sh --create --topic transactions --bootstrap-server localhost:9092\nbin/kafka-topics.sh --create --topic anomalies --bootstrap-server localhost:9092\nbin/kafka-topics.sh --create --topic normals --bootstrap-server localhost:9092\n```\n\nWe can check our created topics by this command `kafka-topics.sh --bootstrap-server localhost:9092 --list`, the result should be three topics.\n\n\n#### 2. The predictive maintenance thread \u0026 the topics\n\n- The predictive maintenance thread is started automatically in fastapi's startup event. So no need to run `python streaming_kafka/predictive_maintenance.py`\n\n\n- [optional] watch the topic of your choice {`transactions`, `anomalies`, and `normals` } in the consumer\n\n```\nbin/kafka-console-consumer.sh --topic transactions --from-beginning --bootstrap-server localhost:9092\nbin/kafka-console-consumer.sh --topic anomalies --from-beginning --bootstrap-server localhost:9092\nbin/kafka-console-consumer.sh --topic normals --from-beginning --bootstrap-server localhost:9092\n```\n\n![alt](assets/topics.png)\n\n#### 3. Start the producer (from our distributed users)\n\n- Static producer: in making event in cascade :)\n\n```\npython streaming_kafka/producer.py\n```\n\n- Dynamic producer: using REST FastAPI\n\n ```\nhttp://localhost:5500/event?data=11\n ```\n\n  ![alt](assets/transaction-api.png)\n\n#### 4. Alerts bot to slack\n\n![alt](assets/rt.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbm777%2Fpredictive-maintenance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbm777%2Fpredictive-maintenance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbm777%2Fpredictive-maintenance/lists"}