{"id":15024011,"url":"https://github.com/xsavitar/url-shortener","last_synced_at":"2025-10-03T22:31:09.727Z","repository":{"id":91903696,"uuid":"65664307","full_name":"xSavitar/url-shortener","owner":"xSavitar","description":"This is a URL shortener application built using PHP and MySQL database MS.","archived":true,"fork":false,"pushed_at":"2018-12-05T07:45:43.000Z","size":240,"stargazers_count":8,"open_issues_count":1,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-09-29T19:23:15.922Z","etag":null,"topics":["ajax","ajax-request","css3","html5","javascript","mysqli","php","php56","url-shortener"],"latest_commit_sha":null,"homepage":"https://tools.wmflabs.org/durl-shortener/shortener.php","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/xSavitar.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":"2016-08-14T12:03:25.000Z","updated_at":"2023-04-01T12:39:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"c94e0c90-d730-4deb-8bff-ab1a7db5df9e","html_url":"https://github.com/xSavitar/url-shortener","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xSavitar%2Furl-shortener","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xSavitar%2Furl-shortener/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xSavitar%2Furl-shortener/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xSavitar%2Furl-shortener/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xSavitar","download_url":"https://codeload.github.com/xSavitar/url-shortener/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235198507,"owners_count":18951503,"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":["ajax","ajax-request","css3","html5","javascript","mysqli","php","php56","url-shortener"],"created_at":"2024-09-24T19:59:42.352Z","updated_at":"2025-10-03T22:31:04.446Z","avatar_url":"https://github.com/xSavitar.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# URL Shortener app with PHP + MySQL / MariaDB\n\nA mini/micro project meant for URL shortening using PHP \u0026 MySQL as DBMS.\n\n\n# Setting up project locally / production\n\n\n## Clone the repository;\n\nNOTE: Make sure to navigate to your web-server directory (for example `/var/www/html` for Ubuntu OS)\n\n```shell\ngit clone https://github.com/ch3nkula/url-shortener.git\n```\n\n\n## Install dependencies for the project;\n\n```shell\ncomposer update\n```\n\nNOTE: You must have `composer` installed for this to work. To install `composer`, check [the official website](https://getcomposer.org/download/).\n\n\n## Setup database \u0026 it's credentials;\n\n1. Import the `urls.sql` database schema to your database (with name `url_shortener`). You can import using phpMyAdmin or Command-Line for MySQL. Once you import this schema, move straight to setting up credentials.\n\n2. Duplicate the file called `.env.example` and rename the duplicate copy to `.env`\n\n```shell\ncp .env.example .env\n```\n\n3. In the `.env` file, there are two sections, one for local config and the other for production configs. Fill the section for local configs for example;\n\n```\nLOCAL_DB_HOST=\u003chost-name\u003e\nLOCAL_DB_USER=\u003cdatabase-user\u003e\nLOCAL_DB_PASSWORD=\u003cdatabase-password\u003e\nLOCAL_DB_NAME=\u003cdatabase-name\u003e\n```\n\n\n## Run / Test the application locally\n\nOnce you are done with the steps above, try to run and test the application using PHP's in-built server.\n\n1. Run the application by typing and executing the command below;\n\n```shell\nphp -S localhost:3000\n```\n\nNOTE: It's important to use port `3000` as it's used in the application.\n\n2. Move over to your favorite browser, mine is `Google Chrome` or `Safari` and test the application by typing in the address bar; `https://localhost:3000`. \n\nIf things work as expected, then you should see this on your browser\n\n![alt text](assets/running-application.png)\n\n\n## Final Step\n\nIf you see the above image, then you are almost there, try pasting a long URL in the form field and see if the app generates a short URL (see image below). If you get a short URL, then it work well. Enjoy!\n\n![alt text](assets/shortening-url.png)\n\n\n## License\n\nMIT License","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxsavitar%2Furl-shortener","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxsavitar%2Furl-shortener","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxsavitar%2Furl-shortener/lists"}