Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔗 ShortIt - URL Shortener

A modern URL Shortener built with FastAPI, PostgreSQL, HTML, CSS, and JavaScript.

ShortIt allows users to shorten long URLs, create custom aliases, and instantly redirect to the original website through a clean and responsive interface.


🚀 Deployment

🌐 Live Application

Frontend (Vercel)

https://shortit-wheat.vercel.app

Backend API (Render)

https://shortit-vfdg.onrender.com

Swagger Documentation

https://shortit-vfdg.onrender.com/docs


Deployment Stack

  • Frontend: Vercel
  • Backend: Render
  • Database: Neon PostgreSQL

✨ Features

  • 🔗 Shorten Long URLs
  • ✏️ Custom Alias Support
  • 🚀 Fast Redirects
  • 📊 Click Tracking
  • 🎨 Modern Responsive UI
  • 📋 One Click Copy
  • 🌍 Open Short URL
  • 🔔 Toast Notifications
  • ✅ URL Validation
  • 🕒 Last Shortened URL Card
  • 🚧 Coming Soon Features

🛠 Tech Stack

Backend

  • FastAPI
  • SQLAlchemy
  • PostgreSQL
  • Pydantic
  • Uvicorn

Frontend

  • HTML5
  • CSS3
  • JavaScript
  • Tailwind CSS
  • Phosphor Icons

📂 Project Structure

ShortIt/
│
├── backend/
│   ├── routes/
│   ├── models.py
│   ├── crud.py
│   ├── database.py
│   ├── utils.py
│   ├── config.py
│   ├── schemamodels.py
│   └── main.py
│
├── frontend/
│   ├── index.html
│   ├── style.css
│   └── script.js
│
├── requirements.txt
├── README.md
└── .gitignore

⚙️ Local Installation

1. Clone Repository

git clone https://github.com/Varunkumar2516/LinkShort.git

cd ShortIt

2. Create Virtual Environment

python -m venv venv

venv\Scripts\activate

3. Install Dependencies

pip install -r requirements.txt

🐘 PostgreSQL Configuration

Open

backend/config.py

Configure your PostgreSQL connection:

DATABASE_URL = "postgresql://username:password@localhost:5432/shortit"

Replace:

  • username
  • password
  • database name

with your own PostgreSQL credentials.


▶️ Run Backend

uvicorn backend.main:app --reload

Backend runs on

http://127.0.0.1:8000

Swagger Documentation

http://127.0.0.1:8000/docs

🌐 Run Frontend

Simply open

frontend/index.html

or use VS Code Live Server.


🔗 API

Shorten URL

POST /url/shorten

Example Request

{
  "url": "https://github.com"
}

Custom Alias

{
  "url": "https://github.com",
  "custom_alias": "github"
}

Example Response

{
  "short_url": "http://127.0.0.1:8000/github"
}

Redirect

GET /{short_code}

Example

http://127.0.0.1:8000/github

Automatically redirects to

https://github.com

🚧 Upcoming Features

  • Password Protected Links
  • Link Expiration
  • QR Code Generation
  • User Authentication
  • Dashboard
  • Analytics
  • Link Management
  • Premium Plans

🤝 Contributing

Pull requests are welcome.

If you find a bug or have an idea for improvement, feel free to open an issue.


📄 License

This project is licensed under the MIT License.


👨‍💻 Author

Varun

Built with ❤️ using FastAPI and JavaScript.

About

Url Shortener Project

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages