{"id":22729469,"url":"https://github.com/bartzalewski/url-shortener","last_synced_at":"2025-06-27T18:37:49.699Z","repository":{"id":265710207,"uuid":"806706384","full_name":"bartzalewski/url-shortener","owner":"bartzalewski","description":"This is a simple service to shorten URLs, track clicks, and provide basic analytics.","archived":false,"fork":false,"pushed_at":"2024-05-27T18:18:10.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-22T01:42:48.853Z","etag":null,"topics":["go","golang","url-shortener"],"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/bartzalewski.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":"2024-05-27T18:17:52.000Z","updated_at":"2024-05-27T18:24:58.000Z","dependencies_parsed_at":"2024-12-02T07:15:34.616Z","dependency_job_id":null,"html_url":"https://github.com/bartzalewski/url-shortener","commit_stats":null,"previous_names":["bartzalewski/url-shortener"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bartzalewski/url-shortener","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartzalewski%2Furl-shortener","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartzalewski%2Furl-shortener/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartzalewski%2Furl-shortener/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartzalewski%2Furl-shortener/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bartzalewski","download_url":"https://codeload.github.com/bartzalewski/url-shortener/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartzalewski%2Furl-shortener/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262313587,"owners_count":23292167,"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":["go","golang","url-shortener"],"created_at":"2024-12-10T18:10:03.982Z","updated_at":"2025-06-27T18:37:49.674Z","avatar_url":"https://github.com/bartzalewski.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# URL Shortener API\n\nWelcome to the URL Shortener API! This is a simple service to shorten URLs, track clicks, and provide basic analytics.\n\n## Features\n\n- URL shortening\n- Redirection to original URLs\n- Click tracking and analytics\n\n## Getting Started\n\nFollow these instructions to get a copy of the project up and running on your local machine for development and testing purposes.\n\n### Prerequisites\n\nEnsure you have the following installed on your system:\n\n- [Go](https://golang.org/doc/install) (version 1.16+)\n- [Git](https://git-scm.com/)\n\n### Installation\n\n1. **Clone the repository**:\n\n   ```sh\n   git clone https://github.com/bartzalewski/url-shortener.git\n   cd url-shortener\n   ```\n\n2. **Initialize Go modules**:\n\n   ```sh\n   go mod tidy\n   ```\n\n3. **Run the application**:\n\n   ```sh\n   go run main.go\n   ```\n\nThe server will start on `http://localhost:8080`.\n\n## API Endpoints\n\n### URL Shortening\n\n- **Shorten URL**\n\n  `POST /shorten`\n\n  Request:\n\n  ```json\n  {\n    \"url\": \"https://www.example.com\"\n  }\n  ```\n\n  Response:\n\n  ```json\n  {\n    \"short_url\": \"http://localhost:8080/abc123\"\n  }\n  ```\n\n### URL Redirection\n\n- **Redirect to Original URL**\n\n  `GET /{shortCode}`\n\n  Example:\n\n  `GET /abc123`\n\n  Redirects to `https://www.example.com`\n\n### Analytics\n\n- **Get Click Analytics**\n\n  `GET /analytics/{shortCode}`\n\n  Example:\n\n  `GET /analytics/abc123`\n\n  Response:\n\n  ```json\n  {\n    \"clicks\": 10\n  }\n  ```\n\n## Built With\n\n- [Go](https://golang.org/) - The Go programming language\n- [Gorilla Mux](https://github.com/gorilla/mux) - A powerful URL router and dispatcher for Golang\n\n## Contributing\n\nFeel free to submit issues or pull requests. For major changes, please open an issue first to discuss what you would like to change.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Acknowledgments\n\n- Thanks to the Go community for their invaluable resources and support.\n- [Gorilla Mux](https://github.com/gorilla/mux) for making routing simple and efficient.\n\n---\n\nHappy coding! 🚀\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbartzalewski%2Furl-shortener","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbartzalewski%2Furl-shortener","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbartzalewski%2Furl-shortener/lists"}