{"id":29484869,"url":"https://github.com/wenzzy/go-ushort","last_synced_at":"2026-05-04T09:31:38.672Z","repository":{"id":181856209,"uuid":"667399574","full_name":"Wenzzy/go-ushort","owner":"Wenzzy","description":"URL shorter","archived":false,"fork":false,"pushed_at":"2023-08-01T13:38:18.000Z","size":20324,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-08T05:56:05.719Z","etag":null,"topics":["ci-cd","db-diagram","gin","github-actions","golang","goose","gorm","grafana","jwt-authentication","logrus","metrics","prometheus","swaggo","testing","victoriametrics","viper"],"latest_commit_sha":null,"homepage":"https://go-ushort.vercel.app","language":"Go","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/Wenzzy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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}},"created_at":"2023-07-17T12:18:48.000Z","updated_at":"2024-10-01T11:35:19.000Z","dependencies_parsed_at":"2024-01-04T13:50:08.063Z","dependency_job_id":null,"html_url":"https://github.com/Wenzzy/go-ushort","commit_stats":{"total_commits":14,"total_committers":1,"mean_commits":14.0,"dds":0.0,"last_synced_commit":"91b34c3eca18cbb7f5833a8d0e593d124514afbb"},"previous_names":["wenzzyx/go-ushorter","wenzzyx/go-ushort","wenzzy/go-ushort"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/Wenzzy/go-ushort","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wenzzy%2Fgo-ushort","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wenzzy%2Fgo-ushort/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wenzzy%2Fgo-ushort/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wenzzy%2Fgo-ushort/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Wenzzy","download_url":"https://codeload.github.com/Wenzzy/go-ushort/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wenzzy%2Fgo-ushort/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31753551,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T09:16:15.125Z","status":"ssl_error","status_checked_at":"2026-04-13T09:16:05.023Z","response_time":93,"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":["ci-cd","db-diagram","gin","github-actions","golang","goose","gorm","grafana","jwt-authentication","logrus","metrics","prometheus","swaggo","testing","victoriametrics","viper"],"created_at":"2025-07-15T05:02:15.823Z","updated_at":"2026-04-13T13:01:39.257Z","avatar_url":"https://github.com/Wenzzy.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n \u003cimg src='assets/logo.jpg' width='500'\u003e\n\u003c/p\u003e\n\n[![CI-CD pipeline](https://github.com/WenzzyX/go-ushort/actions/workflows/ci-cd.production.yml/badge.svg)](https://github.com/WenzzyX/go-ushort/actions/workflows/ci-cd.production.yml)\n\u0026nbsp;\\\nMy pet project that shortens long links ;)\\\n\u0026nbsp;\\\nFront-end: [go-ushort](https://github.com/WenzzyX/frontend-ushort)\\\nDesign: [figma](https://www.figma.com/community/file/1267929060708092881)\n\u0026nbsp;\\\n\u0026nbsp;\\\n_`https://very-long-site-subdomain.long-domain-ffff.com/my-best-blog`_ \\\n-\u003e `https://ushort.us/7R`\n\n## Todo\n\n- [x] JWT Authentication (access,refresh)\n- [x] Create/update link by user\n- [x] Configure JSON-only logger on IsProduction mode\n- [x] Create script (alias) for migration creation\n- [x] Add pagination for links\n- [x] Add a collection of metrics and a dashboard to monitor them (prom-app -\u003e victoriametrics -\u003e grafana)\n- [x] Add LICENSE\n- [x] Write tests\n- [x] Write the rules for making a contribution\n- [x] Change db diagram svg generation (replace images)\n- [x] Configure CI/CD\n- [x] Configure dev_full docker-compose\n- [x] Configure deploy (render.com)\n- [x] Link domain\n- [ ] Configure git-crypt\n\nFor simple run scripts - make alias `alias gr=\"sh run.sh\"`\n\n### General\n\n```shell\ngr\n# or `sh run.sh`\n# Get list of scripts and description for each script\n```\n\n```shell\ndocker build . \\\n\t--platform=linux/amd64 \\\n\t-t go-ushort \\\n\t--build-arg NEXT_PUBLIC_USHORT_DOMAIN=\"ushort.us\"\n# build for amd64\n\ndocker build . -t go-ushort\n# build docker image\n```\n\n```shell\ndocker rm go-ushort \u0026\u0026 \\\ndocker run -it -p 5005:8000 \\\n\t--name go-ushort \\\n\t-e ALLOWED_ORIGINS=\"https://go-ushort.vercel.app\" \\\n\t-e DB_HOST=\"localhost\" \\\n\t-e DB_NAME=\"ushorter\" \\\n\t-e DB_PASS=\"dev\" \\\n\t-e DB_PORT=\"5432\" \\\n\t-e DB_USER=\"dev_user\" \\\n\t-e DOMAIN=\"ushort.us\" \\\n\t-e IS_DEBUG=\"false\" \\\n\t-e IS_ENABLE_PROM=\"false\" \\\n\t-e IS_PRODUCTION=\"true\" \\\n\t-e JWT_ACCESS_EXP_TIME=\"1m\" \\\n\t-e JWT_ACCESS_SECRET=\"ocSbpF5qQjBbutPR85g7VHfQn1v7dGYO0IVEoH9xq2hmWDa6bVxX8NWk6OcpdEZN\" \\\n\t-e JWT_REFRESH_EXP_TIME=\"30d\" \\\n\t-e JWT_REFRESH_SECRET=\"mwgqOZsFf8hWNdOtbKQQLGPhwWXQQQ0hHOKZvypj82uJuENwjNPqXLBMdKRYsqBq\" \\\n\t-e MIGRATIONS_PATH=\"./migraions\" \\\n\tgo-ushort \\\n\t\u0026\u0026 docker logs -f go-ushort\n# run docker container\n```\n\n### Environment\n\n#### Server config\n\n| param                     | type      | required | default   | description                                                      |\n| ------------------------- | --------- | -------- | --------- | ---------------------------------------------------------------- |\n| `JWT_ACCESS_SECRET`       | `string`  | `yes`    | `-`       | Secret for generating accessToken                                |\n| `JWT_ACCESS_EXP_TIME`     | `string`  | `yes`    | `-`       | life duration of accessToken (ex.: \"20s\", \"2d\")                  |\n| `JWT_REFRESH_SECRET`      | `string`  | `yes`    | `-`       | Secret for generating refreshToken                               |\n| `JWT_REFRESH_EXP_TIME`    | `string`  | `yes`    | `-`       | life duration of accessToken (ex.: \"20s\", \"2d\")                  |\n| `IS_PRODUCTION`           | `boolean` | `no`     | `true`    | Run-mode is production? (ex.: \"true\")                            |\n| `IS_DEBUG`                | `boolean` | `no`     | `false`   | Print sensitive info and prettify log messages? (ex.: \"true\")    |\n| `IS_ENABLE_PROM`          | `boolean` | `no`     | `false`   | Enable prometheus? (ex.: \"false\")                                |\n| `DOMAIN`                  | `string`  | `yes`    | `-`       | Domain for setting cookies (ex.: \"localhost\")                    |\n| `ALLOWED_HOSTS`           | `string`  | `no`     | `0.0.0.0` | Hosts who can send requst to server (ex.: \"0.0.0.0,192.168.1.1\") |\n| `ALLOWED_ORIGINS`         | `string`  | `no`     | `*`       | CORS - origin (ex.: \"https://ushort.us,http://localhost:3000\")   |\n| `SERVER_HOST`             | `string`  | `no`     | `0.0.0.0` | Host, where server will run (ex.: \"0.0.0.0\")                     |\n| `LIMIT_COUNT_PER_REQUEST` | `int`     | `no`     | `10`      | _Temporarly not using_                                           |\n\n\u0026nbsp;\\\n\u0026nbsp;\n\n#### Database config\n\n| param             | type      | required | default                            | description                                                      |\n| ----------------- | --------- | -------- | ---------------------------------- | ---------------------------------------------------------------- |\n| `DB_NAME`         | `string`  | `yes`    | `-`                                | DB name                                                          |\n| `DB_USER`         | `string`  | `yes`    | `-`                                | DB user                                                          |\n| `DB_PASS`         | `string`  | `yes`    | `-`                                | DB password                                                      |\n| `DB_HOST`         | `string`  | `no`     | `localhost`                        | DB host (ex.: \"localhost\")                                       |\n| `DB_PORT`         | `int`     | `no`     | `5432`                             | DB port (ex.: \"5432\")                                            |\n| `DB_LOG_MODE`     | `boolean` | `no`     | `false`                            | Output SQL and other query information? (ex.: \"true\")            |\n| `DB_SSL_MODE`     | `string`  | `no`     | `false`                            | Use SSL mode (ex.: \"disable\", \"enable\")                          |\n| `MIGRATIONS_PATH` | `string`  | `no`     | `./app/common/database/migrations` | Migrations folder path (ex.: \"./app/common/database/migrations\") |\n\n### Database diagram\n\n![DB-diagram image](assets/db-diagram/summary/relationships.real.large.svg)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwenzzy%2Fgo-ushort","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwenzzy%2Fgo-ushort","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwenzzy%2Fgo-ushort/lists"}