{"id":16908921,"url":"https://github.com/saswatamcode/divert","last_synced_at":"2026-05-17T22:34:49.423Z","repository":{"id":103589364,"uuid":"303293746","full_name":"saswatamcode/divert","owner":"saswatamcode","description":"URL shortening service for DSC KIIT","archived":false,"fork":false,"pushed_at":"2020-10-27T02:49:09.000Z","size":7896,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-20T17:52:04.632Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":false,"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/saswatamcode.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-12T06:08:08.000Z","updated_at":"2021-04-16T14:57:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"79d9aee0-2443-416d-ba27-64b1997045dd","html_url":"https://github.com/saswatamcode/divert","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/saswatamcode/divert","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saswatamcode%2Fdivert","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saswatamcode%2Fdivert/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saswatamcode%2Fdivert/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saswatamcode%2Fdivert/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saswatamcode","download_url":"https://codeload.github.com/saswatamcode/divert/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saswatamcode%2Fdivert/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33157615,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T09:28:26.183Z","status":"ssl_error","status_checked_at":"2026-05-17T09:27:52.702Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":[],"created_at":"2024-10-13T18:53:32.551Z","updated_at":"2026-05-17T22:34:49.407Z","avatar_url":"https://github.com/saswatamcode.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# divert\n\nThe internal URL shortening service for DSC KIIT. Available on [r.dsckiit.gq](http://r.dsckiit.gq)\n\n## Get Started\n\n\u003cdiv align=\"center\"\u003e\n\t\u003cimg width=\"80%\" src=\"https://rawcdn.githack.com/DSC-KIIT/divert/3901160f6725451f31cee2fb70dcaded4bdd8bab/screenshot.png\"\u003e\t\n\u003c/div\u003e\n\nInstall the CLI tool to login and create short urls (only for members of DSC KIIT). The package is available on npm.\n\n```\nnpm i -g @dsckiit/divert\n```\n\nThis will install the `divert` command, just run `divert` in your terminal to start the cli tool.\n\n## Tech and Design\n\nThe long and short urls are stored in the database. The backend fetches the database every 3 minutes\nand updates a local in memory hashmap that maps the short urls to long urls. The redirect requests are directly served \nby accessing this in memory hashmap. We need that sweet O(1) access.\n\nThe process to fetch from the database runs on another thread (implemented using goroutines). \n`sync.RWMutex` is used to prevent data races on the in memory hashmap.\n\nThe backend service is written in Go. The CLI tool is written in Typescript.\n\n**Backend Dependencies**\n\n* github.com/dgrijalva/jwt-go v3.2.0\n* github.com/gorilla/mux v1.8.0\n* go.mongodb.org/mongo-driver v1.4.2\n\n**CLI Dependencies**\n\n* axios\n* boxen\n* chalk\n* configstore\n* inquirer\n* ora\n\n## License\n\nCopyright (c) **DSC KIIT**. All rights reserved. Licensed under the MIT License\n\n[![forthebadge](https://forthebadge.com/images/badges/made-with-go.svg)](https://forthebadge.com)\n[![forthebadge](https://forthebadge.com/images/badges/uses-js.svg)](https://forthebadge.com)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaswatamcode%2Fdivert","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaswatamcode%2Fdivert","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaswatamcode%2Fdivert/lists"}