TL;DR:  Beyond the structural mechanics, Lego and web development share a deep philosophy when it comes to design, problem-solving and optimizing. Before we dive into the technical details, let's talk about Lego.

  • A part is the smallest unit in the Lego ecosystem.
  • Any parts can be collected to form a set.
  • Specific parts group together to form a minifig.

You can imagine the parts as the food materials in a restaurant. These materials can be collected to create meal sets(e.g. all day breakfast, noodle set, afternoon set...etc). A minifig is like a drink, which must be consisted of particular elements like water, tea spoon, ice..etc.

Lego keeps manufacturing these components, and it is the most successful toy company in the world by both sales and net profit now!

Lego Ecosystem Diagram

Relationships between sets, parts, and minifigs

Working with Types

Typescript is a perfect use case for Lego data. There are actually other entities in the Lego ecosystem like colors, themes, inventories. But for simplicity, I just illustrate the use of Typescript to type all search results returned from the api:

interface SearchResultParts {
  part_num: string;
  name: string;
  part_img_url: string;
}

interface SearchResultSets {
  set_num: string;
  name: string;
  theme_id: number;
  year: number;
  set_img_url: string;
}

interface SearchResultMinifigs {
  set_num: string;
  name: string;
  set_img_url: string;
}

Final thoughts

This showcase demonstrates my technical competence as a full-stack specialist specifically in web development. But Lego is not just related to database, The Lego Powered Up parts even further seamlessly integrates STEM and there are a lot of IoT libraries that provide Python/Node.js wrappers bridging the codes with the physical Lego components. For example, you can build a web app to control the speed and direction of Lego trains with physical motor components!

Last but not least, see the About section to learn more about me and let's connect!