{"id":25761988,"url":"https://github.com/telman03/go-url-shortener","last_synced_at":"2026-05-03T17:32:05.012Z","repository":{"id":279500956,"uuid":"939022918","full_name":"telman03/go-url-shortener","owner":"telman03","description":"A high-performance URL shortener built with Golang (Fiber), PostgreSQL, and Redis for caching. It supports click tracking for analytics, and is designed with scalability in mind.","archived":false,"fork":false,"pushed_at":"2025-02-25T21:49:45.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-02T17:44:55.292Z","etag":null,"topics":["docker-compose","fiber","go","postgresql","redis"],"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/telman03.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}},"created_at":"2025-02-25T21:41:10.000Z","updated_at":"2025-02-25T21:49:48.000Z","dependencies_parsed_at":"2025-02-25T22:40:30.096Z","dependency_job_id":null,"html_url":"https://github.com/telman03/go-url-shortener","commit_stats":null,"previous_names":["telman03/go-url-shortener"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/telman03/go-url-shortener","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telman03%2Fgo-url-shortener","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telman03%2Fgo-url-shortener/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telman03%2Fgo-url-shortener/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telman03%2Fgo-url-shortener/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/telman03","download_url":"https://codeload.github.com/telman03/go-url-shortener/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telman03%2Fgo-url-shortener/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32578578,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T06:36:36.687Z","status":"ssl_error","status_checked_at":"2026-05-03T06:36:09.306Z","response_time":103,"last_error":"SSL_read: 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":["docker-compose","fiber","go","postgresql","redis"],"created_at":"2025-02-26T19:27:22.144Z","updated_at":"2026-05-03T17:32:04.994Z","avatar_url":"https://github.com/telman03.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# URL Shortener\u0026#x20;\n\n## 📌 Overview\n\nThis is a high-performance **URL shortener** built with **Golang (Fiber)**, **PostgreSQL**, **Redis**, and **Docker**. It allows users to shorten long URLs, track click analytics, and retrieve stored URLs efficiently.\n\n## 🚀 Features\n\n- **Shorten URLs**: Generate a unique short code for any long URL.\n- **Redirect to Original URL**: Use the short code to access the original link.\n- **Caching with Redis**: Improve performance by caching URLs.\n- **Analytics Tracking**: Monitor how many times a short URL has been accessed.\n\n\n\n## 🏗 Tech Stack\n\n- **Golang (Fiber)** - Fast and lightweight web framework\n- **PostgreSQL** - Database for storing URLs\n- **Redis** - Caching layer for fast lookups\n- **Docker \u0026 Docker Compose** - Containerized deployment\n\n## 📦 Installation \u0026 Setup\n\n### 1️⃣ Clone the Repository\n\n```sh\ngit clone https://github.com/telman03/go-url-service.git\ncd go-url-service\n```\n\n### 2️⃣ Set Up Environment Variables\n\nCreate a `.env` file and configure the database \u0026 Redis:\n\n```env\nDATABASE_URL=postgres://user:password@localhost:5432/urlshortener\nREDIS_ADDR=localhost:6379\n```\n\n### 3️⃣ Run Redis \u0026 PostgreSQL using Docker\n\n```sh\ndocker-compose up -d redis postgres\n```\n\n### 4️⃣ Run the Service\n\n```sh\ngo run main.go\n```\n\n## 📡 API Endpoints\n\n### 1️⃣ Shorten a URL\n\n```http\nPOST /api/shorten\n```\n\n**Request Body:**\n\n```json\n{\n  \"url\": \"https://example.com\"\n}\n```\n\n**Response:**\n\n```json\n{\n  \"short_url\": \"http://localhost:8080/abc123\"\n}\n```\n\n### 2️⃣ Redirect to Original URL\n\n```http\nGET /:shortcode\n```\n\nExample: `GET http://localhost:8080/abc123` → Redirects to `https://example.com`\n\n### 3️⃣ Get URL Analytics\n\n```http\nGET /api/stats/:shortcode\n```\n\n**Response:**\n\n```json\n{\n  \"shortcode\": \"abc123\",\n  \"clicks\": 10\n}\n```\n\n## 🛠️ Future Improvements\n\n- 🔑 **User authentication** to manage links\n- 📅 **URL expiration feature**\n- 📊 **Admin dashboard** for analytics\n- 🌍 **Custom domains support**\n\n---\n\n💡 **Contributions are welcome!** Feel free to open an issue or submit a pull request. 🚀\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftelman03%2Fgo-url-shortener","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftelman03%2Fgo-url-shortener","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftelman03%2Fgo-url-shortener/lists"}