{"id":22786132,"url":"https://github.com/hemantksingh/brew-bar","last_synced_at":"2025-10-06T18:19:08.810Z","repository":{"id":49714663,"uuid":"517841847","full_name":"hemantksingh/brew-bar","owner":"hemantksingh","description":"Event driven app that mirrors order processing in a brew bar based on AWS resources managed via terraform","archived":false,"fork":false,"pushed_at":"2022-12-29T01:38:47.000Z","size":309,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-05T17:14:52.852Z","etag":null,"topics":["api-gateway","aws","eventdrivenarchitecture","rest-api","serverless","terraform","typescript"],"latest_commit_sha":null,"homepage":"","language":"HCL","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/hemantksingh.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}},"created_at":"2022-07-25T22:46:19.000Z","updated_at":"2023-07-25T03:23:01.000Z","dependencies_parsed_at":"2023-01-31T07:45:56.871Z","dependency_job_id":null,"html_url":"https://github.com/hemantksingh/brew-bar","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hemantksingh%2Fbrew-bar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hemantksingh%2Fbrew-bar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hemantksingh%2Fbrew-bar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hemantksingh%2Fbrew-bar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hemantksingh","download_url":"https://codeload.github.com/hemantksingh/brew-bar/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246342705,"owners_count":20761938,"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-gateway","aws","eventdrivenarchitecture","rest-api","serverless","terraform","typescript"],"created_at":"2024-12-11T23:09:13.936Z","updated_at":"2025-10-06T18:19:03.790Z","avatar_url":"https://github.com/hemantksingh.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# brew-bar\n\nEvent driven app that mirrors order processing in a brew bar based on AWS resources managed via terraform\n\n- Public gateway used for providing public access for placing Orders, can also plug in to an identity provider for authorizing clients/users.\n- To enable clients to register events without changing backend code, you can [send client events](https://aws.amazon.com/blogs/compute/capturing-client-events-using-amazon-api-gateway-and-amazon-eventbridge/) to EventBridge via an API Gateway\n- The internal AWS API Gateway performs validation on published events. It [supports](https://docs.aws.amazon.com/apigateway/latest/developerguide/models-mappings.html#models-mappings-models) Draft 4 of JSON Schema and plug the schema into an API endpoint in order to reject any requests that don’t conform to the schema.\n- The event bus has a rule to dispatch order events to the delivery lambda. You can only create scheduled rules using the default event bus\n- EventBridge has a hard limit on the event size at 265 KB\n\n\u003cimg src=\"./architecture.png\" title=\"Event Driven Architecture\" height=\"450\" width=\"800\"/\u003e\n\n## Build the apps (lambda functions)\n\nThe apps are built using `esbuild` and packaged with `zip` as detailed [here](https://docs.aws.amazon.com/lambda/latest/dg/typescript-package.html)\n\n```sh\nmake build APP=orders\nmake build APP=delivery\n```\n\n## Deploy the stack\n\nThe infrastructure and apps are deployed using `terraform`\n\n```sh\n# Provision the stack\nmake stack APPLY=true\n\n# Tear down\nmake destroy-stack\n```\n\n## Get orders\n\n```sh\ncd provisioning\ncurl \"$(terraform output -raw orders_api_url)/orders\"\n```\n\n## Run load tests\n\n- Pre requisites - Install [pipenv](https://packaging.python.org/en/latest/tutorials/managing-dependencies/)\n\n    ```sh\n    python3 -m pip install --user pipenv\n    ```\n\n- Run load test\n  \n    ```sh\n    # get ORDERS_API_ID by loading terraform output\n    make output\n\n    # Terraform out put looks like:\n    # orders_api_url = \"https://e60e2y07o4.execute-api.eu-west-1.amazonaws.com/brewbar\n\n    # run the load test\n    make loadtest ORDERS_API_ID=e60e2y07o4\n    ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhemantksingh%2Fbrew-bar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhemantksingh%2Fbrew-bar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhemantksingh%2Fbrew-bar/lists"}