{"id":17793511,"url":"https://github.com/devashish2024/cutyoururl","last_synced_at":"2025-10-09T18:19:48.098Z","repository":{"id":270088189,"uuid":"773112311","full_name":"devashish2024/CutYourURL","owner":"devashish2024","description":"Fully-featured bitly URL Shortener Clone","archived":true,"fork":false,"pushed_at":"2024-04-24T19:28:59.000Z","size":13103,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-09T18:19:47.587Z","etag":null,"topics":["bitly","clone","collaborate","flask","github","github-copilot","github-pages","jetbrains","python","qrcode","shortener","sql","sqlite3","student-vscode","tech","url","urls","urlshort"],"latest_commit_sha":null,"homepage":"https://cutyour-url.netlify.app/","language":"Jinja","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/devashish2024.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING","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":"2024-03-16T19:28:26.000Z","updated_at":"2025-06-10T20:00:13.000Z","dependencies_parsed_at":"2024-12-28T11:15:20.954Z","dependency_job_id":null,"html_url":"https://github.com/devashish2024/CutYourURL","commit_stats":null,"previous_names":["devashish2024/cutyoururl"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/devashish2024/CutYourURL","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devashish2024%2FCutYourURL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devashish2024%2FCutYourURL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devashish2024%2FCutYourURL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devashish2024%2FCutYourURL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devashish2024","download_url":"https://codeload.github.com/devashish2024/CutYourURL/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devashish2024%2FCutYourURL/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001945,"owners_count":26083226,"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","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"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":["bitly","clone","collaborate","flask","github","github-copilot","github-pages","jetbrains","python","qrcode","shortener","sql","sqlite3","student-vscode","tech","url","urls","urlshort"],"created_at":"2024-10-27T11:11:27.154Z","updated_at":"2025-10-09T18:19:48.071Z","avatar_url":"https://github.com/devashish2024.png","language":"Jinja","funding_links":["https://patreon.com/ashish_agarwal"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\r\n  \u003ca href=\"https://cutyoururl.pythonanywhere.com\" rel=\"noopener\"\u003e\r\n \u003cimg width=200px height=200px src=\"static/CutYourURL.png\" alt=\"CutYourURL Logo\"\u003e\u003c/a\u003e\r\n\u003c/p\u003e\r\n\u003ch3 align=\"center\"\u003eCutYourURL\u003c/h3\u003e\r\n\u003cp align=\"center\"\u003e 🤖 Shorten your links for free with a powerful interface!\r\n    \u003cbr\u003e\r\n\u003c/p\u003e\r\n\u003cdiv align=\"center\"\u003e\r\n\r\n[![Support me on Patreon](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fshieldsio-patreon.vercel.app%2Fapi%3Fusername%3Dashish_agarwal%26type%3Dpledges\u0026style=flat)](https://patreon.com/ashish_agarwal)\r\n\r\n[Try out here! ⤴](https://cutyoururl.pythonanywhere.com)\r\n\r\n\u003c/div\u003e\r\n\r\n## 📝 Table of Contents\r\n\r\n- [About](#about)\r\n- [Demo / Working](#demo)\r\n- [How it works](#working)\r\n- [Authors](#authors)\r\n- [Acknowledgments](#acknowledgement)\r\n\r\n## 🧐 About \u003ca name = \"about\"\u003e\u003c/a\u003e\r\n\r\nI built this project to make a free URL shortener with a powerful interface. It is based on Python-Flask and SQLite3. It is a free and open-source project, and you can use it for free. It is hosted on PythonAnywhere, and you can try it out [here](https://cutyoururl.pythonanywhere.com).\r\n\r\nIt's not simple as writting a script. For this, I used some other libraries like to generate QR codes, flask-login for authentication and SQL. And it is also integrated with Gmail API, so it can verify emails.\r\n\r\n\u003e Consider helping me and not making a spambot for my site, I cannot invest a bit on it. Try to support me, if you can!\r\n\r\n## 🎥 Demo / Working \u003ca name = \"demo\"\u003e\u003c/a\u003e\r\n\r\nDemo will be available soon.\r\n\r\n## 💭 How it works \u003ca name = \"working\"\u003e\u003c/a\u003e\r\n\r\nYou enter a long URL and we'll save it and give you a short URL. You can get a free QR code for your URL too, views counting, and automatically delete the URL when it reaches a amount of clicks or a date (limited clicks or expiry date). You can also have custom slugs on your URLs!\r\n\r\n## Running locally\r\n### Prerequisites\r\n\r\nStart a new virtual environment and install all requirements\r\n\r\n```bash\r\n$ python3 -m pip install -r requirements.txt\r\n```\r\n### Making .env\r\nThen, you need to make a `.env` file in the project's root directory with the following content:\r\n```env\r\nLOGIN_DB=./cache/login.db\r\ndir_name=s\r\nDATABASE=./cache/shorts.db\r\nlog_file_path=./cache/logs/shorts.log\r\nSCHEMA_FILE=./login.sql\r\ncaptchaSiteKey=dont try me\r\nspoofDomain=http://127.0.0.1:5000/\r\nsecretKey=somethingbruh\r\n```\r\n\u003e - Login DB: path to login db file\r\n\u003e - Dir Name: route for generated shorts like /short/shortIDHERE, where short is the dir\r\n\u003e - Database: path to shorts db file\r\n\u003e - Log File Path: path to log file\r\n\u003e - Schema File: path to schema file for login db\r\n\u003e - Captcha Site Key: Google Captcha Site Key (v2 Site Key)\r\n\u003e - Spoof Domain: The domain to spoof, like to show the paths at this domain (for example, https://cutyoururl.tech/ would be the spoof domain for the path https://cutyoururl.tech/short/shortIDHERE)\r\n\u003e - The secret key: used for server and browser to talk. If it is leaked, consider changing it to prevent peoples from abusing it. A certificate that says a user valid.\r\n\r\nYou can get the captcha site key from [here](https://www.google.com/recaptcha/admin/create)\r\n\r\n### Adding Gmail Services\r\nYou need to add a `credentials.json` file in the project's root directory. You can get it from [here](https://developers.google.com/gmail/api/quickstart/python). You can also use the `token.pickle` file to store the token, but it is not necessary.\r\n\r\n\u003e Do not leak your `token.pickle` file, it can allow someone to take over your account.\r\n\r\n### Logging in\r\nAfter you got your credentials, you can run the following command which will attempt to send a simple email. Gmail API will automatically ask you to login.\r\n\r\n```bash\r\n$ python3 test.py\r\nPlease visit this URL to authorize this application: https://accounts.google.com/o/oauth2/auth\r\n\r\n# Authorize it\r\n# If you get a error Invalid TO Header, then you are done\r\n```\r\n\r\n## Common Errors\r\n### Cannot Access DB\r\nThis error will occur if Python cannot open the DB under `./cache/login.db`. If you deleted the cache folder, it is not a issue, you can re-make it.\r\n\u003e In the few next updates I'll be trying to automatically make the shorts and login db from schema, however errors comes everywhere.\r\n\r\nTo re-make the login.db, you have to do:\r\n```bash\r\n$ sqlite3 login.db \u003c login.sql # the login.db would be made\r\n$ sqlite3 shorts.db \u003c schema.sql # the shorts.db would be made\r\n\r\n# move both to cache folder\r\n$ mv ./login.db ./cache/\r\n$ mv ./shorts.db ./cache/\r\n```\r\n\r\nMake sure you have installed all dependencies too!\r\n\r\n## How to host on web/cannot host\r\nIf you choose something like PythonAnywhere, first install all depends, then make cache db files, then:\r\n1. Add a credentials.json (the credentials must have your testing email as a testing user or available to your test account)\r\n2. Put the token.pickle file there: you cannot copy paste its binary, you can do all is: temporarily upload to a secure service, use curl to download and save it, then delete from online storage.\r\n\r\nI have also faced several issues during hosting but still made it work.\r\n\r\n## ✍️ Authors \u003ca name = \"authors\"\u003e\u003c/a\u003e\r\n\r\n- [@ashishagarwal2023](https://github.com/ashishagarwal2023) - Idea \u0026 Initial work\r\n- [@N3RDIUM](https://github.com/N3RDIUM) - Leaving me at the half back-end of login 🤣\r\n\r\nSee also the list of [contributors](https://github.com/ashishagarwal2023/cutyoururl/contributors) who participated in this project.\r\n\r\n## 🎉 Acknowledgements \u003ca name = \"acknowledgement\"\u003e\u003c/a\u003e\r\n\r\n- Hat tip to anyone whose code was used\r\n- Inspiration\r\n- References\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevashish2024%2Fcutyoururl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevashish2024%2Fcutyoururl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevashish2024%2Fcutyoururl/lists"}