Skip to content

fabianfalon/url-shortener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

24 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

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