{"id":28340651,"url":"https://github.com/supratimrk/url_shortener","last_synced_at":"2026-05-01T18:31:45.484Z","repository":{"id":240135038,"uuid":"801747041","full_name":"SupratimRK/url_shortener","owner":"SupratimRK","description":"A modern and scalable URL shortener application built with PHP and MySQL. This web app lets you shorten long URLs into compact, custom short codes and retrieve the original links seamlessly. Perfect for both personal use and production-scale deployment!","archived":false,"fork":false,"pushed_at":"2025-04-11T07:23:46.000Z","size":126,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-03T14:48:47.505Z","etag":null,"topics":["backend","backend-server","live","mysql","php","simple-backend","url-shortener","url-shortner"],"latest_commit_sha":null,"homepage":"https://xrl.rf.gd","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/SupratimRK.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,"zenodo":null}},"created_at":"2024-05-16T20:45:12.000Z","updated_at":"2025-04-11T12:48:57.000Z","dependencies_parsed_at":"2024-05-16T23:29:32.723Z","dependency_job_id":"cbae4357-412f-4c54-9940-943b4e4d7767","html_url":"https://github.com/SupratimRK/url_shortener","commit_stats":null,"previous_names":["supratimrk/url_shortener"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SupratimRK/url_shortener","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SupratimRK%2Furl_shortener","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SupratimRK%2Furl_shortener/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SupratimRK%2Furl_shortener/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SupratimRK%2Furl_shortener/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SupratimRK","download_url":"https://codeload.github.com/SupratimRK/url_shortener/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SupratimRK%2Furl_shortener/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32508900,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["backend","backend-server","live","mysql","php","simple-backend","url-shortener","url-shortner"],"created_at":"2025-05-27T03:26:04.887Z","updated_at":"2026-05-01T18:31:45.478Z","avatar_url":"https://github.com/SupratimRK.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🌐 URL Shortener  \n\nA **modern and scalable** URL shortener application built with **PHP** and **MySQL**. This web app lets you shorten long URLs into compact, custom short codes and retrieve the original links seamlessly. Perfect for both personal use and production-scale deployment!  \n\n---\n\n## 🚀 Features  \n\n- ✂️ **Shorten Long URLs**  \n  Convert lengthy URLs into concise, easy-to-share short codes.  \n- 🎨 **Custom Short Codes**  \n  Personalize your short codes for brand recognition.  \n- 🔗 **Seamless Redirection**  \n  Automatically redirect users from short codes to original URLs.  \n- 🔍 **Duplicate Detection**  \n  Checks if a URL has already been shortened.  \n\n---\n\n## 📋 Prerequisites  \n\n- 🖥️ **PHP** (\u003e= 7.0)  \n- 🗄️ **MySQL** or **MariaDB**  \n- 🌐 **Web Server** (e.g., Apache)  \n- 📦 **Composer** (for dependency management)  \n\n---\n\n## ⚙️ Installation  \n\n### 1️⃣ Clone the Repository  \n\n```bash  \ngit https://github.com/SupratimRK/url_shortener.git \ncd url-shortener  \n```  \n\n### 2️⃣ Set Up the Database  \n\n1. **Create the database:**  \n\n```sql  \nCREATE DATABASE url_shortener;  \n```  \n\n2. **Create the table:**  \n\n```sql  \nUSE url_shortener;  \n\nCREATE TABLE urls (  \n    id INT AUTO_INCREMENT PRIMARY KEY,  \n    original_url VARCHAR(255) NOT NULL,  \n    short_code VARCHAR(10) NOT NULL UNIQUE  \n);  \n```  \n\n3. **(Optional) Insert sample data:**  \n\n```sql  \nINSERT INTO urls (original_url, short_code) VALUES  \n('https://www.example.com', 'exmpl'),  \n('https://www.anotherexample.com', 'anothr');  \n```  \n\n---\n\n### 3️⃣ Configure the Application  \n\n1. **Create a `config.php` file in the root directory:**  \n\n```php  \n\u003c?php  \n// MySQL connection parameters  \n$servername = \"yourhost\";  \n$username = \"yourusername\";  \n$password = \"yourpassword\";  \n$database = \"url_shortener\";  \n\n$conn = new mysqli($servername, $username, $password, $database);  \n\nif ($conn-\u003econnect_error) {  \n    die(\"Connection failed: \" . $conn-\u003econnect_error);  \n}  \n?\u003e  \n```  \n\n2. **Include `config.php` in `index.php`:**  \n\n```php  \n\u003c?php  \ninclude 'config.php';  \n// ... rest of the code  \n?\u003e  \n```  \n\n---\n\n### 4️⃣ Set Up the Web Server  \n\n1. **Apache Configuration:**  \n\n```apache  \n\u003cVirtualHost *:80\u003e  \n    ServerAdmin webmaster@localhost  \n    DocumentRoot \"path_to_your_project_directory\"  \n    ServerName url-shortener.local  \n\n    \u003cDirectory \"path_to_your_project_directory\"\u003e  \n        Options Indexes FollowSymLinks  \n        AllowOverride All  \n        Require all granted  \n    \u003c/Directory\u003e  \n\n    ErrorLog ${APACHE_LOG_DIR}/error.log  \n    CustomLog ${APACHE_LOG_DIR}/access.log combined  \n\u003c/VirtualHost\u003e  \n```  \n\n2. **Update Hosts File:**  \n\n```plaintext  \n127.0.0.1 url-shortener.local  \n```  \n\n3. **Restart Apache:**  \n\n```bash  \nsudo service apache2 restart  \n```  \n\n---\n\n### 5️⃣ Access the Application  \n\n🌐 Open your browser and visit: **`http://url-shortener.local`**  \n\n---\n\n## 🎉 Usage  \n\n1. **Shorten a URL:**  \n   - Enter your URL in the input field.  \n   - (Optional) Add a custom short code.  \n   - Hit the \"Shorten\" button.  \n\n2. **Retrieve the Original URL:**  \n   - Access the short code in your browser (e.g., `http://url-shortener.local?x=shortcode`).  \n   - The app redirects to the original URL if the code exists.  \n\n---\n## 📸 Screenshot of the App\n\nHere is a screenshot of the URL shortener in action:\n\n![Screenshot](sample/01.png)\n![Screenshot](sample/02.png)\n\n---\n## 📜 License  \n\n🔓 This project is licensed under the **MIT License**. Check the [LICENSE](LICENSE) file for details.  \n\n---\n\n## 🤝 Contributing  \n\nWe welcome contributions! Whether it's bug fixes, feature enhancements, or new ideas, feel free to:  \n- 🛠️ Submit a Pull Request  \n- 🐛 Open an Issue  \n\nLet’s make this project even better together!  \n\n---\n\n## 📧 Contact  \n\nFor inquiries, feedback, or support, reach out to **[supratimrk@outlook.com](mailto:supratimrk@outlook.com)**.  \n\n---\n\n💡 **Demo the Application Now:**  \n- **🌍 Production:** [N/A](N/A)  \n- **⚙️ Development:** [xrl.rf.gd](https://xrl.rf.gd)  \n\n**Visit and explore the app live:** [xrl.rf.gd](https://xrl.rf.gd/)  \n\n---\n\n⭐ **Don’t forget to give a star on GitHub if you like it!**  \nLet me know your thoughts, and feel free to fork the repo for your custom needs! 😊  ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsupratimrk%2Furl_shortener","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsupratimrk%2Furl_shortener","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsupratimrk%2Furl_shortener/lists"}