{"id":31841931,"url":"https://github.com/robertobatts/leaderboard-api","last_synced_at":"2026-07-02T09:32:28.752Z","repository":{"id":38382048,"uuid":"380518534","full_name":"robertobatts/leaderboard-api","owner":"robertobatts","description":null,"archived":false,"fork":false,"pushed_at":"2022-06-05T17:31:09.000Z","size":56,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-19T14:58:38.497Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","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/robertobatts.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":"2021-06-26T14:14:18.000Z","updated_at":"2021-06-28T15:51:02.000Z","dependencies_parsed_at":"2022-08-25T06:01:03.000Z","dependency_job_id":null,"html_url":"https://github.com/robertobatts/leaderboard-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/robertobatts/leaderboard-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertobatts%2Fleaderboard-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertobatts%2Fleaderboard-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertobatts%2Fleaderboard-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertobatts%2Fleaderboard-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robertobatts","download_url":"https://codeload.github.com/robertobatts/leaderboard-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertobatts%2Fleaderboard-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35041996,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-02T02:00:06.368Z","response_time":173,"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":[],"created_at":"2025-10-12T05:55:26.806Z","updated_at":"2026-07-02T09:32:28.740Z","avatar_url":"https://github.com/robertobatts.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Leaderboard-API\n\n## Assumptions\n\n- The leaderboard is supposed to be global and therefore needs to be persisted permanently\n- No needs of specifying an order in case users have same score. In the code the order is decided directly by Redis,\nso in case of same score the users are ranked with a reverse lexicographical order\n\n## How it works\n##### Database\nI'm  using MongoDB for storing all the user scores. Every time the user score is updated/deleted in the database, \nthe same operation is done afterward in the cache\n\nThis database is never used to retrieve the records, it's only used for insert/update/delete operations\n\n##### Cache\nI'm using Redis sorted sets. With sorted sets, the Redis algorithm automatically assign a ranking based on the score of two users.\nIn case two users have the same score, then they are ranked following reverse lexicographical order\n\nThe cache is instantiated at each request through `JedisPool` so it is _thread safe_\n\nThe cache is populated at the start of the application, and is updated every time an insert/update/delete operation is done in the db\n\n## How to run it\nBuild jar file + run unit and integration tests:\n\n```\nmvn clean install\n```\nRun application:\n```\ndocker-compose up --build\n```\n\n## Postman Documentation\nhttps://documenter.getpostman.com/view/10941923/Tzef9Nhv","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertobatts%2Fleaderboard-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobertobatts%2Fleaderboard-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertobatts%2Fleaderboard-api/lists"}