{"id":19166493,"url":"https://github.com/xanonymous-github/sxcctw","last_synced_at":"2026-05-15T18:02:54.787Z","repository":{"id":56735329,"uuid":"461442210","full_name":"Xanonymous-GitHub/sxcctw","owner":"Xanonymous-GitHub","description":"An URL shortener. Front-end is still inprogress, because backend is still inprogress too 🥺.","archived":false,"fork":false,"pushed_at":"2023-12-15T01:06:32.000Z","size":705,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-03T22:44:00.096Z","etag":null,"topics":["golang","inprogress"],"latest_commit_sha":null,"homepage":"https://s.xcc.tw","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/Xanonymous-GitHub.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":"2022-02-20T09:39:10.000Z","updated_at":"2023-05-22T06:14:10.000Z","dependencies_parsed_at":"2023-12-15T02:30:48.527Z","dependency_job_id":"8a42930f-2f52-488c-a261-b5d87a0545b2","html_url":"https://github.com/Xanonymous-GitHub/sxcctw","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xanonymous-GitHub%2Fsxcctw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xanonymous-GitHub%2Fsxcctw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xanonymous-GitHub%2Fsxcctw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xanonymous-GitHub%2Fsxcctw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Xanonymous-GitHub","download_url":"https://codeload.github.com/Xanonymous-GitHub/sxcctw/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240246720,"owners_count":19771170,"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":["golang","inprogress"],"created_at":"2024-11-09T09:33:12.948Z","updated_at":"2026-05-15T18:02:49.752Z","avatar_url":"https://github.com/Xanonymous-GitHub.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple URL Shortener on Xanonymous Core Cell.\n\nIt is An URL shortener.\n\n[![Service Build](https://github.com/Xanonymous-GitHub/sxcctw/actions/workflows/go.yml/badge.svg)](https://github.com/Xanonymous-GitHub/sxcctw/actions/workflows/go.yml)\n[![Web Build](https://github.com/Xanonymous-GitHub/sxcctw/actions/workflows/web.yml/badge.svg)](https://github.com/Xanonymous-GitHub/sxcctw/actions/workflows/web.yml)\n[![API Image](https://github.com/Xanonymous-GitHub/sxcctw/actions/workflows/docker-publish-sxcctw-api.yml/badge.svg)](https://github.com/Xanonymous-GitHub/sxcctw/actions/workflows/docker-publish-sxcctw-api.yml)\n[![DB Image](https://github.com/Xanonymous-GitHub/sxcctw/actions/workflows/docker-publish-sxcctw-db.yml/badge.svg)](https://github.com/Xanonymous-GitHub/sxcctw/actions/workflows/docker-publish-sxcctw-db.yml)\n\nBUT STILL DEVELOPED IN PROGRESS. Please go back here to see the changes later.\n\n## Try it now\n\n1. Create your shortened URL.\n\n```shell\ncurl --location --request POST 'https://s.xcc.tw/api/url' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n    \"originUrl\": \"https://www.dcard.tw/f/mood/p/238545781?cid=306EA5A4-D67F-41A8-903F-1456E8FDE547\",\n    \"expireAt\": \"2034-11-12T11:45:26.371Z\"\n}'\n```\n\n2. Then use it\n\n```shell\n# Go to this URL.\nhttps://s.xcc.tw/s/v5oSt3VFD1l\n```\n\n## TODOS\n\n- [ ] Add redis. (In progress...)\n- [ ] Add openAPI3 doc.\n- [ ] Add k8s yaml.\n- [ ] Add LB, Grafana, ArgoCD\n- [ ] Consider not use base62 (KGS, or else...??)\n- [ ] Add tests.\n- [ ] cronjob (maybe)\n\n## Get started\n\n1. Ensure using go 1.19.\n\n```shell\n# go version go1.19\ngo version\n```\n\n2. install dependencies.\n\n```shell\ngo install github.com/silenceper/gowatch@latest\n```\n\nIf you want to re-generate the gRPC files, please install these\n\n```shell\ngo install google.golang.org/protobuf/cmd/protoc-gen-go@latest \\\n\u0026\u0026 go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest \\\n\u0026\u0026 go install entgo.io/contrib/entproto/cmd/protoc-gen-entgrpc@latest\n```\n\nAnd do this:\n\n```shell\ngo generate ./...\n```\n\n3. start a MySQL DB.\n\n```shell\n# For example, use docker\ndocker run --name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=sxcctw -d mysql\n```\n\n4. start `sxcctw db` server.\n\n```shell\n./scripts/watchgo.sh sxcctw_db\n```\n\n5. start `sxcctw api` server.\n\n```shell\n./scripts/watchgo.sh sxcctw_api\n```\n\n## How to use? (for development)\n\n(openAPI doc TBD)\n\n#### Create new ID. (201 Created)\n\n```shell\n# Create a shortened id, which is from `https://ntut/club`,\n# and set expire time at `2034-11-12T11:45:26.371Z`.\ncurl --location --request POST 'localhost:8080/api/url' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n    \"originUrl\": \"https://ntut/club\",\n    \"expireAt\": \"2034-11-12T11:45:26.371Z\"\n}'\n```\n\n#### Get URL by existed ID. (200 OK / 404 Not Found / 410 Gone)\n\n```shell\n# Get an existing shortened id (ZNkw23qpiss).\ncurl --location --request GET 'localhost:8080/api/url?id=ZNkw23qpiss'\n```\n\n## Why I choose (TBD)\n\n- MySQL\n- Gin\n- Gorm\n- gRPC\n- Clean Architecture\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxanonymous-github%2Fsxcctw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxanonymous-github%2Fsxcctw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxanonymous-github%2Fsxcctw/lists"}