{"id":21532399,"url":"https://github.com/wiktorboro/drf_link_shortener","last_synced_at":"2025-03-17T19:30:00.451Z","repository":{"id":111158768,"uuid":"537156797","full_name":"WiktorBoro/drf_link_shortener","owner":"WiktorBoro","description":"My new job interview task","archived":false,"fork":false,"pushed_at":"2024-02-26T18:51:50.000Z","size":2260,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-24T06:42:36.879Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WiktorBoro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2022-09-15T18:25:15.000Z","updated_at":"2022-09-20T09:09:21.000Z","dependencies_parsed_at":"2025-01-24T06:42:41.860Z","dependency_job_id":"8b055730-77c5-43c9-a895-4cd4b1ffd072","html_url":"https://github.com/WiktorBoro/drf_link_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/WiktorBoro%2Fdrf_link_shortener","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WiktorBoro%2Fdrf_link_shortener/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WiktorBoro%2Fdrf_link_shortener/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WiktorBoro%2Fdrf_link_shortener/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WiktorBoro","download_url":"https://codeload.github.com/WiktorBoro/drf_link_shortener/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244096483,"owners_count":20397428,"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":[],"created_at":"2024-11-24T02:19:48.986Z","updated_at":"2025-03-17T19:30:00.429Z","avatar_url":"https://github.com/WiktorBoro.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Heroku deploy\n\n`https://shorten-the-link1.herokuapp.com`\n\n## Functions\n\n1. Link shortening\n2. Possibility to choose what the link will consist of (digits, uppercase, lowercase) and how long it will be\n3. Collecting the IP and user agents of users who shorten the link\n4. Number of entries on shortened links\n\n## Endpoints \n```\n    \"Endpoint\": \"api/shortener-link\"\n    \"ReturnedForm\": {\"original_link\": str,\"shortened_link\": str}\n\n    POST: Return JSON with 'original link' and created 'shortened link' if 'original link' was shortened before, return\n    already existing shortened link\n\n    :return 200: return already existed shortened url\n    :return 201: create new shortened url\n    :return 400: serializer error\n```\n\n\n# Quickstart\n\n### Clone git repo\n\nIn project folder run\n\n`git clone https://github.com/WiktorBoro/drf_link_shortener.git`\n\n### Install lib\n\n`pip install -r requirements.txt`\n\n### Run docker-compose\nMake sure you have run your docker app!\n\nIn project folder run\n\n`docker-compose up`\n\n### Connect with docker container\n\n`docker-compose exec backend sh`\n\n### Migrate database\nIn docker container run\n\n`python manage.py makemigrations main`\n\n`python manage.py migrate`\n\n### Create superuser\nIn docker container run\n\n`python manage.py createsuperuser`\n\nFill in the fields\n\n### Done!\n\nNow on \nhttp://localhost:8000\nyou have a working API\n\nOn \nhttp://localhost:8000/admin/panel\nyou have admin panel with all data\n\n### Run the test\nIn docker container run\n\n`python manage.py test --verbosity 2`\n\n## Example of use\n\nGo to the endpoint visualization\nhttp://localhost:8000/api/shortener-link\n\nEnter a sample link and click on a post\n\n![img.png](readmeimages/img.png)\n\nResponse with status 201\n\n![img.png](readmeimages/img_1.png)\n\nIf the same link is shortened again, return the same link with status 200\n\n![img.png](readmeimages/img_2.png)\n\n## Admin page details\n\n### Config \n\nYou can choose how long the link will be and what it will consist of\n\n!IMPORTANT!\n\n#### The application is not secured at this point, setting the link length value to 0 or deselecting all creation parameters to false will result in an error\n![img.png](readmeimages/img_3.png)\n\n### Statistics \nShortened link and the number of times enters\n![img.png](readmeimages/img_4.png)\n\n### Links \nList of all original and shortened links, \n![img.png](readmeimages/img_5.png)\nAfter click, you can see the IP of the user who shortened the link\n![img.png](readmeimages/img_6.png)\n\n### Users info\nYou can see all users who shortened the link\n![img.png](readmeimages/img_8.png)\n\nAfter entering the user, you can see his user agent and all the links he added\n![img.png](readmeimages/img_7.png)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwiktorboro%2Fdrf_link_shortener","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwiktorboro%2Fdrf_link_shortener","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwiktorboro%2Fdrf_link_shortener/lists"}