{"id":16953173,"url":"https://github.com/c4milo/hello","last_synced_at":"2026-04-08T21:32:40.149Z","repository":{"id":57580176,"uuid":"82328794","full_name":"c4milo/hello","owner":"c4milo","description":null,"archived":false,"fork":false,"pushed_at":"2017-08-05T21:32:49.000Z","size":3091,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-28T17:49:33.210Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/c4milo.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":"2017-02-17T19:02:06.000Z","updated_at":"2017-04-07T20:01:53.000Z","dependencies_parsed_at":"2022-09-26T16:41:16.492Z","dependency_job_id":null,"html_url":"https://github.com/c4milo/hello","commit_stats":null,"previous_names":["c4milo/hello-nyt"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/c4milo/hello","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c4milo%2Fhello","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c4milo%2Fhello/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c4milo%2Fhello/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c4milo%2Fhello/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/c4milo","download_url":"https://codeload.github.com/c4milo/hello/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c4milo%2Fhello/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31575596,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-10-13T22:06:33.459Z","updated_at":"2026-04-08T21:32:40.134Z","avatar_url":"https://github.com/c4milo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hello API\n\nHello API exposes a simple service over gRPC and OpenAPI to record visitors and visits.\n\n\n## Prerequisites\n\n* gcloud CLI\n* Docker\n* Go 1.8\n\n## Development\n\nRun `make help` or `make`\n\n\n## API\n\nThe API can be explored by pointing your browser to [https://localhost:9999/#/Hello](https://localhost:9999/#/Hello).\n\nWhen using `curl`, an Accept header specifying `application/json` is required in order to hit the HTTP API. Otherwise, it is going to\nattempt to serve Swagger UI.\n\n```shell\ncurl --insecure -H \"Accept: application/json\" https://localhost:9999/hello/camilo | jq .\ncurl --insecure -H \"Accept: application/json\" https://localhost:9999/counts | jq .\ncurl -v --insecure -X DELETE -H \"Accept: application/json\" https://localhost:9999/counts | jq .\n```\n\n## Technical details\n\n* I used gRPC and Open API to generate the service from `hello.proto` and implemented `hello_service.go` and `hello_service_test.go`\n* I added Swagger UI to make it more convenient to explore the HTTP API.\n* Third-party dependencies are kept to the minimum possible.\n* The API also supports HTTP2 and TLS 1.2\n* A very minimal `Dockerfile` was also added.\n* Releasing a binary of the service was automated with Github Releases: https://github.com/c4milo/hello/releases\n* Dependencies are vendored using `govendor`\n* The total effort, including tests, docs and deployment was roughly 4 hours. Most of the time was spent dealing with GCP.\n\n## Deployment\n\nA GKE cluster was created using GCP's web console, only 1 replica is launched as the service is managing state locally.\nIn order to deploy changes follow these steps:\n\n1. Increase version number in [Makefile](https://github.com/c4milo/hello/tree/master/Makefile#L2)\n2. Increase version number in [deployment/hello.yaml](https://github.com/c4milo/hello/tree/master/deployment/hello.yaml#L14) accordingly.\n3. Run `make image-push`\n4. Run `kubectl apply deployment/hello.yaml`\n5. Verify by visiting [https://35.185.24.220/#/Hello](https://35.185.24.220/#/Hello)\n\n## Things that can be improved further\n\n* Manage state externally so the service can be scaled horizontally.\n* Add compression\n* Add rate limiting\n* Add LetsEncrypt certificate and schedule K8S to periodically renew the certificate.\n* Use domain name instead of IP address to access the service.\n\n## Issues I ran across\n\n* I spent a good deal of time trying to fix an authentication issue with gcloud as I had a previous project configured before.\n* K8s does not seem to be able to register service health checks in GCP's network load balancer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fc4milo%2Fhello","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fc4milo%2Fhello","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fc4milo%2Fhello/lists"}