{"id":19811810,"url":"https://github.com/bybenpuls/url-shortener","last_synced_at":"2026-04-08T12:33:41.062Z","repository":{"id":249529505,"uuid":"831754056","full_name":"byBenPuls/url-shortener","owner":"byBenPuls","description":"A simple async URL Shortener on Python with Database (Redis, Postgres)","archived":false,"fork":false,"pushed_at":"2024-10-05T02:57:40.000Z","size":75,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-03T11:28:16.936Z","etag":null,"topics":["api","asyncio","asyncpg","css","database","fastapi","html","javascript","js","postgres","postgresql","pure-javascript","python","python3","redis","url","url-shortener","uvicorn","web"],"latest_commit_sha":null,"homepage":"https://bybenpuls.github.io/url-shortener/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/byBenPuls.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":"2024-07-21T14:31:38.000Z","updated_at":"2024-10-05T02:57:44.000Z","dependencies_parsed_at":"2025-02-28T13:39:26.566Z","dependency_job_id":"0a316374-f3af-45a1-b4b5-b70ca30ee0f5","html_url":"https://github.com/byBenPuls/url-shortener","commit_stats":null,"previous_names":["bybenpuls/url-shortener"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/byBenPuls/url-shortener","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byBenPuls%2Furl-shortener","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byBenPuls%2Furl-shortener/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byBenPuls%2Furl-shortener/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byBenPuls%2Furl-shortener/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/byBenPuls","download_url":"https://codeload.github.com/byBenPuls/url-shortener/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byBenPuls%2Furl-shortener/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31556233,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T10:21:54.569Z","status":"ssl_error","status_checked_at":"2026-04-08T10:21:38.171Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["api","asyncio","asyncpg","css","database","fastapi","html","javascript","js","postgres","postgresql","pure-javascript","python","python3","redis","url","url-shortener","uvicorn","web"],"created_at":"2024-11-12T09:27:51.629Z","updated_at":"2026-04-08T12:33:41.039Z","avatar_url":"https://github.com/byBenPuls.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"assets/screen2.png\" alt=\"image\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/python-212121?style=for-the-badge\u0026logo=python\" alt=\"\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/fastapi-212121?style=for-the-badge\u0026logo=fastapi\" alt=\"\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/postgresql-212121?style=for-the-badge\u0026logo=postgresql\" alt=\"\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/redis-212121?style=for-the-badge\u0026logo=redis\" alt=\"\"\u003e\n\u003c/p\u003e\n\n### Content:\n* **[🔥 Features](#-features)**\n* **[💡 Installation](#-installation)**\n\n## 🔥 Features\n\n### 🔷 Asynchronous app\n \nApp built with FastAPI.\nIt is a high performance framework In the process of writing the application, \nonly asynchronous programming was used (except cpu-bound operation).\nAll i/o-bound operations are asynchronous.\n\n\n### 📁 Database entry (postgres, redis)\n\nApp using a postgres database. All information about links is recorded in it. The Database contains one table\n\n| id |       original       |             modified |\n|:---|:--------------------:|---------------------:|\n| 1  | https://google.com/  | mrknROpKuogikvRGDiHX |\n| 2  | https://example.com/ | jYJKeSjnDcOvJwItGrZs |\n\nThe table is automatically created (if the table does not exist) every time when starting app.\nIt's possible because of \n`pg_table_builder` [module](https://github.com/byBenPuls/table-builder-pg).\n\nAfter successful record in postgres database data save in a redis database. \nData keep in key=value format in RAM machine.\nIt's really fast!\n\n### 📱 Adaptive website\n\nWebsite created with a Bootstrap framework. Bootstrap supports mobile screen size. \n\n### ⚡ Fast\n\nThe application checks whether the data is in the cache. \nFor this reason, data is rapid and redirection occurs unnoticed.\n\n\n### ️🛡️ Duplicate link protection\n\nApp has protection that compares original and modified links. It'd protect from infinite creating same links.\n\n### ⚙️ API\n\nThe application allows you to send POST HTTP requests to receive a modified link.\n**For example:**\n\nRequest:\n\n```python\nimport requests\n\nrequests.post(\n    '\u003cYour address\u003e/',\n    json={\"original_url\": \"https://google.com/\"})\n```\nResponse:\n```python\n{\"endpoint\": \"https://\u003cYour address\u003e/mrknROpKuogikvRGDiHX/\"}\n```\n\n\n## 💡 Installation\n\nFirst, install a virtual environment `py -m venv venv`. \nNext, you need activating venv. Windows: `.\\Scripts\\activate` Linux: `source bin/activate`.\nMost Python IDEs can on one's own create virtual environment. Also, you need to create env variable. \nYou can use dotenv or your IDE. `DB_CONNECTION_STRING=postgres://...`\n\nThen you need to install all requirements:\nmove to the root directory of the project and type `pip install -r requirements.txt`.\n\nFor launch FastAPI I'm using `uvicorn`.\nYou can choose parameters of launch (host, port) if it is necessary. \nAfter this, you can start a project, for example `py setup.py`.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbybenpuls%2Furl-shortener","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbybenpuls%2Furl-shortener","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbybenpuls%2Furl-shortener/lists"}