Skip to main content

LinkShort — URL Shortener

CI ghcr

Python FastAPI React TailwindCSS License

URL shortener with JWT auth, click tracking, and dark UI. Full REST API + React SPA.

Login Dashboard Shortened

Features

  • JWT authentication — register, login, token-based API access
  • One-click shortening — paste URL, get short code
  • Click tracking — each redirect increments counter
  • Dashboard — manage URLs: copy, delete, stats
  • Copy to clipboard — one-click copy
  • Dark UI — professional dark theme, responsive
  • REST API — Swagger docs at /docs
  • SQLite — zero-config persistence

Tech Stack

Layer Tech
Backend Python 3.12, FastAPI, SQLAlchemy, SQLite
Auth JWT (python-jose), SHA-256
Frontend React 19, Vite, TailwindCSS 4
Testing pytest, httpx

Quick Start

git clone https://github.com/bartoszosiej/FastAPI-url.git
cd FastAPI-url
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload

Open http://localhost:8000

Build Frontend

cd frontend
npm install
npm run build
rm -rf ../backend/static
mkdir -p ../backend/static
cp -r dist/* ../backend/static/

API

Method Endpoint Auth Description
POST /auth/register — Create account
POST /auth/login — Login, returns JWT
GET /auth/me Bearer Current user
POST /urls/shorten Bearer Create short URL
GET /urls/my Bearer List your URLs
GET /urls/r/{code} — Redirect to target
DELETE /urls/{code} Bearer Delete URL

Deploy

# Cloudflare Tunnel (free, no account)
cloudflared tunnel --url http://localhost:8000

Testing

pytest tests/ -v

License

MIT

🌐 Ecosystem

This project is part of the Bartosz Web Portfolio ecosystem.

Metadata

Release files for fastapi-url 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fastapi-url 0.2.0
File Size Uploaded
fastapi_url-0.2.0.tar.gz 6.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fastapi-url 0.2.0
File Interpreter ABI Platform
fastapi_url-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 13.2 kB

Release files / fastapi_url-0.2.0.tar.gz

Download URL fastapi_url-0.2.0.tar.gz
Size 6.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d7d8a876ce9a6dad285605f8b3429986321faea34582533d29aa2b2fee343c90
BLAKE2b-256 checksum
How to use checksums
671c7731a94ddc5a2fea3802e2bda54f87751e3b8f9f8b21d00194bb4268d1f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / fastapi_url-0.2.0-py3-none-any.whl

Download URL fastapi_url-0.2.0-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
34d81ddf6b94ae98f3262dd6ef84ec3df103dcb9e9b4d140c8b3e634ef2924da
BLAKE2b-256 checksum
How to use checksums
7224b044aba8c1100d3e03265df5c6cfda553a08828f7996491cf72cdfd2d505
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page