Inspiration

I was inspired to create this as an extension to a big project i'm working on. I have been building out a LEGO marketplace for buying and selling legos, similar to eBay. This inspiration came from my love of legos, and the want to build out something useful and meaningful. I want a LEGO-only marketplace with a very simple UI/UX and very low cost. From this, I wanted to add a very cool feature that generates the market value of a LEGO set based off its set number and condition, so I decided to implement an AWS Lambda function to assist with that.

What it does

Once a user enters a LEGO set and picks its condition (new or used), the Next.js API route sends a POST to the AWS Lambda endpoint via API Gateway. The Lambda first checks DynamoDB for an existing price for that set. If found there, it returns the cached information. If it is not found, the Lambda falls back and calls BrickEconomy API and stores the returned information into DynamoDB via another call in the same Lambda function. This is to limit API calls, so each set entered only has to be called via BrickEconomy once. I believe this is a good practice to cache items in a database, and I decided to use DynamoDB because it is easy to implement with Lambda.

How we built it

I built this out with Next.js for a simple frontend as well as the Next.js API route. Lambda function to check and store prices in DynamoDB, the database used for storing LEGO information. API Gateway was the public endpoint used to trigger the Lambda function using a POST request.

Challenges we ran into

This was my first time working with anything AWS related, so while I was super excited to work AWS, it was foreign to me at first.

Accomplishments that we're proud of

I'm just really happy that I was able to build something that people will eventually use on my LEGO marketplace. While it will have slightly different logic (won't call 3rd party API for new sets), I think a lot of this will be so helpful in integrating into my website. Even if this price generator wasn't super impressive or complicated, I still think this is a really cool feature, and I know it will be very usable for my future marketplace.

What we learned

I went from knowing nothing about AWS to learning how to implement it into something usable and cool.

What's next for LEGO Price Generator

I am going to eventually integrate this into my LEGO marketplace eBrick with slightly different logic. I am thankful that I got an opportunity to show off something cool.

Built With

Share this project:

Updates