A modern URL shortener built with FastAPI, PostgreSQL, and React. Create short links, track clicks, manage URLs from a dashboard, and analyze usage through interactive charts.
Click the image above to download and watch the demo video.
- Shorten URLs instantly
- Update long URLs without changing the short URL
- Delete URLs from your dashboard
- Analytics dashboard
- Weekly click tracking chart
- Total click counts per link
- FastAPI
- PostgreSQL
- Psycopg2
- JWT Authentication
- Argon2 Password Hashing
- Google OAuth
- React
- Vite
- Tailwind CSS
- shadcn/ui
- Clone repo:
git clone https://github.com/losthread/spur.git
cd spur- Configure environment:
Create .env in project root:
DATABASE_URL=your_db_url
JWT_KEY=your_secret_key
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secretCreate .env in project frontend folder:
VITE_GOOGLE_CLIENT_ID=your_vite_google_client_id
VITE_API_URL=http://localhost:8000- Run with Docker Compose:
docker-compose up --build- Access the app: All three services (Frontend, Backend, PostgreSQL) are orchestrated by docker compose and will start automatically.
cd backend
python -m venv venv
# macOS/Linux
source venv/bin/activate
# Windows
venv\Scripts\activate
pip install -r requirements.txtCreate .env in project's root:
DATABASE_URL=your_db_url
JWT_KEY=your_secret_key
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secretCreate .env in project's frontend folder:
VITE_GOOGLE_CLIENT_ID=your_vite_google_client_id
VITE_API_URL=http://localhost:8000Run the backend:
uvicorn app.main:app --reloadBackend will run at:
http://localhost:8000
cd frontend
npm install
npm run devFrontend will run at:
http://localhost:5173
POST /register
POST /login
POST /login/googlePOST /shorten
GET /go/{short_code}
PUT /shorten/{short_code}
DELETE /shorten/{short_code}GET /users/me
GET /users/me/urlsGET /analytics- Email verification
- Password reset flow
- Custom short codes
- Geographic click analytics
MIT