{"id":13834360,"url":"https://github.com/ymwjbxxq/rust_doorbell","last_synced_at":"2025-07-10T04:31:54.793Z","repository":{"id":44766102,"uuid":"447981568","full_name":"ymwjbxxq/rust_doorbell","owner":"ymwjbxxq","description":"A PoC of a smart doorbell using AWS AI managed servces","archived":false,"fork":false,"pushed_at":"2022-03-24T07:55:44.000Z","size":3982,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-02-17T06:33:14.651Z","etag":null,"topics":["ai","aws","poc","proof-of-concept","rust","serverless"],"latest_commit_sha":null,"homepage":"https://dfrasca.hashnode.dev/series/project-doorbell","language":"Rust","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/ymwjbxxq.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}},"created_at":"2022-01-14T13:43:46.000Z","updated_at":"2023-09-08T09:42:03.000Z","dependencies_parsed_at":"2022-09-08T09:11:06.476Z","dependency_job_id":null,"html_url":"https://github.com/ymwjbxxq/rust_doorbell","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ymwjbxxq/rust_doorbell","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ymwjbxxq%2Frust_doorbell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ymwjbxxq%2Frust_doorbell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ymwjbxxq%2Frust_doorbell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ymwjbxxq%2Frust_doorbell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ymwjbxxq","download_url":"https://codeload.github.com/ymwjbxxq/rust_doorbell/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ymwjbxxq%2Frust_doorbell/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264528741,"owners_count":23623218,"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":["ai","aws","poc","proof-of-concept","rust","serverless"],"created_at":"2024-08-04T14:00:30.966Z","updated_at":"2025-07-10T04:31:54.480Z","avatar_url":"https://github.com/ymwjbxxq.png","language":"Rust","funding_links":[],"categories":["💻 Samples"],"sub_categories":[],"readme":"# Project doorbell\n\nProject Doorbell is an idea that I got to know the managed AI AWS services and keep going to write some code in Rust.\nSmart doorbells include a camera, microphone and speaker to allow for a two-way conversation between the doorbell and its smartphone app.\nThis project is concentrated on the backend side of communication. Therefore, I will not consider the hardware and the mobile app.\nYou can find a series of articles [here](https://dfrasca.hashnode.dev/series/project-doorbell)\n\n## How it works ##\n\n![picture](https://github.com/ymwjbxxq/rust_doorbell/blob/main/readme/citofono.jpeg)\n\n- I ring my doorbell.\n- The doorbell takes a picture of me.\n- Will open a WebSocket connection\n- Send an event to EventBridge to create the presignd url\n- Send it back to the doorbell\n- Doorbell upload the photo to S3\n- S3 PUT will generate an event to EventBridge and execute the Step Function.\n- Step Function is comparing the face\n\n![picture](https://github.com/ymwjbxxq/rust_doorbell/blob/main/readme/stepfunctions_graph.png)\n\nIf we have a match:\n\n- Generate a 6 digit code\n- Send the code to the mobile app\n- Insert the code in the doorbell keypad and go inside.\n\nIf we have do not have a match:\n\n- Send error back to the doorbell\n- Let the doorbell ring\n- Send a photo to the mobile app\n\n## HOW TO DEPLOY ##\n\nThe project will deploy the following AWS services:\n\n- AWS Lambda functions\n- Amazon API Gateway\n- AWS Step Functions\n- Amazon DynamoDB\n\nPart of the initial setup can be read it [here](https://dfrasca.hashnode.dev/project-doorbell-infrastructure-setup)\n\nThis project require RUST and for basic setup please refer to [part 1](https://dfrasca.hashnode.dev/hello-serverless-rust) and [part 2](https://dfrasca.hashnode.dev/rust-using-lambda-arm64-architecture) of [RUST series](https://dfrasca.hashnode.dev/series/how-to-serverless-rust)\n\nAssuming that your computer is setup, you need to build\n\n```\nmake build\n```\n\nOnce it is all built\n\n![picture](https://github.com/ymwjbxxq/rust_doorbell/blob/main/readme/build.png) \n\nWe can deploy all the applications. I use \n\n\u003e --profile test \n\nInside my MakeFile, and you may remove it.\n\n```\nmake deploy\n```\n\nIf everything is all working, you should have in your AWS Account something like this:\n\n![picture](https://github.com/ymwjbxxq/rust_doorbell/blob/main/readme/cf.png)\n\nInside the rust-doorbell-websocket stack, you can find the WebSocket URL. It should look like\n\nwss://xxxxx.execute-api.eu-central-1.amazonaws.com/prod\n\n### Face match ###\n\n![picture](https://github.com/ymwjbxxq/rust_doorbell/blob/main/readme/iter1.png)\n\n### Face does not match ###\n\n![picture](https://github.com/ymwjbxxq/rust_doorbell/blob/main/readme/iter2.png)\n\n### Face is not human ###\n\n![picture](https://github.com/ymwjbxxq/rust_doorbell/blob/main/readme/iter3.png)\n\n### Testing ###\n\n[Postman Now Supports WebSocket APIs](https://blog.postman.com/postman-supports-websocket-apis/), and we will leverage this tool to simulate the flow.\n\nThis project is concentrated on the backend side of communication. Therefore, I will not consider the hardware and the mobile app. This means that we will send the 6 digit code back to the WebSocket channel.\nIn reality, this will not happen because the code or the person's preview at the doorbell will be sent to the mobile app.\nI took the liberty to use the WebSocket to take some action.\n\n1. Upload inside the bucket a passport type photo of you, and call it source.jpeg. This is the source photo that we are using to compare the photo taken by the doorbell\n2. Open Postman\n3. Create a new WebSocket Request\n4. Past your address wss://xxxxx.execute-api.eu-central-1.amazonaws.com/prod\n5. Click Connect\n\nYou should see something like:\n\n![picture](https://github.com/ymwjbxxq/rust_doorbell/blob/main/readme/postman1.png)\n\nCopy the return of the presigned url, something like\n\nhttps://s3.eu-central-1.amazonaws.com/rust-doorbell-s3-sourcebucket-xxxxxxx/guest/Mc8_Pc81liACHoQ%3D/guest.jpeg?x-id=PutObject\u0026X-Amz-Algorithm=AWS4-HMAC-SHA256\u0026X-Amz-Credential=ASIAYKMZLNCDZDGUNLLS%2F20220124%2Feu-central-1%2Fs3%2Faws4_request\u0026X-Amz-Date=20220124T132346Z\u0026X-Amz-Expires=300\u0026X-Amz-SignedHeaders=host\u0026X-Amz-Signature=c95bb0966496d807bbac9c37a097f49dc6eff2b569b9a7ed17319a4fc6352fc6\u0026X-Amz-Security-Token=IQoJb3JpZ2luX2VjEE0aDGV1LWNlbnRyYWwtMSJGMEQCICPze%2BYK0U9xGQa86RAgvxy1dAvgCAp9JGdsmDpR5KkdAiBNpTJOTW%2F7SW2CGnGJy%2B%2F5lEeUyhAtCU%2BJtoCTcQko%2FirEAgh3EAMaDDU3MjA4OTEzMzE5MSIMizWj6%2B91YdoTI4eKKqECMr5XmmjaW9KIm0Vwc16rc%2Fidr9EJbiPRsmA5I9pJ5tZpKaMaTFog%2FpMztrftAkXkZorwNK9f1wvJdUxDXHrHrZ00vBt6y%2FGSGHpmW1uZMmJLc%2FL8wZqxcm49caAioXtElK2xE30cHBCf3lw2rQXCi9SnUK0P0D6E0cB4jYfOSOPHh%2F9onVPHiYkENz0KBCFRBVTR68dEpQ4gYLsMyQvirNJKDocliNAyhFKZJ7jxHk2EiMw8FzZG67Zwgtk3ceVd4Kux0sVFvVW3dAs9nv7Yq5kotmv1HacSxBT0Jqv2rxaj203Vkje6g03phJxpLiq%2FBzLUO4JIdA8uN8rwkHgnzSlrE7AkkqnmU5p%2F3wCvZkvlg%2FkBLnKpzZ5DENijbiMXCzDi0LqPBjqbAck8ZFvJNPl30TerlHhU3jIKuyV%2B66iNeXfjoNqcnh2OM1WC0Yv5KIdBrxD8GnQC4jcM0hfxG%2FGAfzdcQ0JEo6lWLm8apkyGLDrNk2tgB2iML5rxgkLTmRDtJMlFCxAYkG8P1snbUKSXC0BzTJi7vdBz7RCXrvQo51SjI5Js1vXVLR0vNAQTFoVPR0pNNWcLvOSVe3Dq7n76D1jr\n\n\nAnd open a new tab in postman using the link you got (remember to upload a recent photo of you) and click Send.\n\nGo back to the WebSocket tab, and you should see the code in return.\n\n![picture](https://github.com/ymwjbxxq/rust_doorbell/blob/main/readme/postman3.png)\n\n\n### Cleanup ###\n```\nmake delete\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fymwjbxxq%2Frust_doorbell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fymwjbxxq%2Frust_doorbell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fymwjbxxq%2Frust_doorbell/lists"}