{"id":16227844,"url":"https://github.com/d0x2f/birthday-checker-infrastructure","last_synced_at":"2025-07-16T04:44:27.411Z","repository":{"id":118797505,"uuid":"591625020","full_name":"d0x2f/birthday-checker-infrastructure","owner":"d0x2f","description":null,"archived":false,"fork":false,"pushed_at":"2023-02-26T20:55:53.000Z","size":897,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-08T04:30:37.932Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HCL","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/d0x2f.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":"2023-01-21T10:26:05.000Z","updated_at":"2024-06-05T18:04:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"8a49acb3-0936-435f-9431-70f95e41af45","html_url":"https://github.com/d0x2f/birthday-checker-infrastructure","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/d0x2f/birthday-checker-infrastructure","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d0x2f%2Fbirthday-checker-infrastructure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d0x2f%2Fbirthday-checker-infrastructure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d0x2f%2Fbirthday-checker-infrastructure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d0x2f%2Fbirthday-checker-infrastructure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/d0x2f","download_url":"https://codeload.github.com/d0x2f/birthday-checker-infrastructure/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d0x2f%2Fbirthday-checker-infrastructure/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265482371,"owners_count":23774036,"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":[],"created_at":"2024-10-10T12:53:58.766Z","updated_at":"2025-07-16T04:44:27.403Z","avatar_url":"https://github.com/d0x2f.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Birthday Checker Infrastructure\n\nThis project houses the infrastructure powering the birthday-checker\napplication.\n\n~It's currently hosted at https://birthday-checker-3vshm7xaxa-nw.a.run.app.~\n\nThe application is deployed using a github actions pipeline.\n\nPlease submit a pull request to submit your contribution for review.\n\n![System Diagram](./resources/system_diagram.png)\n\nThe following information describes how to use the code in the repository to\nperform a manual deployment for informational purposes.\n\n## Prerequisites\n\nIt is assumed you have a google cloud platform account with an active billing\naccount.\n\nIn order to run the initial setup script you'll need your billing account id.\n\n## Environment\n\nA dockerfile is available to provide a consistent execution environment with all\nrequired dependencies included. Build and run it from the project root directory\nlike so:\n\n```bash\n$ docker build . -t birthday-checker-infrastructure\n$ docker run -it --rm \\\n  -e BILLING_ACCOUNT_ID=\u003cyour-billing-account-id\u003e \\\n  -v $(pwd):/app\n  birthday-checker-infrastructure\n```\n\n## Initial Setup\n\nIn order to deploy this infrastructure you'll first need to create a backend\nbucket to store terraform state and a service account with permission deploy\nthe necessary resources.\n\nThe `./scripts/gcp-setup.sh` script can do this for you, run it like so:\n\n```bash\n$ gcloud auth login\n$ source ./scripts/gcp-setup.sh \u003cunique-scope-id\u003e\n```\n\nSince google project names are globally scoped, we need to choose a unique id to\nappend. Replace `\u003cunique-scope-id\u003e` with a random string such as your\ncompany name or the date. Use the same id each time you run the script unless\nyou wish to deploy a second instance.\n\nThe script is idempotent, so there is no harm running it multiple times if you\nneed to do any debugging.\n\nCreate and store the terraform service account credentials with the following\ncommand:\n\n```bash\n$ gcloud iam service-accounts keys create deploy-key.json --iam-account=\"terraform@${TF_PROJECT_ID}.iam.gserviceaccount.com\"\n```\n\nNote that the `gcp-setup.sh` script exports `$TF_PROJECT_ID`.\n\nThese are the credentials used by terraform to deploy resources in the next\nstep.\n\n## Running\n\nThe setup script exports some terraform variables so you don't need to configure\nthem.\nTo deploy, run like so:\n\n```bash\n$ source ./scripts/gcp-setup.sh\n$ export GOOGLE_APPLICATION_CREDENTIALS=\u003cpath-to-your-deployment-credentials-file\u003e\n$ cd ./terraform\n$ terraform init -backend-config=bucket=\"${TF_PROJECT_ID}\"\n$ terraform apply\n```\n\nReview the generated changes and apply if acceptable.\n\n## Benchmark\n\nRunning against 50 random names and dates `siege` produces the following results:\n\n```\n$ siege -c10 -t60s -f urls --content-type \"application/json\"\n...\nTransactions:                   4160 hits\nAvailability:                 100.00 %\nElapsed time:                  60.16 secs\nData transferred:               0.12 MB\nResponse time:                  0.14 secs\nTransaction rate:              69.15 trans/sec\nThroughput:                     0.00 MB/sec\nConcurrency:                    9.95\nSuccessful transactions:        4161\nFailed transactions:               0\nLongest transaction:            0.50\nShortest transaction:           0.12\n```\n\nI've discovered my router crashes if I use a concurrency of 20 😂.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd0x2f%2Fbirthday-checker-infrastructure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fd0x2f%2Fbirthday-checker-infrastructure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd0x2f%2Fbirthday-checker-infrastructure/lists"}