Skip to content

heygauravshukla/shortly-url-shortener

Repository files navigation

URL shortening API landing page

This is a solution to the URL shortening API landing page challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.

Table of contents

Overview

The challenge

Users should be able to:

  • View the optimal layout for the site depending on their device's screen size.
  • Shorten any valid URL.
  • See a list of their shortened links, even after refreshing the browser.
  • Copy the shortened link to their clipboard in a single click.
  • Receive an error message when the form is submitted if:
    • The input field is empty.
    • The submitted URL has already been shortened.
    • The submitted URL is a previously generated shortened link.

Screenshot

Links

My process

Built with

  • Semantic JSX markup
  • Flexbox
  • CSS Grid
  • Mobile-first workflow
  • React - JS library
  • Next.js - React framework
  • TypeScript - JavaScript with syntax for types
  • Tailwind CSS - CSS framework
  • Shadcn UI - Open-source component library
  • Radix UI - Accessible component primitives
  • Spoo.me API - API for URL shortening
  • pnpm - Fast, disk space efficient package manager

What I learned

This project enhanced my understanding of several key concepts, including:

  • Ensuring type safety and improving code reliability through TypeScript.
  • Leveraging Shadcn UI to create a reusable and maintainable component library.
  • Utilizing the cn utility function to apply conditional classes efficiently in Tailwind CSS.
  • Implementing SVG icons as React components to enable dynamic property modifications, such as hover states.
  • Employing the localStorage object to persist shortened URLs as key-value pairs in the browser.

Continued development

In future projects, I intend to focus on the following areas for improvement:

  • Establishing a centralized constants directory to streamline content management and enhance project organization.

Useful resources

Author

About

A URL shortener web application built with Next.js, TypeScript and Tailwind CSS.

Topics

Resources

Stars

Watchers

Forks