Skip to content

I created this project for the LambdaSharp Team Hackathon Challenge

Notifications You must be signed in to change notification settings

schoukri/LambdaSharp-Bookmarker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LambdaSharp Bookmarker

About this challenge

The challenge is to build a Bookmarking API that allows one to save, retreive, share, and preview links.

Infrastructure:

Bookmark Schema

{
    "ID": "32a7cf5a-35be-459a-b586-ec2bed2f4fef",
    "Url": "https://www.youtube.com/watch?v=M5NVwuyk2uM",
    "Title": "The Dream Smartphone! (2019)",
    "Description": "The impossible dream of the perfect smartphone in ...",
    "ImageUrl": "https://i.ytimg.com/vi/M5NVwuyk2uM/maxresdefault.jpg"
}

Setup - .NET Core and AWS

Setup - LambdaSharp Tool (aka lash)

For this challenge, we will be using a pre-release version of the LambdaSharp Tool that is easier to configure and use.

Upgrade lash

If you already have the LambdaSharp Tool installed, unfortunately you cannot simply upgrade it to a pre-release version. First, you have to uninstall the previous version, then install the new version.

```
dotnet tool uninstall -g LambdaSharp.Tool
dotnet tool install -g LambdaSharp.Tool --version 0.7-RC3
```

Install lash

```
dotnet tool install -g LambdaSharp.Tool --version 0.7-RC3
```

Clone Bookmarker repository

git clone git@github.com:LambdaSharp/Bookmarker.git

Build and Deploy

cd Bookmarker
lash init --quick-start     // one time
lash deploy                 // to propagate code changes

Level 1 -- Support Short URLs

Currently, bookmarks are created with a 37-character id (a guid) like 10cffe9e-ace5-444c-836b-635e6ec207d3. Modify the POST AddBookmark API endpoint to instead use a short ID that is still unique. This will allow a future version of our Bookmark service to generate short urls like https://bookmark.er/xYq.

Ideally, you would NOT use a simple sequential integer as that would allow our competitors to know how many bookmarks are in our system.

Level 2 -- Save OpenGraph Data

When a new bookmark is added to DynamoDB, it will only store the ID and Url. However, we want to record more information about our Bookmark in order to support a preview feature (Level 3). On an insert into our DynamoDB table, the lambda function DynamoFunction will be triggered.

Modify that function to retrieve the OpenGraph data from the URL and update the Bookmark in DynamoDB to include the following fields: Title, Description, and ImageUrl.

Documentation

OpenGraph-Net -- library used in this challenge

Level 3 -- Generate HTML Preview

Modify the API Gateway lambda function for the endpoint GET:/preview/{id} to return an HTML preview of a Bookmark. The HTML should include OpenGraph tags so that the preview renders correctly when shared in apps such as Slack, iMessage, etc.

sharing screenshot

Level 4 -- Add Redirector

Modfy Module.yml file to add a new API endpoint called GET:/redirect/{id} which invokes a method that performs an HTTP redirect to the original Bookmark url.

Boss Level -- Add Categories

Extend the Bookmark data model to include a list of categories that are relevant to the Bookmark. Your job is to figure out how to get the list of categories.

About

I created this project for the LambdaSharp Team Hackathon Challenge

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages