A clean and responsive URL shortening web application inspired by the Frontend Mentor Shortly challenge. This version integrates with the Bitly API, stores links using Local Storage, and includes a fully styled link history UI with copy buttons.
The goal of this project is to build a fully functional URL-shortening landing page that integrates with the Bitly API to generate shortened URLs. The design and layout aim to closely match the original challenge specifications while ensuring a smooth and responsive user experience across all devices.
This project serves as practice for working with external APIs, managing client-side data, handling errors, and building clean, interactive UI components. Any tools or libraries can be used, allowing flexibility and experimentation throughout development.
- View a responsive layout that adapts smoothly to different screen sizes (mobile, tablet, desktop)
- Shorten any valid URL using the Bitly API
- Persist previously shortened links using Local Storage so they remain available after page refresh
- Copy shortened links to the clipboard with a single click
- Receive clear error messages, including:
- When the input field is empty
- When the API request fails or returns an error
View the project live:
π π Live Demo: Click Here for Live Demo
Project Repo π π» Repository: View Source on GitHub
Users can enter any valid URL and receive a shortened link powered by the Bitly API.
Shortened links are saved locally so the list stays even after refreshing or closing the browser.
Each shortened link has a βCopyβ button for instant copying.
Built with Bootstrap and custom styling to match the Shortly design.
- Shows message if input field is empty
- Shows API error message if Bitly request fails
- HTML5
- CSS3
- Bootstrap 5
- JavaScript (ES6+)
- Bitly API
- Local Storage
This project requires a Bitly API token. Since GitHub Pages cannot hide environment variables, tokens must is be exposed.
βββ README.md
βββ design
β βββ desktop-active-states.jpg
β βββ desktop-design.jpg
β βββ mobile-active-states.jpg
β βββ mobile-design.jpg
β βββ mobile-navigation.jpg
βββ images
β βββ bg-boost-desktop.svg
β βββ bg-boost-mobile.svg
β βββ bg-shorten-desktop.svg
β βββ bg-shorten-mobile.svg
β βββ favicon-32x32.png
β βββ icon-brand-recognition.svg
β βββ icon-detailed-records.svg
β βββ icon-facebook.svg
β βββ icon-fully-customizable.svg
β βββ icon-instagram.svg
β βββ icon-pinterest.svg
β βββ icon-twitter.svg
β βββ illustration-working.svg
β βββ logo.svg
βββ index.html
βββ index.js
βββ preview.jpg
βββ screenshots
β βββ desktop.png
β βββ mobile.png
βββ style-guide.md
βββ style.css
4 directories, 27 files
git clone https://github.com/structbase/ShortlyNo build steps required.
async function fetchData(longUrl, TOKEN) {
const response = await fetch("https://api-ssl.bitly.com/v4/shorten", {
method: "POST",
headers: {
Authorization: `Bearer ${TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ long_url: longUrl }),
});
}const links = JSON.parse(localStorage.getItem("shortenedLinks")) || [];
links.push({ originalUrl, shortUrl });
localStorage.setItem("shortenedLinks", JSON.stringify(links));window.addEventListener("DOMContentLoaded", loadLinks);Challenge inspired by Frontend Mentor. API provided by Bitly.
The development process for this project was both challenging and rewarding. I began by planning the overall HTML structure and determining how each section would fit together visually. Once I moved into implementation, I realized how extensive the markup needed to be, and this part of the project took more time than expected. To speed up the workflow, I incorporated Bootstrap to handle layout and responsiveness and created several custom utility classes to keep the styling consistent and reusable.
Matching the provided UI designs required a lot of careful adjustments, and I spent a good amount of time fine-tuning spacing, fonts, and colors to stay as close to the design as possible. Integrating the Bitly API introduced another layer of complexity. After researching how the API works, reading documentation, and doing plenty of Googling, I learned that I needed to create an account and generate an API token to make authenticated requests.
During the JavaScript phase, the biggest challenge I faced was figuring out how to securely hide the API token. My original plan was to deploy the project on GitHub Pages, but after deeper research, I learned that client-side deployments cannot hide sensitive tokens. Since Bitlyβs free tier only allows five requests per month, I ultimately accepted the limitation and used the token directly in the client-side code.
Overall, this project strengthened my understanding of API integration, responsive UI development, and browser storage, and it highlighted areas I plan to improve in future projectsβespecially handling secrets securely and structuring large-scale front-end code more efficiently.
Developed by Abenezer
Junior developer

