LinkShort — URL Shortener
URL shortener with JWT auth, click tracking, and dark UI. Full REST API + React SPA.
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
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.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fastapi_url-0.2.0.tar.gz
(6.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fastapi_url-0.2.0.tar.gz.
File metadata
- Download URL: fastapi_url-0.2.0.tar.gz
- Upload date:
- Size: 6.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d7d8a876ce9a6dad285605f8b3429986321faea34582533d29aa2b2fee343c90
|
|
| MD5 |
3e03fd8214ee80e2d2fc11af1782e135
|
|
| BLAKE2b-256 |
671c7731a94ddc5a2fea3802e2bda54f87751e3b8f9f8b21d00194bb4268d1f1
|
File details
Details for the file fastapi_url-0.2.0-py3-none-any.whl.
File metadata
- Download URL: fastapi_url-0.2.0-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
34d81ddf6b94ae98f3262dd6ef84ec3df103dcb9e9b4d140c8b3e634ef2924da
|
|
| MD5 |
4d7cf0c9b59e20d1c09d7b9a4cd91c79
|
|
| BLAKE2b-256 |
7224b044aba8c1100d3e03265df5c6cfda553a08828f7996491cf72cdfd2d505
|