{"id":25031883,"url":"https://github.com/lgraubner/url-shortener","last_synced_at":"2025-03-30T19:40:31.952Z","repository":{"id":69992648,"uuid":"138518955","full_name":"lgraubner/url-shortener","owner":"lgraubner","description":"URL shortener built with Laravel","archived":false,"fork":false,"pushed_at":"2018-09-09T07:00:47.000Z","size":1450,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T16:53:21.317Z","etag":null,"topics":["laravel","rest","rest-api","restful","shorturl","url-shortener"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/lgraubner.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":"2018-06-24T22:11:53.000Z","updated_at":"2024-06-18T10:24:10.000Z","dependencies_parsed_at":"2023-03-11T07:40:56.416Z","dependency_job_id":null,"html_url":"https://github.com/lgraubner/url-shortener","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/lgraubner%2Furl-shortener","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lgraubner%2Furl-shortener/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lgraubner%2Furl-shortener/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lgraubner%2Furl-shortener/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lgraubner","download_url":"https://codeload.github.com/lgraubner/url-shortener/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246372505,"owners_count":20766625,"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":["laravel","rest","rest-api","restful","shorturl","url-shortener"],"created_at":"2025-02-05T22:45:31.816Z","updated_at":"2025-03-30T19:40:31.946Z","avatar_url":"https://github.com/lgraubner.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laraval URL shortener\n\nThis package is a fully fledged url shortener. At the moment it provides a REST API only. The API is secured with JWT. There are (kinda unstyled) views for redirect events (not found, insecure).\n\n## Routes\n\n```\n+-------------+-----------+-------------------------+---------------+---------------------------------------------------------------------------+--------------+\n| Domain      | Method    | URI                     | Name          | Action                                                                    | Middleware   |\n+-------------+-----------+-------------------------+---------------+---------------------------------------------------------------------------+--------------+\n| api.lg.test | GET|HEAD  | health                  |               | App\\Http\\Controllers\\HealthController                                     | api          |\n|             | POST      | oauth/token             |               | Laravel\\Passport\\Http\\Controllers\\AccessTokenController@issueToken        | throttle     |\n|             | POST      | oauth/token/refresh     |               | Laravel\\Passport\\Http\\Controllers\\TransientTokenController@refresh        | web,auth     |\n|             | GET|HEAD  | oauth/tokens            |               | Laravel\\Passport\\Http\\Controllers\\AuthorizedAccessTokenController@forUser | web,auth     |\n|             | DELETE    | oauth/tokens/{token_id} |               | Laravel\\Passport\\Http\\Controllers\\AuthorizedAccessTokenController@destroy | web,auth     |\n| api.lg.test | GET|HEAD  | v1/links                | links.index   | App\\Http\\Controllers\\LinkController@index                                 | api,auth:api |\n| api.lg.test | POST      | v1/links                | links.store   | App\\Http\\Controllers\\LinkController@store                                 | api,auth:api |\n| api.lg.test | GET|HEAD  | v1/links/{id}/clicks    |               | App\\Http\\Controllers\\MetricsController@clicks                             | api,auth:api |\n| api.lg.test | GET|HEAD  | v1/links/{id}/info      |               | App\\Http\\Controllers\\LinkInfoController                                   | api,auth:api |\n| api.lg.test | GET|HEAD  | v1/links/{id}/referrers |               | App\\Http\\Controllers\\MetricsController@referrers                          | api,auth:api |\n| api.lg.test | PUT|PATCH | v1/links/{link}         | links.update  | App\\Http\\Controllers\\LinkController@update                                | api,auth:api |\n| api.lg.test | DELETE    | v1/links/{link}         | links.destroy | App\\Http\\Controllers\\LinkController@destroy                               | api,auth:api |\n| api.lg.test | GET|HEAD  | v1/links/{link}         | links.show    | App\\Http\\Controllers\\LinkController@show                                  | api,auth:api |\n| api.lg.test | POST      | v1/login                |               | App\\Http\\Controllers\\AuthController@login                                 | api          |\n| api.lg.test | POST      | v1/logout               |               | App\\Http\\Controllers\\AuthController@logout                                | api,auth:api |\n| api.lg.test | GET|HEAD  | v1/me                   |               | App\\Http\\Controllers\\AuthController@me                                    | api,auth:api |\n| api.lg.test | POST      | v1/register             |               | App\\Http\\Controllers\\AuthController@register                              | api          |\n|             | GET|HEAD  | {hash}                  |               | App\\Http\\Controllers\\RedirectController                                   | web          |\n+-------------+-----------+-------------------------+---------------+---------------------------------------------------------------------------+--------------+\n```\n\n## Features\n\n### Statistic\n\nEvery time a shortened link is visited and redirects it collects some statistics. This statistics include the following data:\n\n- referrer\n- date\n\n### Safe browsing check\n\nWhen enabled each shortened link is checked by [Google Safe Browsing](https://developers.google.com/safe-browsing/). If considered harmful the link is flagged and an \"unsafe\" page is shown before redirecting.\n\nTo enable this feature add `SAFE_CHECK=true` inside your `.env` file.\n\n### Page crawling\n\nWhen enabled each shortened link gets crawled and certain details are safed in the database.\n\nThe data collected is as follows:\n\n- http_status\n- url\n- url_fetched\n- domain\n- html_title\n- content_type\n- content_length\n\nTo enable this feature add `CRAWL_PAGES=true` inside your `.env` file.\n\n## Frontend\n\nIf you want to build a front-end for additional pages, or modify the 404 and unsafe page you can use tailwind.css. The build process will optimize and create distribution files. The file names include a hash to avoid caching problems and are imported in the pages automatically.\n\n```\n# create development files (includes all tailwind classes)\nnpm run dev\n\n# creates dev files and watches for changes\nnpm run watch\n\n# create production files\nnpm run build\n\n# check if file size is ok (can be configured in package.json)\n```\n\nBefore commiting eslint and prettier are executed on the commited files.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flgraubner%2Furl-shortener","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flgraubner%2Furl-shortener","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flgraubner%2Furl-shortener/lists"}