fabianfalon / url-shortener

🐍 Url shorter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FastAPI URL Shortener

🐍 Basic example of a URL shortener project developed using FastAPI.

Description

This URL shortener allows users to input a long URL and generate an equivalent short URL. Users can then use the generated short URL to quickly access the original URL.

TODO

  • Shortens long URLs into short URLs.
  • Get original URLs by short URL.
  • tests apis.
  • Add some cache mechanism.
  • test use case.
  • Implement frontend.

Local run

pip install -r requirements.txt or pip install -r requirements-tests.txt


uvicorn src.main:app --host 0.0.0.0 --port 5000 --reload

Run test

python -m pytest

python -m pytest --cov=src

Docker run

docker-compose build

docker-compose up

Ruff commands

Check linters errors ruff check src

Check format errors ruff format -- check src

Fix imports order

ruff --fix src

Fix file format

ruff format src

About

🐍 Url shorter

License:MIT License


Languages

Language:Python 98.3%Language:Dockerfile 1.7%