{"id":36531300,"url":"https://github.com/recode-sh/api","last_synced_at":"2026-01-12T03:01:37.058Z","repository":{"id":213041334,"uuid":"497950992","full_name":"recode-sh/api","owner":"recode-sh","description":"The API used to implement the GitHub OAuth flow for the Recode CLI","archived":false,"fork":false,"pushed_at":"2022-05-31T22:26:23.000Z","size":22,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-22T18:04:04.179Z","etag":null,"topics":["api","github","oauth","recode"],"latest_commit_sha":null,"homepage":"https://api.recode.sh","language":"Go","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/recode-sh.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-05-30T13:16:51.000Z","updated_at":"2022-06-04T13:25:59.000Z","dependencies_parsed_at":"2023-12-18T05:49:08.785Z","dependency_job_id":null,"html_url":"https://github.com/recode-sh/api","commit_stats":null,"previous_names":["recode-sh/api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/recode-sh/api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/recode-sh%2Fapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/recode-sh%2Fapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/recode-sh%2Fapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/recode-sh%2Fapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/recode-sh","download_url":"https://codeload.github.com/recode-sh/api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/recode-sh%2Fapi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28332841,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T00:36:25.062Z","status":"online","status_checked_at":"2026-01-12T02:00:08.677Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["api","github","oauth","recode"],"created_at":"2026-01-12T03:01:19.808Z","updated_at":"2026-01-12T03:01:37.035Z","avatar_url":"https://github.com/recode-sh.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# API\n\nThis repository contains the source code of the Recode API.\n\nThe Recode API is hosted in a private server in the sole goal of implementing the GitHub OAuth flow in a secured manner (ie: without exposing our GitHub secret in the \u003ca href=\"https://github.com/recode-sh/cli\"\u003eCLI\u003c/a\u003e).\n\nThe base URL for the API is: \u003ca href=\"https://api.recode.sh\"\u003ehttps://api.recode.sh\u003c/a\u003e\n\n## Table of contents\n- [Requirements](#requirements)\n- [Usage](#usage)\n- [API](#api)\n  - [Routes](#routes)\n  - [GitHub OAuth flow](#github-oauth-flow)\n- [The future](#the-future)\n- [License](#license)\n\n## Requirements\n\nThe Recode API only requires `go \u003e= 1.17` to run.\n\n## Usage\n\nTo use the Recode API, the following steps need to be taken:\n\n1. Clone the GitHub repository using: `git clone https://github.com/recode-sh/api.git`.\n\n2. Create a file named `.env` at the root of the repository. (This file will contain the environment variables required by the API).\n\n3. Use the `.env.dist` file to add the required environment variables to your `.env` file. \n\n4. Launch the API server using the command `go run main.go`. The server will listen on `http://127.0.0.1:8080` by default.\n\n\n## API\n\nThe Recode API is implemented using the [Gin Web Framework](https://github.com/gin-gonic/gin).\n\n### Routes\n\n```bash\nGET /github/oauth/callback\n```\n\nThis is the sole route defined. This is where you will be redirected after authorizing the Recode application on GitHub.\n\nThe GitHub OAuth code will be exchanged for an access token and transmited to the Recode CLI using an HTTP redirect.\n\n### GitHub OAuth flow\n\nThe GitHub OAuth flow is a multi-step process between the **Recode CLI**, **GitHub** and the **Recode API**:\n\n1. First, the **Recode CLI** will create an HTTP server that will listen for connections on `127.0.0.1:${RANDOM_PORT}`.\n\n2. Then, the **Recode CLI** will redirect you to **GitHub** to authorize the Recode application.\n\n3. Once authorized, **GitHub** will redirect you to the **Recode API** that will exchange to passed OAuth code for an access token.\n\n4. Once done, the **Recode API** will pass the received access token to the **Recode CLI** by redirecting you to `http://127.0.0.1:${RANDOM_PORT}?access_token=${GITHUB_ACCESS_TOKEN}`.\n\nGiven that GitHub doesn't support dynamic OAuth redirect uris, the random port used by the CLI is passed to the API via the OAuth `state` parameter. \n\n## The future\n\nThis project is **100% community-driven**, meaning that except for bug fixes \u003cins\u003e**no more features will be added**\u003c/ins\u003e. \n\nThe only features that will be added are the ones that will be [posted as an issue](https://github.com/recode-sh/cli/issues/new) and that will receive a significant amount of upvotes **(\u003e= 10 currently)**.\n\n## License\n\nRecode is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frecode-sh%2Fapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frecode-sh%2Fapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frecode-sh%2Fapi/lists"}