{"id":16946811,"url":"https://github.com/agriyakhetarpal/linkbite","last_synced_at":"2026-04-13T23:04:02.131Z","repository":{"id":134173447,"uuid":"583031896","full_name":"agriyakhetarpal/LinkBite","owner":"agriyakhetarpal","description":"A fast, minimal URL shortener web app with FastAPI","archived":false,"fork":false,"pushed_at":"2023-01-23T18:04:13.000Z","size":370,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-16T23:49:19.526Z","etag":null,"topics":["fastapi","huggingface","huggingface-spaces","pydantic","python","sqlalchemy","sqlalchemy-python","sqlite","uvicorn"],"latest_commit_sha":null,"homepage":"","language":"Python","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/agriyakhetarpal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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-12-28T15:03:34.000Z","updated_at":"2023-01-07T19:05:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"5e325369-dd92-403b-8877-5003296bd23a","html_url":"https://github.com/agriyakhetarpal/LinkBite","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/agriyakhetarpal%2FLinkBite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agriyakhetarpal%2FLinkBite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agriyakhetarpal%2FLinkBite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agriyakhetarpal%2FLinkBite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agriyakhetarpal","download_url":"https://codeload.github.com/agriyakhetarpal/LinkBite/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244767801,"owners_count":20507110,"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":["fastapi","huggingface","huggingface-spaces","pydantic","python","sqlalchemy","sqlalchemy-python","sqlite","uvicorn"],"created_at":"2024-10-13T21:44:53.178Z","updated_at":"2026-04-13T23:04:02.099Z","avatar_url":"https://github.com/agriyakhetarpal.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\ntitle: LinkBite\nemoji: ⚓\ncolorFrom: yellow\ncolorTo: red\nsdk: docker\npython_version: 3.9\napp_file: gradio-app.py\nlanguage: \n  - en\ntags:\n- fastapi\n- sqlalchemy\nlicense: mit\n---\n\n![Logo for LinkBite](img/LinkBite.png)\n\n# LinkBite \n\nLinkBite is a fast, minimalist URL shortener web app built for simplicity. It uses the `secrets` standard library for PRNG-based cryptographic tokens in Python (see [PEP 506](https://peps.python.org/pep-0506/) for more info).\n\nLinkBite has a FastAPI + SQLite backend with SQLAlchemy ORM to connect the RESTful API endpoints to the database, and a Gradio frontend. This project also serves as a primer to FastAPI and its advanced functionalities.\n\n## Features\n\n- Create and manage your own shortened URLs\n- Graceful forwarding: check if the URL exists\n- Analytics: count the number of clicks on your URL\n- Admin to deactivate shortened links (through a secret key to said links) \n\n# User setup\n\n## Installation\n\nIt is recommended to install LinkBite within a Python [virtual environment](https://www.dataquest.io/blog/a-complete-guide-to-python-virtual-environments/). LinkBite has a minimal number of dependencies enlisted in **requirements.txt**. To install all of them, clone the repository and run\n\n```\npip install -r requirements.txt\n```\n\n## Environment variables\n\nLinkBite uses [`python-dotenv`](https://pypi.org/project/python-dotenv/) to build environment variables. To test your build, set your environment variables in a `.env` file in the install directory.\n\n```\nENV_NAME=\"dev\"\nBASE_URL=\"http://localhost:8000\"\nDB_URL=\"sqlite:///./shortener.db\"\n```\n\n## Web server\n\nFastAPI leverages the ASGI standard to implement asynchronous event loops within a single process. For the web server; in the current directory, run\n\n```\nuvicorn shortener.main:app --reload\n```\n\n# API documentation\n\nYou can view all the API endpoints in FastAPI's autogenerated documentation at the base URL, i.e., https://localhost/8000/docs by default, or the alternative documentation at https://localhost/8000/redoc. The API methods have been defined in `shortener/main.py`.\n\n# Tests\nThe tests are for the API endpoints currently and do not test Sessions' database operations. They are written with `starlette.testclient` and `pytest` located at `shortener/test_main.py`. To run the tests, start the server and simply run `pytest`.\n\n# Frontend\nLinkBite has a Gradio frontend connecting to the API endpoints with thin wrappers, inside `gradio-app.py`. The frontend can be run using\n```\npython gradio-app.py\n```\nor in reload mode using\n```\ngradio gradio-app.py\n```\nand then go to https://localhost:7860.\n\n# Deployment\n\n# Contributing\nImprovements to the source code, documentation, feature requests, adding and improving tests, and catching and fixing bugs are all welcomed and appreciated – thanks! Please have a look at the issues or the source code. \n\n# License\nMIT\n\n# References\n```\n@software{Abid_Gradio_Hassle-free_sharing_2019,\nauthor = {Abid, Abubakar and Abdalla, Ali and Abid, Ali and Khan, Dawood and Alfozan, Abdulrahman and Zou, James},\ndoi = {10.48550/arXiv.1906.02569},\nmonth = {6},\ntitle = {{Gradio: Hassle-free sharing and testing of ML models in the wild}},\nurl = {https://arxiv.org/abs/1906.02569},\nyear = {2019}\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagriyakhetarpal%2Flinkbite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagriyakhetarpal%2Flinkbite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagriyakhetarpal%2Flinkbite/lists"}