{"id":26587899,"url":"https://github.com/borischen0203/url-shortener","last_synced_at":"2026-04-09T11:44:08.607Z","repository":{"id":46869918,"uuid":"379983347","full_name":"borischen0203/URL-shortener","owner":"borischen0203","description":"An URL shortener service. You can generate a short URL and make your alias of short URL.","archived":false,"fork":false,"pushed_at":"2022-07-19T18:54:35.000Z","size":68,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-03-10T11:41:17.530Z","etag":null,"topics":["docker","gin","gin-gonic","github-actions","golang","heroku-deployment","mongodb","rest-api","swagger"],"latest_commit_sha":null,"homepage":"","language":"Go","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/borischen0203.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-24T16:11:46.000Z","updated_at":"2022-04-21T00:26:52.000Z","dependencies_parsed_at":"2022-09-02T17:01:50.307Z","dependency_job_id":null,"html_url":"https://github.com/borischen0203/URL-shortener","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borischen0203%2FURL-shortener","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borischen0203%2FURL-shortener/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borischen0203%2FURL-shortener/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borischen0203%2FURL-shortener/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/borischen0203","download_url":"https://codeload.github.com/borischen0203/URL-shortener/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245104119,"owners_count":20561372,"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":["docker","gin","gin-gonic","github-actions","golang","heroku-deployment","mongodb","rest-api","swagger"],"created_at":"2025-03-23T12:31:15.505Z","updated_at":"2025-12-30T23:33:10.194Z","avatar_url":"https://github.com/borischen0203.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Gin gopher](https://raw.githubusercontent.com/scraly/gophers/main/mojito-gopher.png)\r\n\r\n[![CICD](https://github.com/borischen0203/URL-shortener/actions/workflows/CICD.yml/badge.svg)](https://github.com/borischen0203/URL-shortener/actions/workflows/CICD.yml)\r\n\r\n# URL-shortener service\r\nThis is a URL shortener service. You can generate a short URL by a long URL.\r\n Moreover, you can make your alias of short URL.\r\n\r\n## Features\r\n\r\n- Generate short URL by long URL\r\n- Redirect to long URL by generated URL\r\n- URL generation supports custom alias\r\n\r\n## Demo\r\n- No need to run main.go file, you can type the below command in the terminal directly.\r\n- The app may sleep without using. Just wait for a few seconds to wake it up.\r\n```bash\r\n\u003e curl -X POST -H \"Content-Type: application/json\" -d '{\"longUrl\" : \"https://www.youtube.com/\", \"alias\":\"\"}' \"https://short-url-sample.herokuapp.com/api/url-shortener/v1/url\"\r\n```\r\n\r\n## Project information and existing API\r\n- `GET`    /swagger/*any\r\n- `GET`    /health\r\n- `GET`    /version\r\n- `GET`    /:id\r\n- `POST`   /api/url-shortener/v1/url\r\n\r\n\r\n## How to run in local\r\n\r\n### Required\r\n\r\n- Golang\r\n- Gin framework \u003e= 1.7\r\n- Docker\r\n- MongoDB\r\n\r\n### Run\r\n```bash\r\n\u003e docker pull mongo:3.6\r\n\r\n\u003e docker run -p 27017:27017 mongo:3.6\r\n\r\n\u003e go run main.go\r\n```\r\n\r\n\r\n\r\n### Demo in local\r\n```bash\r\n\u003e curl -X POST -H \"Content-Type: application/json\" -d '{\"longUrl\" : \"https://www.youtube.com/\", \"alias\":\"\"}' \"http://localhost:8080/api/url-shortener/v1/url\"\r\n```\r\n\r\n\r\n\r\n\r\n### Tech Stack\r\n    - RESTful API\r\n    - Swagger\r\n    - Gin\r\n    - Golang\r\n    - MongoDB\r\n    - Docker\r\n    - Github action(CI)\r\n    - Heroku (CD)\r\n\r\n### Todo\r\n- [ ] mongoDB add expired time field\r\n- [ ] Add redis for cache\r\n- [ ] MockDB for testing\r\n- [ ] Deploy to AWS\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborischen0203%2Furl-shortener","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fborischen0203%2Furl-shortener","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborischen0203%2Furl-shortener/lists"}