Skip to content

markpekun/linkShortener

Repository files navigation

🚀 Short Linker

Minimal, production-ready URL shortener.

🎥 Demo (Backend OFF)

work

⚡ Features

  • ⚡ Fully async backend (FastAPI + SQLAlchemy)
  • 🔗 Configurable redirects (302 / 307)
  • 📊 Optional click tracking
  • 🎨 Minimal UI (React + Tailwind)
  • 🚀 Ready for production scaling

🛠 Tech Stack

Backend

  • FastAPI
  • SQLAlchemy (async)
  • PostgreSQL
  • Alembic
  • Pydantic

Frontend

  • React
  • Vite
  • TypeScript
  • TailwindCSS

📁 Project Structure

.
├── alembic/
├── frontend/
├── src/
│   ├── api/
│   ├── core/
│   ├── models/
│   ├── repository/
│   ├── schemas/
│   ├── services/
│   └── utils/
├── .env.example
├── alembic.ini
├── main.py
└── requirements.txt

⚡ Quick Start

1. Backend

cp .env.example .env
pip install -r requirements.txt
alembic upgrade head
uvicorn src.main:app --host 0.0.0.0 --port 8000

🔗 Local Endpoints

2. Frontend

cd frontend
npm install
npm run dev

🔌 API

Create Short Link

POST /shorten
{
  "original_url": "https://example.com"
}

Response

{
  "short_code": "AbXyQz",
  "short_url": "http://127.0.0.1:8000/AbXyQz",
  "original_url": "https://example.com",
  "created_at": "2026-04-15T12:00:00Z"
}

Redirect

GET /{code}

About

Pet project - a URL shortening service. Built with FastAPI using SQLAlchemy and PostgreSQL as the database.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages