Skip to content

Symfony+React concept application for shortening urls - sort of a miniature bitly

Notifications You must be signed in to change notification settings

mofesolapaul/url-shortener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project: Url Shortener

Setup instructions

The entire setup process has been distilled into a single file to make it easy for you to spin up the application and try it out. Run the following command in the project folder (p.s: docker must be installed on your machine):

chmod u+x setup.sh && ./setup.sh

Implementation draft

API

  • [POST] /shorten
    • Check for db record (return if present)
    • Generate unique 7-char code
      • Code is case-sensitive
      • Alphanumerics
    • Save new code (and the URL it represents) in db
    • Return shortened link
  • [POST] /customize
    • Validate input for uniqueness
    • Update record if it’s unique, reject update otherwise

Frontend

  • [Input] paste your link
  • [button] Shorten Url
  • Perform API call
  • Display returned short link (clickable)
  • If there’s enough time
    • Show extra option to user
    • [Input] “Customize link”
    • [Grouped input] localhost:8089/[Input:custom-identifier]
    • Make API call and show result

Link resolution:

  • Match url (ex: localhost:8089/{code})
  • Check for code in cache
  • Check for code in db, persist in cache if present
  • Redirect to the original url
  • Utilize rabbitmq for async stats updates per requested link

Boilerplate & 3rd party code notice:

Unless libraries like axios, nelmio, doctrine and symfony packages count, no 3rd party libraries were used.

About

Symfony+React concept application for shortening urls - sort of a miniature bitly

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published