{"id":16159052,"url":"https://github.com/mattddean/integrate-github-api","last_synced_at":"2026-04-10T20:53:16.017Z","repository":{"id":128425453,"uuid":"352438733","full_name":"mattddean/integrate-github-api","owner":"mattddean","description":null,"archived":false,"fork":false,"pushed_at":"2021-04-03T15:58:22.000Z","size":253,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-31T06:32:07.081Z","etag":null,"topics":["apollo-client","github-graphql-apiv4","graphql","nodejs","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/mattddean.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":"2021-03-28T21:06:47.000Z","updated_at":"2021-04-03T15:58:24.000Z","dependencies_parsed_at":"2024-07-31T00:51:25.696Z","dependency_job_id":null,"html_url":"https://github.com/mattddean/integrate-github-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mattddean/integrate-github-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattddean%2Fintegrate-github-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattddean%2Fintegrate-github-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattddean%2Fintegrate-github-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattddean%2Fintegrate-github-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mattddean","download_url":"https://codeload.github.com/mattddean/integrate-github-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattddean%2Fintegrate-github-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31658964,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T17:19:37.612Z","status":"ssl_error","status_checked_at":"2026-04-10T17:19:13.364Z","response_time":98,"last_error":"SSL_read: 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":["apollo-client","github-graphql-apiv4","graphql","nodejs","typescript"],"created_at":"2024-10-10T01:56:16.081Z","updated_at":"2026-04-10T20:53:16.000Z","avatar_url":"https://github.com/mattddean.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# integrate-github-api\n\n## Overview and Credit\n\nThis project uses GitHub's v4 API, which is based on GraphQL, to expose a REST API that's with the following functionality:\n\n- GET /v1/\u003cgithub_organization_name\u003e/repositories\n  - Get the names of \u003cgithub_organization_name\u003e's public repositories\n- PUT /v1/\u003cgithub_organization_name\u003e/repositories/to_file\n  - Write the names of \u003cgithub_organization_name\u003e's public repositories to a compressed JSON file on the server\n\nRepository structure and some functions, like catchAsyncRequest, are inherited from YouTube series: https://www.youtube.com/playlist?list=PLcCp4mjO-z9_HmJ5rSonmiEGfP-kyRMlI\n\n## Single Command Run\n\nCreate a file called `.env` in the directory from which you'll run the Docker container with contents:\n\n```txt\nTHIRD_PARTY_TOKEN=\u003cyour_github_personal_access_token\u003e\n```\n\nThen run:\n\n```bash\ndocker run --rm -p '3000:3000' --env-file .env mattddean/integrate_github_api:latest\n```\n\n\u003e You should now be able to issue REST requests to http://localhost:3000 and receive responses from the Node.js application running in the container you just started.\n\nThen, to get a shell into this running container to verify that the /tmp/knock_interview.json.gz file was successfully created, run:\n\n```bash\ndocker ps # note the Container ID associated with the mattddean/integrate_github_api:latest image\ndocker exec -it \u003ccontainer_id\u003e bash\n```\n\nTo stop the image, run:\n\n```bash\ndocker ps # note the Container ID associated with the mattddean/integrate_github_api:latest image\ndocker stop \u003ccontainer_id\u003e\n```\n\n\u003e Docker will automatically download the image from Docker Hub\n\n\u003e Note that because the app is running in Docker, it will write the /tmp/knock_interview.json.gz to the container's filesystem, not to the host filesystem\n\n### Stopping this container\n\nIn another shell, run:\n\n```bash\ndocker ps # take note of the relevant Container ID\ndocker stop \u003ccontainer_id\u003e\n```\n\n\u003e Replace `\u003ccontainer_id\u003e` with the relevant Container ID you found when running `docker ps`\n\n## GraphQL Rationale\n\nUsing GitHub's GraphQL API rather than their REST one gives me two benefits:\n\n- I can demonstrate my ability to use / adapt to GraphQL\n- Best chance of avoiding deprecation\n  - GitHub's GraphQL API is their newest API. In fact, they call it \"V4\" of their API rather than just a GraphQL version of V3. If further development is needed on this integration project, we're most likely to have access to GitHub's newest features if we use their newest API.\n\n## Update to latest Docker Image\n\n```bash\ndocker pull mattddean/integrate_github_api:latest\n```\n\n## Set up development environment\n\n### Host Machine Dependencies\n\n- Docker\n\n### Setting up your dev environment for the first time\n\nYou'll only need to perform these tasks once for a new host machine.\n\nCreate a \u003crepo_root\u003e/api/.env file with the following contents:\n\n```txt\nTHIRD_PARTY_TOKEN=\u003cyour_github_personal_access_token\u003e\n```\n\n\u003e This is needed in order to authenticate on GitHub's v4 GraphQL API. See this page for instructions on creating a GitHub Personal Access Token: https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token\n\nInstall npm dependencies:\n\n```bash\ndocker-compose run backend bash\n# in the shell that opens...\nnpm install\nexit\n```\n\n### Starting your dev environment\n\nRun the following command to start your dev environment:\n\n```bash\nCURRENT_USER_ID=$(id -u) CURRENT_GROUP_ID=$(id -g) docker-compose up backend\n```\n\n\u003e Docker will connect the container's port 3000 to your host's port 3000\n\nYou should now be able to issue API requests on your host machine to localhost:3000\n\n### Get a shell in your Docker dev environment\n\nWith the backend container \"up\", run the following in another shell:\n\n```bash\ndocker-compose exec backend bash\n```\n\n## Run tests\n\nIn [your Docker dev environment's shell](#Get-a-shell-in-your-Docker-dev-environment), run:\n\n```bash\nnpm run test\n```\n\n## Building for Production\n\nThe app can be pushed to your Docker Hub registry as a container with the following commands:\n\n```bash\ncd api\ndocker build -t \u003cyour_docker_hub_username\u003e/integrate_github_api:latest .\ndocker login\ndocker push \u003cyour_docker_hub_username\u003e/integrate_github_api:latest\n```\n\n\u003e Replace `\u003cyour_docker_hub_username\u003e` with your Docker Hub Username.\n\n## TODO\n\n- Distinguish between an error in connecting to the third party and an error reported from the third party\n- Handle In-Memory cache warning from Apollo that is reported when running tests\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattddean%2Fintegrate-github-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattddean%2Fintegrate-github-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattddean%2Fintegrate-github-api/lists"}