{"id":30071089,"url":"https://github.com/superthinking/url-shortener-playground","last_synced_at":"2026-07-18T23:35:53.859Z","repository":{"id":303256201,"uuid":"1014885465","full_name":"SuperThinking/url-shortener-playground","owner":"SuperThinking","description":"Another url shortener | Playground","archived":false,"fork":false,"pushed_at":"2025-07-06T15:54:39.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-08T12:37:58.322Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/SuperThinking.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,"zenodo":null}},"created_at":"2025-07-06T15:45:33.000Z","updated_at":"2025-07-06T15:54:42.000Z","dependencies_parsed_at":"2025-07-06T16:51:34.482Z","dependency_job_id":null,"html_url":"https://github.com/SuperThinking/url-shortener-playground","commit_stats":null,"previous_names":["superthinking/url-shortener-playground"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SuperThinking/url-shortener-playground","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperThinking%2Furl-shortener-playground","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperThinking%2Furl-shortener-playground/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperThinking%2Furl-shortener-playground/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperThinking%2Furl-shortener-playground/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SuperThinking","download_url":"https://codeload.github.com/SuperThinking/url-shortener-playground/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperThinking%2Furl-shortener-playground/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279007028,"owners_count":26084226,"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","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"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-08-08T12:18:04.640Z","updated_at":"2025-10-11T11:12:37.665Z","avatar_url":"https://github.com/SuperThinking.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# URL SHORTENER PLAYGROUND\n\n\nTo run the application locally:\n```bash\nmake venv\nmake install-dev\nmake docker-dev\nsource .venv/bin/activate\nfastapi dev main.py\n```\n\n```\nCreate / View records in database (mongodb):\n\nhttp://localhost:8084/\n\nusername: admin\npassword: pass\n```\n\n```\nShorten a URL:\n\ncurl -X 'POST' \\\n  'http://127.0.0.1:8000/shorten?url=haha.com' \\\n  -H 'accept: application/json' \\\n  -d ''\n```\n\n```\nResolve a shorten URL:\n\ncurl -X 'GET' \\\n  'http://127.0.0.1:8000/resolve/1Ie' \\\n  -H 'accept: application/json'\n```\n\n--------------\n\n\nWorking theory in brief\n```\n- Keeping the length of the shorten url to 7 digits as of now, with characters in range [0-9a-zA-Z] (total 62 characters). Which means total combinations possible 62^7 = 3.5 trillion combinations.\n- When the user calls `shorten` endpoint with there \"url\", we use a distributed counter and base62 encode it to generate a unique short url.\n- To maintain this distributed counter range - we use zookeeper.\n- Whenever a new service is added to the system or the counter range is exhausted, we use zookeeper to increment and get the next counter.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuperthinking%2Furl-shortener-playground","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuperthinking%2Furl-shortener-playground","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuperthinking%2Furl-shortener-playground/lists"}