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.
https://shortit-wheat.vercel.app
https://shortit-vfdg.onrender.com
https://shortit-vfdg.onrender.com/docs
- Frontend: Vercel
- Backend: Render
- Database: Neon PostgreSQL
- 🔗 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
- FastAPI
- SQLAlchemy
- PostgreSQL
- Pydantic
- Uvicorn
- HTML5
- CSS3
- JavaScript
- Tailwind CSS
- Phosphor Icons
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
git clone https://github.com/Varunkumar2516/LinkShort.git
cd ShortItpython -m venv venv
venv\Scripts\activatepip install -r requirements.txtOpen
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.
uvicorn backend.main:app --reloadBackend runs on
http://127.0.0.1:8000
Swagger Documentation
http://127.0.0.1:8000/docs
Simply open
frontend/index.html
or use VS Code Live Server.
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"
}GET /{short_code}
Example
http://127.0.0.1:8000/github
Automatically redirects to
https://github.com
- Password Protected Links
- Link Expiration
- QR Code Generation
- User Authentication
- Dashboard
- Analytics
- Link Management
- Premium Plans
Pull requests are welcome.
If you find a bug or have an idea for improvement, feel free to open an issue.
This project is licensed under the MIT License.
Varun
Built with ❤️ using FastAPI and JavaScript.