Why?
Wanted to learn how to create a short url service, and provide to small businesses a low cost service for their marketing needs
Project Description (What?)
A serverless web application that can be used to create easy to use short urls and QR codes for long web urls.
How?
AWS Architecture
Explanation
The frontend is a static website that was developed using HTML5, CSS and Javascript as the base along with Bootstrap and hosted on AWS S3 and served from Cloudfront CDN.
The user can create short urls by typing in the long url in the web form and clicking on shorten. Users who are not signed in can only make limited requests. Users can signin and create accounts using AWS Cognito. The frontend sends PUT requests to a Url shortener API which uses API Gateway to easily scale and for rate limiting. The API using AWS Cognito authorizer. The API Gateway invokes a Lambda handler that generates the short url using a combination of base64, MD5 methods. The generated short url is stored in DynamoDB with the short url as the Primary Key and a timestamp prefixed with userid as the sort key, it also has a expires field that allows dynamodb to delete urls that have expired.