{"id":18098595,"url":"https://github.com/makiftutuncu/github-ranks","last_synced_at":"2025-07-06T21:03:19.188Z","repository":{"id":152869415,"uuid":"404795990","full_name":"makiftutuncu/github-ranks","owner":"makiftutuncu","description":"GitHub Ranks is a web backend application, providing contributor statistics of organizations on github.com.","archived":false,"fork":false,"pushed_at":"2023-12-15T05:23:19.000Z","size":29,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T04:07:43.222Z","etag":null,"topics":["cats","cats-effect","http4s","munit","sbt","scala"],"latest_commit_sha":null,"homepage":"","language":"Scala","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/makiftutuncu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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-09-09T16:35:49.000Z","updated_at":"2023-09-06T20:39:48.000Z","dependencies_parsed_at":"2023-12-15T06:42:43.200Z","dependency_job_id":null,"html_url":"https://github.com/makiftutuncu/github-ranks","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/makiftutuncu%2Fgithub-ranks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makiftutuncu%2Fgithub-ranks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makiftutuncu%2Fgithub-ranks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makiftutuncu%2Fgithub-ranks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/makiftutuncu","download_url":"https://codeload.github.com/makiftutuncu/github-ranks/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248717251,"owners_count":21150389,"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":["cats","cats-effect","http4s","munit","sbt","scala"],"created_at":"2024-10-31T20:12:08.143Z","updated_at":"2025-04-13T13:02:51.060Z","avatar_url":"https://github.com/makiftutuncu.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitHub Ranks\n\n## Table of Contents\n\n1. [Introduction](#introduction)\n2. [Configuration](#configuration)\n3. [Development and Running](#development-and-running)\n4. [Testing](#testing)\n5. [API](#api)\n6. [Notes](#notes-and-points-to-improve)\n7. [Contributing](#contributing)\n8. [License](#license)\n\n## Introduction\n\nGitHub Ranks is a web backend application, providing contributor statistics of organizations on [github.com](https://github.com).\n\n## Configuration\n\nApplication can be configured via [application.conf](src/main/resources/application.conf) for running locally. You can also override config values with following environment variables.\n\n| Variable Name | Data Type | Description                       | Required                  |\n| ------------- | --------- | --------------------------------- | ------------------------- |\n| HOST          | Int       | Running host of application       | No, defaults to `0.0.0.0` |\n| PORT          | Int       | Running port of application       | No, defaults to `8080`    |\n| GH_TOKEN      | String    | OAuth token to access GitHub APIs | Yes                       |\n\nSecret values like tokens can also be placed in `secret.conf` file you can create under `src/main/resources` for development. It is git-ignored by default.\n\n## Development and Running\n\nApplication is built with SBT. So, standard SBT tasks like `clean`, `compile` and `run` can be used. To run the application locally:\n\n```bash\nsbt run\n```\n\nYou may also run the application in a Docker container. To build an image locally\n\n```bash\nsbt 'Docker / publishLocal'\n```\n\nTo start a container from Docker image (also exposing port and providing GH_TOKEN environment)\n\n```bash\ndocker run --rm -p 8080:8080 -e GH_TOKEN=REPLACE_ME github-ranks:0.1\n```\n\n## Testing\n\nTo run automated tests, you can use `test` and `testOnly` tasks of SBT. To run all tests:\n\n```bash\nsbt test\n```\n\nTo run specific test(s):\n\n```bash\nsbt 'testOnly fullyQualifiedTestClassName1 fullyQualifiedTestClassName2 ...'\n```\n\n## API\n\nHere is an overview of the APIs:\n\n| Method | URL                              | Link                                     |\n| ------ | -------------------------------- | ---------------------------------------- |\n| GET    | /org/`organization`/contributors | [Jump](#get-orgorganizationcontributors) |\n\nErrors return an error Json in following format:\n\n```json\n{\n  \"error\": \"Some human readable description of the error\"\n}\n```\n\nwith a corresponding HTTP status code depending on the error.\n\nAll successful responses will have `200 OK` status unless explicitly mentioned.\n\n---\n\n### GET /org/`organization`/contributors\n\nReturns a list of all contributors of all repositories under `organization`, sorted in descending order by their total contributions\n\n#### Example Successful Response for `/org/zio/contributors`\n\n```json\n[\n    {\n        \"contributions\": 3936,\n        \"login\": \"scala-steward\"\n    },\n    {\n        \"contributions\": 1061,\n        \"login\": \"jdegoes\"\n    },\n    {\n        \"contributions\": 956,\n        \"login\": \"adamgfraser\"\n    },\n    {\n        \"contributions\": 620,\n        \"login\": \"mijicd\"\n    },\n    {\n        \"contributions\": 494,\n        \"login\": \"jczuchnowski\"\n    },\n    {\n        \"contributions\": 403,\n        \"login\": \"Regis Kuckaertz \u003cregis.kuckaertz@theguardian.com\u003e\"\n    },\n    ...\n]\n```\n\n#### Possible Errors\n\n| What               | When                                             | Status |\n| ------------------ | ------------------------------------------------ | ------ |\n| Rate limited       | Requests to GitHub are rate limited              | 403    |\n| Not found          | Organization/repository is not found on GitHub   | 404    |\n| Unhandled          | Any unhandled error                              | 500    |\n| Unavailable        | Cannot talk to GitHub (network/parse error etc.) | 503    |\n\n## Notes and Points to Improve\n\n* When at least one of the parallel requests fails, the rest of the requests that have been completed successfully become wasted as their results are thrown away because an error response is produced.\n  * This could be achieved by having a response object that contains both already collected data and the error if any. This way users of the API can get partial results.\n* HTTP requests are done every time.\n  * Results of successful HTTP requests could be cached as contributors of repositories/organizations don't change that often. This would help avoid this network overhead and improve performance.\n* If `Docker / publishLocal` fails, you may try using a different base image. See `dockerBaseImage` key in [build.sbt](build.sbt).\n\n## Contributing\n\nAll contributions are welcome. Please feel free to send a pull request. Thank you.\n\n## License\n\nGitHub Ranks is licensed with [MIT License](LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmakiftutuncu%2Fgithub-ranks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmakiftutuncu%2Fgithub-ranks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmakiftutuncu%2Fgithub-ranks/lists"}