Loading repository data…
Loading repository data…
all-my-frontend-mini-projects / repository
Welcome to Shortly, the URL shortening app! Users can view the optimal layout for the site depending on their device's screen size and enjoy seamless URL shortening and management.
Shortly is a URL shortening app that allows users to shorten any valid URL at the convinience of a click absolutely free of cost 24/7.
Users should be able to:
To set up the project locally, follow these steps:
git clone https://github.com/SartHak-0-Sach/URL-shortening-API_frontend_project.git
You will find all the required assets in the /design folder. The assets are already optimized.
There is also a style-guide.md file containing the information you'll need, such as color palette and fonts.
In this project I got to learn about various aspects of JavaScript like DOM manipulation and using query selectors to change inner text, inner HTML and inner style of elements as shown below-
const searhApi = async (value) => {
if (!value || value == "") {
return searchBar.classList.add("error");
}
button.innerText = "Loading...";
button.disabled = true;
let apiUrl = "https://api.shrtco.de/v2/shorten";
let ApiReq = await fetch(apiUrl + `?url=${value}`);
let ApiRes = await ApiReq.json();
button.innerText = "Shorten it!";
button.disabled = false;
if (ApiRes.ok) {
searchBar.classList.remove("error");
const localData = JSON.parse(data);
let obj = {
userInput: value,
shortenUrl: ApiRes.result.full_short_link,
};
localData.push(obj);
localStorage.setItem("_html", JSON.stringify(localData));
showHtml();
} else {
searchBar.classList.add("error");
if (ApiRes.error_code == 2) {
error.innerText = "invalid Url";
} else {
error.innerText = ApiRes.error;
}
}
};
The continuously learning journey of a programmer never ends. This project made me realize that there are many concepts that I need to work upon including fundamentals like flex-box and its properties, to more complex concepts like working with fetch and async await in javascript. These areas are some that I think I need to work more upon in the upcoming future as they highlight some of the most significant regions of web development that are important for every developer to know of.
These key points mentioned here will help me grow accountable and consistent towards improving at writing good quality code and be a successful full stack developer one day.
Sarthak Sachdev
I feel like the solutions provided on the website and the continuous doubt solving by industry experts on discord for free is something that is unmatched by anyone else and need to be acknowledged for their efforts in improving me as a developer by suggesting the best practices in your respective tech stack.
I love receiving feedback! I am always looking to improve my code and take up new innovative ideas to work upon. So if you have anything you'd like to mention, please email 'hi' at saarsaach30[at]gmail[dot]com.
If you liked this project make sure to spread the word and share it with all your friends.
Happy coding! ☺️🚀