<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>Jasper Gabriel</title>
  <subtitle>Thoughts on software engineering, side projects, and whatever else is on my mind.</subtitle>
  <link href="https://jaspergabriel.dev/" rel="alternate" type="text/html"/>
  <link href="https://jaspergabriel.dev/atom.xml" rel="self" type="application/atom+xml"/>
  <id>https://jaspergabriel.dev/</id>
  <updated>2024-01-21T00:00:00.000Z</updated>
  <author>
    <name>Jasper Gabriel</name>
    <uri>https://jaspergabriel.dev/about/</uri>
  </author>
  <entry>
    <title>How I Contributed to Open-Source While Learning Svelte</title>
    <link href="https://jaspergabriel.dev/blog/contributing-to-open-source-while-learning-svelte/" rel="alternate" type="text/html"/>
    <id>https://jaspergabriel.dev/blog/contributing-to-open-source-while-learning-svelte/</id>
    <published>2024-01-21T00:00:00.000Z</published>
    <updated>2024-01-21T00:00:00.000Z</updated>
    <summary>How I found and fixed documentation inconsistencies in Svelte's interactive tutorial while learning frontend development.</summary>
    <category term="tech"/>
    <category term="open-source"/>
    <content type="html">&lt;p&gt;If you’re looking to start contributing to open-source projects, or you want to make more open-source contributions, you might already be looking at different open-source projects, seeing where you can help out.&lt;/p&gt;
&lt;p&gt;Sometimes, contributing to open-source projects comes naturally. You might even find opportunities to improve a project’s documentation while reading, or in my case while learning Svelte.&lt;/p&gt;
&lt;p&gt;In this article, I’ll share how I ended up contributing to &lt;a href=&quot;https://svelte.dev/&quot;&gt;Svelte&lt;/a&gt; while learning through their &lt;a href=&quot;https://learn.svelte.dev/tutorial/welcome-to-svelte&quot;&gt;interactive tutorials&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&quot;my-background-deciding-to-learn-svelte&quot;&gt;My background: deciding to learn Svelte&lt;/h2&gt;
&lt;p&gt;Before we continue, let me share my background.&lt;/p&gt;
&lt;p&gt;Throughout my career, I’ve mostly done backend development. I wanted to learn frontend development to build my personal website.&lt;/p&gt;
&lt;p&gt;I was deciding between &lt;strong&gt;React&lt;/strong&gt; and &lt;strong&gt;Svelte&lt;/strong&gt;. After browsing through multiple blogs (including this &lt;a href=&quot;https://prismic.io/blog/svelte-vs-react&quot;&gt;one&lt;/a&gt;) and Reddit threads comparing both, I was ready to choose.&lt;/p&gt;
&lt;p&gt;Based on my quick research, &lt;strong&gt;React&lt;/strong&gt; is ideal for complex and large-scale applications while &lt;strong&gt;Svelte&lt;/strong&gt; is more beginner-friendly since I don’t have to learn &lt;a href=&quot;https://react.dev/learn/writing-markup-with-jsx&quot;&gt;JSX&lt;/a&gt; and &lt;a href=&quot;https://legacy.reactjs.org/docs/faq-internals.html&quot;&gt;virtual DOM&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;As someone who is new to frontends and just wants to build a personal website, I ended up choosing Svelte for its simplicity.&lt;/p&gt;
&lt;h2 id=&quot;learning-svelte-through-the-interactive-tutorials&quot;&gt;Learning Svelte through the interactive tutorials&lt;/h2&gt;
&lt;p&gt;Now that I’ve chosen to learn Svelte for building my website, the first I did was visit &lt;a href=&quot;https://svelte.dev/&quot;&gt;Svelte’s website&lt;/a&gt;. Then I went to &lt;a href=&quot;https://learn.svelte.dev/tutorial/welcome-to-svelte&quot;&gt;Svelte’s interactive tutorial&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The tutorial is composed of four parts, covering both &lt;a href=&quot;https://svelte.dev/&quot;&gt;Svelte&lt;/a&gt; and &lt;a href=&quot;https://kit.svelte.dev/&quot;&gt;SvelteKit&lt;/a&gt;, which is a UI framework for Svelte.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;💡 &lt;strong&gt;Note:&lt;/strong&gt; Here’s my &lt;a href=&quot;https://github.com/jdg2896/learning-notes/blob/main/notes/learning-svelte-and%20-sveltekit.md&quot;&gt;notes on GitHub&lt;/a&gt; while learning Svelte and SvelteKit.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id=&quot;finding-possible-improvements-in-the-tutorial&quot;&gt;Finding possible improvements in the tutorial&lt;/h2&gt;
&lt;p&gt;I went through the tutorials during my free time. The first part was pretty straightforward.&lt;/p&gt;
&lt;p&gt;Once I got to the second part, in the &lt;a href=&quot;https://learn.svelte.dev/tutorial/slots&quot;&gt;slots section&lt;/a&gt;, I noticed a difference between the docs on the left, and the code on the right.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Learning Svelte interactive tutorial website, slots section difference between docs and code&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;2048&quot; height=&quot;790&quot; src=&quot;https://jaspergabriel.dev/_astro/1-learn-svelte-dev-slots-page.3TE3y1RU_1j4Pus.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/1-learn-svelte-dev-slots-page.3TE3y1RU_131rMR.webp 680w, https://jaspergabriel.dev/_astro/1-learn-svelte-dev-slots-page.3TE3y1RU_Z2fzClw.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;p&gt;In the left part, the docs show &lt;code&gt;&amp;#x3C;div class=&quot;card &quot;&gt;&lt;/code&gt;, while the code snippet on the right shows &lt;code&gt;&amp;#x3C;div class=&quot;card&quot;&gt;&lt;/code&gt;. The difference is that there’s an &lt;strong&gt;extra whitespace on the class value&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Here’s a side-by-side comparison to see the difference more clearly:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;&amp;#x3C;div class=&quot;card &quot;&gt;&lt;/code&gt; (Left part: docs)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;#x3C;div class=&quot;card&quot;&gt;&lt;/code&gt; (Right part: code snippet)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I usually notice small details like this, so I paused and looked to improve the tutorial page.&lt;/p&gt;
&lt;h2 id=&quot;improving-the-tutorial-documentation&quot;&gt;Improving the tutorial documentation&lt;/h2&gt;
&lt;p&gt;Websites and documentation that are open-source usually have an &lt;strong&gt;edit page button&lt;/strong&gt; so readers can edit the page when they find issues or possible improvements.&lt;/p&gt;
&lt;p&gt;Fortunately, the maintainers at Svelte also make it easy to edit the interactive tutorial pages.&lt;/p&gt;
&lt;p&gt;While still on the slots tutorial page, I clicked the &lt;strong&gt;Edit this page&lt;/strong&gt; link at the bottom.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Learning Svelte interactive tutorial website, click the &amp;#x22;Edit this Page&amp;#x22; button at the bottom of the slots section page.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;987&quot; height=&quot;1638&quot; src=&quot;https://jaspergabriel.dev/_astro/2-learn-svelte-dev-slots-edit-this-page.CyN7yv76_2eodx9.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/2-learn-svelte-dev-slots-edit-this-page.CyN7yv76_Z1rMNFc.webp 680w, https://jaspergabriel.dev/_astro/2-learn-svelte-dev-slots-edit-this-page.CyN7yv76_2eodx9.webp 987w&quot;&gt;&lt;/p&gt;
&lt;p&gt;Clicking the &lt;strong&gt;Edit this page&lt;/strong&gt; button brought me to the &lt;a href=&quot;https://github.com/sveltejs/learn.svelte.dev/tree/main/content/tutorial/02-advanced-svelte/07-composition/01-slots&quot;&gt;GitHub repository&lt;/a&gt; of Svelte’s interactive tutorial.&lt;/p&gt;
&lt;h3 id=&quot;reviewing-the-contributing-guidelines&quot;&gt;Reviewing the contributing guidelines&lt;/h3&gt;
&lt;p&gt;While reviewing Svelte’s repository, I didn’t see any &lt;code&gt;CONTRIBUTING.md&lt;/code&gt; or any other open-source contributing guidelines, which can also be found in the repository’s &lt;code&gt;README.md&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;What I did instead was review the previous commit messages to see if there was a specific commit format that I should follow.&lt;/p&gt;
&lt;p&gt;There was no standard commit format, so I went with the &lt;a href=&quot;https://www.conventionalcommits.org/en/v1.0.0/&quot;&gt;conventional commits&lt;/a&gt; format.&lt;/p&gt;
&lt;h3 id=&quot;forks-commits-and-pull-requests-through-the-github-website&quot;&gt;Forks, commits, and pull requests through the GitHub website&lt;/h3&gt;
&lt;p&gt;Now, I’ll show you the steps on how I contributed my changes through the GitHub website.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;💡 &lt;strong&gt;Note:&lt;/strong&gt; The screenshots I will show for forking, comitting, and creating a pull request on GitHub were made only to show the process.&lt;/p&gt;
&lt;p&gt;I won’t create an actual pull request adding a random white space. 😉&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;While still on the slots page &lt;code&gt;README.md&lt;/code&gt; file, I clicked the &lt;strong&gt;edit button&lt;/strong&gt; to edit the file directly on GitHub.
&lt;img alt=&quot;learn.svelte.dev on GitHub website, slots section README.md, click &amp;#x22;Edit file&amp;#x22; button&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;2048&quot; height=&quot;1030&quot; src=&quot;https://jaspergabriel.dev/_astro/3-github-slots-readme.DeN0_pbA_13vOte.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/3-github-slots-readme.DeN0_pbA_Z2iwTAY.webp 680w, https://jaspergabriel.dev/_astro/3-github-slots-readme.DeN0_pbA_Z2u0jhs.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Since it was my first time contributing to &lt;a href=&quot;https://github.com/sveltejs/learn.svelte.dev&quot;&gt;Svelte’s tutorial&lt;/a&gt;, I was prompted to &lt;strong&gt;fork the repository&lt;/strong&gt;.
&lt;img alt=&quot;learn.svelte.dev on the GitHub website, prompt to fork the repository.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1574&quot; height=&quot;315&quot; src=&quot;https://jaspergabriel.dev/_astro/4-github-fork-repository.ClVJDXpb_1on0uo.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/4-github-fork-repository.ClVJDXpb_12UtQa.webp 680w, https://jaspergabriel.dev/_astro/4-github-fork-repository.ClVJDXpb_Zm34Rf.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Once I forked the repository, I edited the file with the improvements. Then I clicked &lt;strong&gt;Commit changes&lt;/strong&gt;.
&lt;img alt=&quot;learn.svelte.dev on the GitHub website, click &amp;#x22;Commit changes...&amp;#x22; after editing the README.md file.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;2048&quot; height=&quot;939&quot; src=&quot;https://jaspergabriel.dev/_astro/5-github-edit-file.DkzUlVVY_1pYcDG.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/5-github-edit-file.DkzUlVVY_pxPVE.webp 680w, https://jaspergabriel.dev/_astro/5-github-edit-file.DkzUlVVY_Z72FME.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I was prompted to enter my &lt;strong&gt;commit message&lt;/strong&gt;, along with the optional description and commit email. Then I clicked &lt;strong&gt;Propose changes&lt;/strong&gt;.
&lt;img alt=&quot;learn.svelte.dev on the GitHub website, prompt to enter commit message, optional description, and commit email. Then click &amp;#x22;Propose changes&amp;#x22;.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;2048&quot; height=&quot;940&quot; src=&quot;https://jaspergabriel.dev/_astro/6-github-propose-changes.zh80O94g_2gDyGK.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/6-github-propose-changes.zh80O94g_A7zjT.webp 680w, https://jaspergabriel.dev/_astro/6-github-propose-changes.zh80O94g_Z1eY2DM.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;After making a commit, GitHub will automatically create a &lt;strong&gt;new branch&lt;/strong&gt; with &lt;code&gt;patch-&amp;#x3C;number&gt;&lt;/code&gt; for the branch name. My branch name is &lt;code&gt;patch-3&lt;/code&gt;. Then I reviewed the changes before clicking &lt;strong&gt;Create pull request&lt;/strong&gt;.
&lt;img alt=&quot;learn.svelte.dev on the GitHub website, create a new branch &amp;#x22;patch-3&amp;#x22; for the commit. Then compare changes with the main repository and prompt to create a pull request.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;2048&quot; height=&quot;1125&quot; src=&quot;https://jaspergabriel.dev/_astro/7-github-compare-changes.C_9VojWX_Z1gSGMU.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/7-github-compare-changes.C_9VojWX_Z24FN2G.webp 680w, https://jaspergabriel.dev/_astro/7-github-compare-changes.C_9VojWX_2wMe4G.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Finally, I was prompted to enter a pull request title and description. Then I clicked &lt;strong&gt;Create pull request&lt;/strong&gt;.
&lt;img alt=&quot;learn.svelte.dev on the GitHub website, prompt to enter pull request title and description. Then click &amp;#x22;Create pull request&amp;#x22;.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;2048&quot; height=&quot;1125&quot; src=&quot;https://jaspergabriel.dev/_astro/7-github-compare-changes.C_9VojWX_Z1gSGMU.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/7-github-compare-changes.C_9VojWX_Z24FN2G.webp 680w, https://jaspergabriel.dev/_astro/7-github-compare-changes.C_9VojWX_2wMe4G.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Making changes on the GitHub website works for small commits, but I’d still recommend &lt;strong&gt;cloning the project to your local machine to test your changes&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;It’s ideal to make a habit of &lt;strong&gt;testing your changes before making a pull request to open-source projects&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;So that’s exactly what I did. I cloned the project and followed the &lt;code&gt;README.md&lt;/code&gt; docs for setting up the project locally.&lt;/p&gt;
&lt;p&gt;Once I’ve &lt;strong&gt;tested out that my changes didn’t break anything&lt;/strong&gt;, I made the pull request.&lt;/p&gt;
&lt;h3 id=&quot;pull-request-merged&quot;&gt;Pull request merged!&lt;/h3&gt;
&lt;p&gt;After creating my pull request, it’s up to the maintainers if and when they’ll approve and merge it.&lt;/p&gt;
&lt;p&gt;After a few days, one of my &lt;a href=&quot;https://github.com/sveltejs/learn.svelte.dev/pull/550&quot;&gt;pull requests&lt;/a&gt; was merged.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;My GitHub pull request on learn.svelte.dev repository merged.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;2950&quot; height=&quot;1626&quot; src=&quot;https://jaspergabriel.dev/_astro/9-github-pull-request-merged.DaUMePW6_ZlCQvE.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/9-github-pull-request-merged.DaUMePW6_pbkD9.webp 680w, https://jaspergabriel.dev/_astro/9-github-pull-request-merged.DaUMePW6_2kjY7H.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;p&gt;Making pull requests that &lt;strong&gt;introduce small changes and have good descriptions&lt;/strong&gt; increases your chances of having your pull request approved.&lt;/p&gt;
&lt;p&gt;It also makes it easier for the open-source project maintainers to review your pull request, since they are usually busy with a lot of things.&lt;/p&gt;
&lt;h2 id=&quot;other-possible-improvements-ive-found-and-some-tips&quot;&gt;Other possible improvements I’ve found and some tips&lt;/h2&gt;
&lt;p&gt;I’d like to share that I made three pull requests, but only one has been approved and merged as of writing this.&lt;/p&gt;
&lt;p&gt;Here are the other pull requests if you’re curious:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/sveltejs/learn.svelte.dev/pull/551&quot;&gt;docs: add code snippet for removing if blocks&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/sveltejs/learn.svelte.dev/pull/552&quot;&gt;docs: update code snippet for consistency with source file&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Based on my observations, the less visited pages of a website usually have more areas for improvement. In the case of &lt;a href=&quot;https://learn.svelte.dev/tutorial/welcome-to-svelte&quot;&gt;Svelte’s interactive tutorials&lt;/a&gt;, not everyone will finish the tutorials.&lt;/p&gt;
&lt;p&gt;As a result, the less visited tutorial content might have more areas for improvement, since fewer people can spot potential issues.&lt;/p&gt;
&lt;p&gt;So if you’re looking to improve websites and documentation, &lt;strong&gt;you can start looking at the least visited pages first.&lt;/strong&gt; 😉&lt;/p&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;To recap, I’ve shared my story on how I made an open-source contribution while learning frontend development with Svelte.&lt;/p&gt;
&lt;p&gt;Hopefully, my story shows that sometimes, you can contribute to open-source even if it’s not your first intention. You just have to follow one of the scouts’ principles which is to &lt;em&gt;“leave the campground cleaner than you found it”&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;When you see issues in documentation, you can improve it as long as it’s open-source. Even if it’s not open-source, you can still contact the project’s support team or message the author directly.&lt;/p&gt;
&lt;p&gt;Thank you for reading, and I would love to hear about your own open-source experiences.&lt;/p&gt;
&lt;p&gt;Good luck on your open-source journey!&lt;/p&gt;
&lt;h2 id=&quot;resources&quot;&gt;Resources&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://svelte.dev/&quot;&gt;Svelte&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://kit.svelte.dev/&quot;&gt;SvelteKit&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://learn.svelte.dev/tutorial/welcome-to-svelte&quot;&gt;Learn Svelte and SvelteKit: Interactive Tutorial&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://prismic.io/blog/svelte-vs-react&quot;&gt;Svelte vs React&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/sveltejs/learn.svelte.dev&quot;&gt;learn.svelte.dev GitHub repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.conventionalcommits.org/en/v1.0.0/&quot;&gt;Conventional Commits&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/sveltejs/learn.svelte.dev/pull/550&quot;&gt;Merged pull request to learn.svelte.dev GitHub repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/sveltejs/learn.svelte.dev/pull/551&quot;&gt;Pull request: “docs: add code snippet for removing if blocks”&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/sveltejs/learn.svelte.dev/pull/552&quot;&gt;Pull request: “docs: update code snippet for consistency with source file”&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry>
  <entry>
    <title>How to Make Your Awesome GitHub Profile</title>
    <link href="https://jaspergabriel.dev/blog/how-to-make-your-github-profile/" rel="alternate" type="text/html"/>
    <id>https://jaspergabriel.dev/blog/how-to-make-your-github-profile/</id>
    <published>2024-01-07T00:00:00.000Z</published>
    <updated>2024-01-07T00:00:00.000Z</updated>
    <summary>A comprehensive guide to building an impressive GitHub profile with markdown, badges, icons, and stats.</summary>
    <category term="tech"/>
    <category term="github"/>
    <content type="html">&lt;p&gt;If you’re new to GitHub or have mostly worked with private GitHub repositories, chances are you don’t have a GitHub profile yet.&lt;/p&gt;
&lt;p&gt;A GitHub profile helps provide basic information for those visiting your profile. Having a well-made profile can even help you stand out, especially when you start contributing to open-source projects and people start noticing you.&lt;/p&gt;
&lt;p&gt;In this article, I’ll show how to create your own GitHub profile. I’ll also share where to get inspiration for your profile. Finally, I’ll share resources and tips to help you create an awesome GitHub profile!&lt;/p&gt;
&lt;h2 id=&quot;creating-your-github-profile&quot;&gt;Creating Your GitHub Profile&lt;/h2&gt;
&lt;p&gt;Before you can start customizing your GitHub profile, you’ll first need to create one.&lt;/p&gt;
&lt;p&gt;Here’s a &lt;a href=&quot;https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-github-profile/customizing-your-profile/managing-your-profile-readme&quot;&gt;short guide&lt;/a&gt; from GitHub on how to set up your profile.&lt;/p&gt;
&lt;p&gt;But all you need to do is to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Create a new repository that is &lt;strong&gt;the same as your GitHub username&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Add a &lt;code&gt;README.md&lt;/code&gt; file to your new repository.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For example, my GitHub username is &lt;a href=&quot;https://github.com/jdg2896&quot;&gt;jdg2896&lt;/a&gt;. To create my profile, I need to create a repository also named &lt;a href=&quot;https://github.com/jdg2896/jdg2896&quot;&gt;jdg2896&lt;/a&gt;, then add a &lt;code&gt;README.md&lt;/code&gt; file.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Example GitHub profile repository&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;2720&quot; height=&quot;1326&quot; src=&quot;https://jaspergabriel.dev/_astro/github-profile-repository-example.CAEHJs5s_Z1nEiNT.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/github-profile-repository-example.CAEHJs5s_ZHRNzT.webp 680w, https://jaspergabriel.dev/_astro/github-profile-repository-example.CAEHJs5s_Z1od7nI.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;p&gt;After setting up your &lt;code&gt;repository&lt;/code&gt; and &lt;code&gt;README.md&lt;/code&gt; file, verify that your profile is visible by going to your GitHub profile at &lt;a href=&quot;https://github.com/YOUR-USERNAME&quot;&gt;https://github.com/YOUR-USERNAME&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In my case, it would be &lt;a href=&quot;https://github.com/jdg2896&quot;&gt;https://github.com/jdg2896&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&quot;customizing-your-github-profile&quot;&gt;Customizing Your GitHub Profile&lt;/h2&gt;
&lt;p&gt;Now that you have a GitHub profile, it’s time to get creative!&lt;/p&gt;
&lt;p&gt;The key here is to &lt;strong&gt;let your personality show&lt;/strong&gt; on your profile. Your GitHub profile doesn’t have to be too formal like LinkedIn.&lt;/p&gt;
&lt;p&gt;I’d also suggest &lt;strong&gt;starting simple&lt;/strong&gt;. This helps get your GitHub profile up and running. You can always improve your profile later when you have new ideas.&lt;/p&gt;
&lt;h3 id=&quot;github-flavored-markdown-formatting-and-html&quot;&gt;GitHub Flavored Markdown, Formatting, and HTML&lt;/h3&gt;
&lt;p&gt;For customizing your GitHub profile’s &lt;code&gt;README.md&lt;/code&gt;, you’ll be using &lt;strong&gt;GitHub Flavored Markdown&lt;/strong&gt;. If you’ve written markdown content before, formatting should be easy for you.&lt;/p&gt;
&lt;p&gt;If it’s your first time writing in markdown, you can go to &lt;a href=&quot;https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax&quot;&gt;GitHub’s documentation&lt;/a&gt; to familiarize yourself with the available formatting options.&lt;/p&gt;
&lt;p&gt;You can also use &lt;strong&gt;HTML&lt;/strong&gt; for additional formatting options for your profile.&lt;/p&gt;
&lt;p&gt;I’ve found the following HTML tags to be useful:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;non-breaking space: &lt;code&gt;nbsp;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;div center align: &lt;code&gt;&amp;#x3C;div align=&quot;center&quot;&gt; &amp;#x3C;/div&gt;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can use most HTML tags, but GitHub Flavored Markdown filters out the following HTML tags:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;&amp;#x3C;title&gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;#x3C;textarea&gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;#x3C;style&gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;#x3C;xmp&gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;#x3C;iframe&gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;#x3C;noembed&gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;#x3C;noframes&gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;#x3C;script&gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;#x3C;plaintext&gt;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;💡: To learn more, here’s the &lt;a href=&quot;https://github.github.com/gfm/#html-blocks&quot;&gt;GitHub Flavored Markdown Spec&lt;/a&gt; related to HTML blocks.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id=&quot;finding-inspiration&quot;&gt;Finding Inspiration&lt;/h3&gt;
&lt;p&gt;To help you get started, I suggest looking at other awesome GitHub profiles for ideas. You can go to &lt;a href=&quot;https://github.com/abhisheknaiidu/awesome-github-profile-readme&quot;&gt;awesome-github-profile-readme&lt;/a&gt;, where I’ve found inspiration when making my profile.&lt;/p&gt;
&lt;p&gt;Since the profiles are open-source, you can use some of the good ideas for your awesome profile!&lt;/p&gt;
&lt;p&gt;You can also check out &lt;a href=&quot;https://github.com/jdg2896&quot;&gt;my profile&lt;/a&gt; for some ideas. 😉&lt;/p&gt;
&lt;h3 id=&quot;adding-badges&quot;&gt;Adding Badges&lt;/h3&gt;
&lt;p&gt;For adding badges to your profile, you can check out &lt;a href=&quot;https://github.com/Ileriayo/markdown-badges&quot;&gt;markdown-badges&lt;/a&gt;. The repository has a wide selection of badges to choose from, ranging from programming languages to streaming platforms like Netflix.&lt;/p&gt;
&lt;p&gt;If you can’t find what you’re looking for or want to create custom badges, you can go to &lt;a href=&quot;https://shields.io/&quot;&gt;shields.io&lt;/a&gt;, which is what &lt;a href=&quot;https://github.com/Ileriayo/markdown-badges&quot;&gt;markdown-badges&lt;/a&gt; use.&lt;/p&gt;
&lt;p&gt;Here’s an example where I used &lt;a href=&quot;https://github.com/Ileriayo/markdown-badges&quot;&gt;markdown-badges&lt;/a&gt; on my profile.
&lt;img alt=&quot;Markdown badges example&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1226&quot; height=&quot;194&quot; src=&quot;https://jaspergabriel.dev/_astro/badges-example.DDGqG2BI_Z2KSpJ.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/badges-example.DDGqG2BI_u1I6n.webp 680w, https://jaspergabriel.dev/_astro/badges-example.DDGqG2BI_Z2KSpJ.webp 1226w&quot;&gt;&lt;/p&gt;
&lt;h3 id=&quot;adding-icons&quot;&gt;Adding Icons&lt;/h3&gt;
&lt;p&gt;For adding a &lt;code&gt;skills&lt;/code&gt; or &lt;code&gt;tech stack&lt;/code&gt; section to your profile, I recommend using &lt;a href=&quot;https://github.com/tandpfun/skill-icons&quot;&gt;skill-icons&lt;/a&gt; which provide beautiful icons.&lt;/p&gt;
&lt;p&gt;If your icon is not supported, you can go to &lt;a href=&quot;https://simpleicons.org/&quot;&gt;simpleicons&lt;/a&gt;, which has over 2900 SVG icons for popular brands.&lt;/p&gt;
&lt;p&gt;Here’s an example where I used &lt;a href=&quot;https://github.com/tandpfun/skill-icons&quot;&gt;skill-icons&lt;/a&gt; for my profile’s tech stack section.
&lt;img alt=&quot;Icons example&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1080&quot; height=&quot;246&quot; src=&quot;https://jaspergabriel.dev/_astro/icons-example.Bsze2xGt_Z2w9F9o.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/icons-example.Bsze2xGt_1VirQe.webp 680w, https://jaspergabriel.dev/_astro/icons-example.Bsze2xGt_Z2w9F9o.webp 1080w&quot;&gt;&lt;/p&gt;
&lt;h3 id=&quot;using-emojis&quot;&gt;Using Emojis&lt;/h3&gt;
&lt;p&gt;In GitHub Flavored Markdown, you can use emojis. To see the full list of supported emojis, you can go to this &lt;a href=&quot;https://github.com/ikatyang/emoji-cheat-sheet&quot;&gt;emoji-cheat-sheet&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If you want to get the list of supported emojis yourself, you can use &lt;a href=&quot;https://docs.github.com/en/rest/emojis/emojis#get-emojis&quot;&gt;GitHub’s Emoji API&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Going to &lt;a href=&quot;https://api.github.com/emojis&quot;&gt;https://api.github.com/emojis&lt;/a&gt; on your browser should show a JSON response of all supported emojis.&lt;/p&gt;
&lt;div class=&quot;code-block&quot;&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light-default github-dark-default&quot; data-language=&quot;json&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  &quot;+1&quot;&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;&quot;https://github.githubassets.com/images/icons/emoji/unicode/1f44d.png?v8&quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  &quot;-1&quot;&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;&quot;https://github.githubassets.com/images/icons/emoji/unicode/1f44e.png?v8&quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  &quot;100&quot;&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;&quot;https://github.githubassets.com/images/icons/emoji/unicode/1f4af.png?v8&quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  &quot;1234&quot;&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;&quot;https://github.githubassets.com/images/icons/emoji/unicode/1f522.png?v8&quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  &quot;1st_place_medal&quot;&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;&quot;https://github.githubassets.com/images/icons/emoji/unicode/1f947.png?v8&quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  &quot;2nd_place_medal&quot;&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;&quot;https://github.githubassets.com/images/icons/emoji/unicode/1f948.png?v8&quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  &quot;3rd_place_medal&quot;&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;&quot;https://github.githubassets.com/images/icons/emoji/unicode/1f949.png?v8&quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  &quot;8ball&quot;&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;&quot;https://github.githubassets.com/images/icons/emoji/unicode/1f3b1.png?v8&quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  ...&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Here’s an example where I used emojis for my profile.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Emojis example&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1556&quot; height=&quot;296&quot; src=&quot;https://jaspergabriel.dev/_astro/emojis-example.LLxMXtvt_ZP622P.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/emojis-example.LLxMXtvt_16LSS6.webp 680w, https://jaspergabriel.dev/_astro/emojis-example.LLxMXtvt_1q1jaB.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;h3 id=&quot;adding-github-stats&quot;&gt;Adding GitHub Stats&lt;/h3&gt;
&lt;p&gt;For adding cards and stats for your GitHub activity, I recommend using &lt;a href=&quot;https://github.com/anuraghazra/github-readme-stats&quot;&gt;github-readme-stats&lt;/a&gt;. You can customize your stat cards with different layouts and themes.&lt;/p&gt;
&lt;p&gt;Here’s an example where I added GitHub stats to my profile.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;GitHub stats example&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1432&quot; height=&quot;446&quot; src=&quot;https://jaspergabriel.dev/_astro/github-stats-example.DKGeip3s_27DCpW.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/github-stats-example.DKGeip3s_Z2oVkwB.webp 680w, https://jaspergabriel.dev/_astro/github-stats-example.DKGeip3s_Z1unq5.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;h3 id=&quot;adding-quotes&quot;&gt;Adding Quotes&lt;/h3&gt;
&lt;p&gt;Adding random quotes to your profile can add a nice touch for visitors. I found &lt;a href=&quot;https://github.com/PiyushSuthar/github-readme-quotes&quot;&gt;github-readme-quotes&lt;/a&gt; to be useful for doing just that.&lt;/p&gt;
&lt;p&gt;Here’s what it looks like on my profile. I personally like to add quotes to provide some value to my profile visitors.
&lt;img alt=&quot;Quotes example&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1582&quot; height=&quot;358&quot; src=&quot;https://jaspergabriel.dev/_astro/quote-example.DJrxXLrH_Z1T5Umr.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/quote-example.DJrxXLrH_Z13Y4oS.webp 680w, https://jaspergabriel.dev/_astro/quote-example.DJrxXLrH_qpXX2.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;h3 id=&quot;improving-accessibility&quot;&gt;Improving Accessibility&lt;/h3&gt;
&lt;p&gt;When customizing your profile, make sure that it is &lt;strong&gt;viewable by as many people as possible&lt;/strong&gt;. Not everyone can view or load images. Some people have disabilities, while others have slow internet connections.&lt;/p&gt;
&lt;p&gt;One way you can improve the &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Learn/Accessibility/What_is_accessibility&quot;&gt;accessibility&lt;/a&gt; of your profile is by adding descriptive &lt;code&gt;alt text&lt;/code&gt; to your images.&lt;/p&gt;
&lt;div class=&quot;code-block&quot;&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light-default github-dark-default&quot; data-language=&quot;markdown&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&amp;#x3C;!-- Markdown Image --&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;![&lt;/span&gt;&lt;span&gt;Image Alt Text&lt;/span&gt;&lt;span&gt;](&lt;/span&gt;&lt;span&gt;image-source&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&amp;#x3C;!-- HTML Image Tag --&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&amp;#x3C;img alt=&quot;Image Alt Text&quot; src=&quot;image-source&quot; /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Then to test your profile’s accessibility, you can try to disable image loading on your web browser. Here’s a &lt;a href=&quot;https://www.wikihow.com/Disable-Images-in-Google-Chrome&quot;&gt;guide&lt;/a&gt; on how to disable image loading for Google Chrome.&lt;/p&gt;
&lt;p&gt;Here’s what my profile looks like with image loading disabled on Google Chrome.
&lt;img alt=&quot;GitHub profile accessibility example&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1261&quot; height=&quot;861&quot; src=&quot;https://jaspergabriel.dev/_astro/github-profile-accessibility.Db-pkKRR_Z28X87o.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/github-profile-accessibility.Db-pkKRR_1OcTGh.webp 680w, https://jaspergabriel.dev/_astro/github-profile-accessibility.Db-pkKRR_Z28X87o.webp 1261w&quot;&gt;&lt;/p&gt;
&lt;h3 id=&quot;more-ideas&quot;&gt;More Ideas&lt;/h3&gt;
&lt;p&gt;For adding more infographics to your profile, I recommend checking out &lt;a href=&quot;https://github.com/lowlighter/metrics&quot;&gt;metrics&lt;/a&gt;. This is one of the most starred repositories on GitHub with the &lt;code&gt;github-profile&lt;/code&gt; topic, so I couldn’t leave this out.&lt;/p&gt;
&lt;p&gt;Then I found this beautiful resource &lt;a href=&quot;https://github.com/rzashakeri/beautify-github-profile&quot;&gt;beautify-github-profile&lt;/a&gt;, where you can find more ways to customize your profile.&lt;/p&gt;
&lt;p&gt;If you’re also feeling adventurous, you can explore the &lt;code&gt;github-profile&lt;/code&gt; topic &lt;a href=&quot;https://github.com/topics/github-profile&quot;&gt;here&lt;/a&gt;. The repositories are sorted by the number of stars by default.&lt;/p&gt;
&lt;p&gt;Feel free to explore repositories with the &lt;code&gt;github-profile&lt;/code&gt; topic. You might even find ones that aren’t used as much but are just what you need.&lt;/p&gt;
&lt;h3 id=&quot;github-profile-achievements&quot;&gt;GitHub Profile Achievements&lt;/h3&gt;
&lt;p&gt;While this is not related to customizing your GitHub profile’s &lt;code&gt;README.md&lt;/code&gt;, I feel the need to include it.&lt;/p&gt;
&lt;p&gt;If you go to your GitHub profile, you’ll notice an &lt;code&gt;Achievements&lt;/code&gt; section on the left sidebar.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;GitHub profile achievements&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1241&quot; height=&quot;847&quot; src=&quot;https://jaspergabriel.dev/_astro/github-profile-achievements.n5AZoTgU_Z1b9e6b.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/github-profile-achievements.n5AZoTgU_Z2is8yV.webp 680w, https://jaspergabriel.dev/_astro/github-profile-achievements.n5AZoTgU_Z1b9e6b.webp 1241w&quot;&gt;&lt;/p&gt;
&lt;p&gt;These achievements are fun to collect and can improve your overall GitHub profile.&lt;/p&gt;
&lt;p&gt;To learn more about what achievements are available and how to get them, check out the &lt;a href=&quot;https://github.com/Schweinepriester/github-profile-achievements&quot;&gt;list of GitHub profile achievements&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;To recap, we walked through how to create your GitHub profile. Then I showed how to format your profile with GitHub Flavored Markdown and HTML. After that, I shared where you can get inspiration for your own profile. Finally, I gave tips and resources on ways to customize your profile.&lt;/p&gt;
&lt;p&gt;I hope this can help you in making your awesome GitHub profile. I’d love to see what you can come up with!&lt;/p&gt;
&lt;p&gt;Thank you for reading!&lt;/p&gt;
&lt;h2 id=&quot;resources&quot;&gt;Resources&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-github-profile/customizing-your-profile/managing-your-profile-readme&quot;&gt;Managing your GitHub profile README&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax&quot;&gt;GitHub Basic Writing and Formatting Syntax&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/abhisheknaiidu/awesome-github-profile-readme&quot;&gt;awesome-github-profile-readme repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/Ileriayo/markdown-badges&quot;&gt;markdown-badges repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://shields.io/&quot;&gt;shields.io&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/tandpfun/skill-icons&quot;&gt;skill-icons repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://simpleicons.org/&quot;&gt;simpleicons.org&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/ikatyang/emoji-cheat-sheet&quot;&gt;emoji-cheat-sheet&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/rest/emojis/emojis#get-emojis&quot;&gt;GitHub’s Emoji API&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/anuraghazra/github-readme-stats&quot;&gt;github-readme-stats repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/PiyushSuthar/github-readme-quotes&quot;&gt;github-readme-quotes repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Learn/Accessibility/What_is_accessibility&quot;&gt;MDN: What is accessibility?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.wikihow.com/Disable-Images-in-Google-Chrome&quot;&gt;Disable Images in Google Chrome&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/lowlighter/metrics&quot;&gt;metrics repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/rzashakeri/beautify-github-profile&quot;&gt;beautify-github-profile repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/topics/github-profile&quot;&gt;repositories with “github-profile” topic&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/Schweinepriester/github-profile-achievements&quot;&gt;github-profile-achievements list&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry>
  <entry>
    <title>Reflections and Goal Setting as a Software Engineer</title>
    <link href="https://jaspergabriel.dev/blog/reflections-and-goal-setting/" rel="alternate" type="text/html"/>
    <id>https://jaspergabriel.dev/blog/reflections-and-goal-setting/</id>
    <published>2023-12-31T00:00:00.000Z</published>
    <updated>2023-12-31T00:00:00.000Z</updated>
    <summary>A framework for reflecting on the year and setting SMART goals with checkpoint milestones and daily habits.</summary>
    <category term="personal"/>
    <content type="html">&lt;p&gt;As software engineers, we’re often busy year-round developing new features, fixing production bugs, learning new tech stacks, interacting with different teams, and many more. As a result, we tend to feel tired towards the end of the year. We would use our holiday breaks and vacation leaves to shut off completely, spending time with family and friends, traveling to new places, and doing hobbies like gaming, reading, and whatever makes us feel good.&lt;/p&gt;
&lt;p&gt;Unwinding during our break is completely normal, and is even needed to recharge for the next year. But the break also allows us to take a pause, reflecting on what happened in the past months. Then it gives us the time and space to plan and set big goals, making sure we have something meaningful to work towards and not just run endlessly in the hamster wheel of software engineering.&lt;/p&gt;
&lt;p&gt;In this article, I’ll guide you on your journey towards reflecting on past experiences, along with planning for the future with big, ambitious goals.&lt;/p&gt;
&lt;h2 id=&quot;reflecting-on-what-happened-this-year&quot;&gt;Reflecting on what happened this year&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;“We do not learn from experience…we learn from reflecting on experience.” ― John Dewey&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Often, we let the year pass by without really taking a pause. After a tiring year, we just want to binge our favorite shows, play our favorite video games, and so on.&lt;/p&gt;
&lt;p&gt;By reflecting on our past experiences, we can appreciate our achievements, while also remembering the lessons brought by failures and mistakes.&lt;/p&gt;
&lt;p&gt;This holiday break provides an opportunity to do exactly this, reflecting on what happened this year.&lt;/p&gt;
&lt;h3 id=&quot;a-framework-for-reflecting&quot;&gt;A framework for reflecting&lt;/h3&gt;
&lt;p&gt;For your reflections, I suggest starting simple, especially if you haven’t done this before.&lt;/p&gt;
&lt;p&gt;Allot a few minutes of your time to answer these questions:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;What have I done this year?&lt;/li&gt;
&lt;li&gt;What have I learned this year?&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;For question one, think of &lt;strong&gt;all the things you’ve done, no matter how small&lt;/strong&gt;. Then remember what you felt after finishing the things you’ve done.&lt;/p&gt;
&lt;p&gt;By remembering all the good that you’ve done, you appreciate yourself more. &lt;strong&gt;You did a good job this year!&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Once you’ve listed all the things you’ve done and experienced, it’s time for question two.&lt;/p&gt;
&lt;p&gt;From those experiences, what are the &lt;strong&gt;lessons or improvements&lt;/strong&gt; that you can make?&lt;/p&gt;
&lt;p&gt;Think about what you could’ve done better or wish you’d done if you were able to do those things again.&lt;/p&gt;
&lt;p&gt;Take your time in answering these two questions.&lt;/p&gt;
&lt;h3 id=&quot;my-reflections&quot;&gt;My reflections&lt;/h3&gt;
&lt;p&gt;To give you a reference that might spark ideas of your own, here are my reflections.&lt;/p&gt;
&lt;p&gt;During 2023, I’ve managed to achieve the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Written &lt;strong&gt;12 articles&lt;/strong&gt; (including this one).&lt;/li&gt;
&lt;li&gt;Contributed to &lt;strong&gt;two open-source projects&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Met up with &lt;strong&gt;two professionals&lt;/strong&gt; (a representative at AWS and a founder) over coffee.&lt;/li&gt;
&lt;li&gt;Experienced being at an &lt;strong&gt;early-stage startup&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Watched 13 startups (including ours) pitch live at a &lt;strong&gt;startup incubator’s demo day&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Finished the &lt;strong&gt;AWS Startups Build Accelerator&lt;/strong&gt; program.&lt;/li&gt;
&lt;li&gt;Passed the &lt;strong&gt;AWS Certified Cloud Practitioner&lt;/strong&gt; exam.&lt;/li&gt;
&lt;li&gt;Learned &lt;strong&gt;Svelte and SvelteKit&lt;/strong&gt; by going through the interactive tutorials.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Then here’s what I learned from these experiences:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Writing is not just about writing itself, but all the pre-writing that comes with it. (I’m practicing &lt;a href=&quot;https://www.swyx.io/writing-mise-en-place&quot;&gt;Mise en Place Writing&lt;/a&gt;.)&lt;/li&gt;
&lt;li&gt;You can contribute to open-source projects, even if it’s just &lt;a href=&quot;https://dev.to/jdg2896/how-i-contributed-one-line-of-code-to-ethereum-3poh&quot;&gt;one line of code&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;I should prepare more when meeting up with professionals to lessen the awkward moments.&lt;/li&gt;
&lt;li&gt;If I can buy something instead of building it, then I should buy it. (Using existing solutions for your app’s login and authentication.)&lt;/li&gt;
&lt;li&gt;When learning new technologies, make it a habit to take notes as you learn. (Writing helps you learn faster, while also having valuable notes that you can share with others.)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;planning-for-the-new-year&quot;&gt;Planning for the new year&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;“You do not rise to the level of your goals. You fall to the level of your systems.” - James Clear, Atomic Habits&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id=&quot;a-framework-for-planning-and-setting-goals&quot;&gt;A framework for planning and setting goals&lt;/h3&gt;
&lt;p&gt;For 2024, I’ve adapted Sahil Bloom’s &lt;a href=&quot;https://www.sahilbloom.com/annual-planning&quot;&gt;annual planning template&lt;/a&gt;, which I recommend checking out for yourself.&lt;/p&gt;
&lt;p&gt;For setting your goals, there are two main categories, namely &lt;strong&gt;professional&lt;/strong&gt; and &lt;strong&gt;personal&lt;/strong&gt;. We’ll be focusing on setting your professional goals, but the framework is also applicable to personal goals.&lt;/p&gt;
&lt;p&gt;There are three steps in setting your professional goals:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Choose &lt;strong&gt;1-3 big goals&lt;/strong&gt;, they should be &lt;a href=&quot;https://en.wikipedia.org/wiki/SMART_criteria&quot;&gt;SMART&lt;/a&gt; (specific, measurable, attainable, relevant, time-bound).&lt;/li&gt;
&lt;li&gt;Set up &lt;strong&gt;1-3 checkpoint goals&lt;/strong&gt; for each &lt;strong&gt;big goal&lt;/strong&gt; you have.&lt;/li&gt;
&lt;li&gt;Plan &lt;strong&gt;2-3 daily actions&lt;/strong&gt; that will give you progress towards your &lt;strong&gt;big goals&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The idea here is that you choose your &lt;strong&gt;big, ambitious goals&lt;/strong&gt; that feel impossible to achieve. Then work backwards from your big goals.&lt;/p&gt;
&lt;p&gt;After choosing your &lt;strong&gt;big goals&lt;/strong&gt;, it’s time to set &lt;strong&gt;checkpoint goals&lt;/strong&gt; for each of your big goals. These checkpoint goals are meant to be shorter-term goals, making your big goals easier to work towards.&lt;/p&gt;
&lt;p&gt;For example, I’d like to &lt;strong&gt;read 12 software engineering books&lt;/strong&gt; for next year. In order to achieve this goal, I’ll set up &lt;strong&gt;2-3 checkpoint goals&lt;/strong&gt;. So by April 1, I should have already read &lt;strong&gt;three books&lt;/strong&gt;, then by July 1, &lt;strong&gt;six books&lt;/strong&gt;, and by October 1, &lt;strong&gt;nine books&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Checkpoint goals help keep track of your progress, making sure you don’t stray away from your big goals.&lt;/p&gt;
&lt;p&gt;Lastly, the most important part of this framework is having &lt;strong&gt;daily actions and systems&lt;/strong&gt; that will slowly get you towards your big goals.&lt;/p&gt;
&lt;p&gt;To continue with the example, if I want to &lt;strong&gt;read three books every three months&lt;/strong&gt;, I’d have to start with my reading habits. I’ll start by &lt;strong&gt;reading for 30 minutes daily&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;This is not a strict rule, and some days I’d find myself feeling lazy. On those days, I’d try to read one page at most.&lt;/p&gt;
&lt;p&gt;The important thing is to do your daily habits, even if you don’t feel like doing it. Remember, &lt;strong&gt;anything above zero compounds!&lt;/strong&gt;&lt;/p&gt;
&lt;h3 id=&quot;my-goals&quot;&gt;My goals&lt;/h3&gt;
&lt;p&gt;To give you an example, here’s one of my big goals for 2024:&lt;/p&gt;
&lt;h4 id=&quot;big-goal&quot;&gt;Big goal&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Continue writing &lt;strong&gt;at least 1 article per week&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;checkpoint-goals&quot;&gt;Checkpoint goals&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Written &lt;strong&gt;at least 13 articles&lt;/strong&gt; by April 1.&lt;/li&gt;
&lt;li&gt;Written &lt;strong&gt;at least 26 articles&lt;/strong&gt; by July 1.&lt;/li&gt;
&lt;li&gt;Written &lt;strong&gt;at least 39 articles&lt;/strong&gt; by October 1.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;daily-systems&quot;&gt;Daily systems&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Write around 1000 words per day.&lt;/li&gt;
&lt;li&gt;Take notes when learning new stuff.&lt;/li&gt;
&lt;li&gt;Capture notes when consuming articles.&lt;/li&gt;
&lt;li&gt;Document experiences when trying out new stuff.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;To recap, we’ve walked through the process of reflecting on your past experiences and achievements, along with what you’ve learned from them. We also covered frameworks for setting your big, ambitious goals, and how to make sure that you’re making daily progress towards them.&lt;/p&gt;
&lt;p&gt;I hope this inspires you to take a pause and go on your journey of reflection and planning.&lt;/p&gt;
&lt;p&gt;Thank you for reading! If you have any questions or feedback, I’d love to hear from you.&lt;/p&gt;</content>
  </entry>
  <entry>
    <title>How to Create Real-Time Alerts for Blockchain Events with AWS and QuickNode</title>
    <link href="https://jaspergabriel.dev/blog/real-time-blockchain-alerts-aws-quicknode/" rel="alternate" type="text/html"/>
    <id>https://jaspergabriel.dev/blog/real-time-blockchain-alerts-aws-quicknode/</id>
    <published>2023-12-23T00:00:00.000Z</published>
    <updated>2023-12-23T00:00:00.000Z</updated>
    <summary>Create real-time blockchain event notifications using AWS Lambda webhooks and QuickNode alerts for Ethereum transactions.</summary>
    <category term="tech"/>
    <category term="blockchain"/>
    <category term="aws"/>
    <category term="nodejs"/>
    <content type="html">&lt;p&gt;Blockchains have revolutionized how we store data by introducing the concept of immutable records. This feature allowed &lt;a href=&quot;https://ethereum.org/en/&quot;&gt;Ethereum&lt;/a&gt; and other blockchains to create &lt;a href=&quot;https://ethereum.org/en/developers/docs/smart-contracts/&quot;&gt;smart contracts&lt;/a&gt;, which are code that can’t be changed. Smart contracts ensured that conditions always execute in the same way, which enabled &lt;a href=&quot;https://en.wikipedia.org/wiki/Decentralized_application&quot;&gt;decentralized applications&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;One downside of blockchains is that transactions &lt;strong&gt;take time to process&lt;/strong&gt;. This is the price of guaranteeing the &lt;strong&gt;security&lt;/strong&gt; and &lt;strong&gt;immutability&lt;/strong&gt; of records. Knowing that blockchains will take time to process transactions, it is important to have real-time updates, especially for &lt;strong&gt;customer-facing applications&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;In this article, I’ll show you how to create real-time alerts for blockchain events with &lt;a href=&quot;https://aws.amazon.com/&quot;&gt;AWS&lt;/a&gt; and &lt;a href=&quot;https://www.quicknode.com/&quot;&gt;QuickNode&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&quot;what-to-expect&quot;&gt;What to expect&lt;/h2&gt;
&lt;p&gt;To give a brief overview, you’ll deploy &lt;strong&gt;AWS infrastructure&lt;/strong&gt; with &lt;a href=&quot;https://aws.amazon.com/serverless/sam/&quot;&gt;AWS SAM&lt;/a&gt;, which consists of a webhook that sends email alerts.&lt;/p&gt;
&lt;p&gt;Then you’ll create a &lt;strong&gt;QuickAlert notification&lt;/strong&gt; on &lt;a href=&quot;https://ethereum.org/en/&quot;&gt;Ethereum&lt;/a&gt; mainnet.&lt;/p&gt;
&lt;p&gt;Once both are deployed, you will receive an email whenever there are transfers of at least 1 million &lt;a href=&quot;https://tether.to/en/&quot;&gt;USDT&lt;/a&gt; or &lt;a href=&quot;https://www.circle.com/en/usdc&quot;&gt;USDC&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Here’s a high-level diagram on how QuickAlert notifications work.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;QuickAlerts high-level diagram&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;772&quot; height=&quot;415&quot; src=&quot;https://jaspergabriel.dev/_astro/quickalerts-high-level-diagram.DQtAYEaR_Z2duPm2.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/quickalerts-high-level-diagram.DQtAYEaR_1AkCM4.webp 680w, https://jaspergabriel.dev/_astro/quickalerts-high-level-diagram.DQtAYEaR_Z2duPm2.webp 772w&quot;&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; QuickNode only support webhooks as of writing. In the future, they will support email alerts which will make this solution unnecessary.&lt;/p&gt;
&lt;p&gt;Though the solution that I’ll give you is flexible since we’ll be using a Lambda function, which you can customize to fit your own use cases.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id=&quot;before-we-start&quot;&gt;Before we start&lt;/h2&gt;
&lt;p&gt;To follow along with this guide, make sure you have:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;An &lt;a href=&quot;https://repost.aws/knowledge-center/create-and-activate-aws-account&quot;&gt;AWS Account&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;A &lt;a href=&quot;https://www.quicknode.com/?tap_a=67226-09396e&amp;#x26;tap_s=4357026-faa3ca&amp;#x26;utm_source=affiliate&amp;#x26;utm_campaign=generic&amp;#x26;utm_content=affiliate_landing_page&amp;#x26;utm_medium=generic&quot;&gt;QuickNode Account&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Then knowledge of the following is helpful:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/serverless/sam/&quot;&gt;AWS SAM&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://nodejs.org/en&quot;&gt;Node.js&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.typescriptlang.org/&quot;&gt;TypeScript&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Blockchain&quot;&gt;Blockchains&lt;/a&gt; and &lt;a href=&quot;https://ethereum.org/en/&quot;&gt;Ethereum&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://ethereum.org/en/developers/docs/smart-contracts/&quot;&gt;Smart Contracts&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;With that out of the way, let’s continue.&lt;/p&gt;
&lt;h2 id=&quot;creating-a-webhook-with-aws-lambda-and-sns&quot;&gt;Creating a webhook with AWS Lambda and SNS&lt;/h2&gt;
&lt;h3 id=&quot;setting-up-and-configuring-aws-sam-cli&quot;&gt;Setting up and configuring AWS SAM CLI&lt;/h3&gt;
&lt;p&gt;Before proceeding, make sure to &lt;a href=&quot;https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-getting-started.html&quot;&gt;setup&lt;/a&gt; and &lt;a href=&quot;https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/using-sam-cli-configure.html&quot;&gt;configure&lt;/a&gt; AWS SAM CLI.&lt;/p&gt;
&lt;p&gt;Then verify that you have installed AWS SAM CLI by running &lt;code&gt;sam --version&lt;/code&gt; on your terminal.&lt;/p&gt;
&lt;div class=&quot;code-block&quot;&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light-default github-dark-default&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;SAM CLI, version 1.105.0&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;After you’ve verified AWS SAM CLI, it’s time to create your webhook with AWS.&lt;/p&gt;
&lt;h3 id=&quot;deploying-the-sample-application&quot;&gt;Deploying the sample application&lt;/h3&gt;
&lt;p&gt;I have provided a sample application in &lt;a href=&quot;https://github.com/jdg2896/aws-lambda-sns-poc&quot;&gt;GitHub&lt;/a&gt; to help you get started.&lt;/p&gt;
&lt;p&gt;The application uses &lt;a href=&quot;https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-getting-started.html&quot;&gt;AWS SAM&lt;/a&gt; to deploy the following resources:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/api-gateway/&quot;&gt;Amazon API Gateway&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/lambda/&quot;&gt;AWS Lambda&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/sns/&quot;&gt;Amazon SNS&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=&quot;AWS high-level diagram&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;594&quot; height=&quot;131&quot; src=&quot;https://jaspergabriel.dev/_astro/aws-high-level-diagram.bVtM2y6i_wOSYt.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/aws-high-level-diagram.bVtM2y6i_wOSYt.webp 594w&quot;&gt;&lt;/p&gt;
&lt;p&gt;Then to setup the project:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Clone the &lt;a href=&quot;https://github.com/jdg2896/aws-lambda-sns-poc&quot;&gt;sample application&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Install Node.js dependencies by running &lt;code&gt;npm install&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Add your email to the SNS Topic subscription in the &lt;code&gt;template.yaml&lt;/code&gt; file.
&lt;div class=&quot;code-block&quot;&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light-default github-dark-default&quot; data-language=&quot;yaml&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Resources&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  SnsTopic&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    Type&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;AWS::SNS::Topic&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    Properties&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      TopicName&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;SnsTopicEmailAlert&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      DisplayName&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;SnsTopicEmailAlert&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      Subscription&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;        - &lt;/span&gt;&lt;span&gt;Endpoint&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;&amp;#x3C;YOUR EMAIL HERE&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;          Protocol&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;email&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;Build the application by running &lt;code&gt;sam build&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Deploy the application by running &lt;code&gt;sam deploy&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;You should be prompted to deploy the changeset, enter &lt;code&gt;y&lt;/code&gt; to proceed.&lt;/p&gt;
&lt;div class=&quot;code-block&quot;&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light-default github-dark-default&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Previewing CloudFormation changeset before deployment&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;======================================================&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Deploy this changeset? [y/N]:&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If the deployment is successful, you should see something like this.&lt;/p&gt;
&lt;div class=&quot;code-block&quot;&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light-default github-dark-default&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;CloudFormation outputs from deployed stack&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;-------------------------------------------------------------------------------------------------&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Outputs&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;-------------------------------------------------------------------------------------------------&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Key                 WebEndpoint&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Description         API Gateway endpoint URL for Prod stage&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Value               https://&amp;#x3C;redacted&gt;.execute-api.ap-southeast-1.amazonaws.com/Prod/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;-------------------------------------------------------------------------------------------------&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Successfully created/updated stack - aws-lambda-sns-poc in ap-southeast-1&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Copy the endpoint&lt;/strong&gt; shown in the output. This will be the webhook URL for your QuickAlert notification later.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; You can test your webhook with &lt;a href=&quot;https://www.postman.com/&quot;&gt;Postman&lt;/a&gt; or other API testing tools to make sure it is working.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id=&quot;creating-a-quickalert-notification&quot;&gt;Creating a QuickAlert notification&lt;/h2&gt;
&lt;p&gt;Now that you’ve successfully created a webhook, it’s time to create a QuickAlert notification.&lt;/p&gt;
&lt;p&gt;Register for a &lt;a href=&quot;https://www.quicknode.com/?tap_a=67226-09396e&amp;#x26;tap_s=4357026-faa3ca&amp;#x26;utm_source=affiliate&amp;#x26;utm_campaign=generic&amp;#x26;utm_content=affiliate_landing_page&amp;#x26;utm_medium=generic&quot;&gt;free QuickNode account&lt;/a&gt; if you haven’t done so already.&lt;/p&gt;
&lt;p&gt;Once you have an account, here are the steps for creating your QuickAlert notification.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Select &lt;strong&gt;QuickAlerts&lt;/strong&gt; on the left sidebar, then click &lt;strong&gt;Create QuickAlert&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;QuickNode QuickAlerts Dashboard&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1920&quot; height=&quot;880&quot; src=&quot;https://jaspergabriel.dev/_astro/1-quickalerts-dashboard.BUt0M2U7_Z23XbVg.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/1-quickalerts-dashboard.BUt0M2U7_iUdno.webp 680w, https://jaspergabriel.dev/_astro/1-quickalerts-dashboard.BUt0M2U7_ZBgiYq.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configure the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Name your notification to &lt;strong&gt;My QuickAlert&lt;/strong&gt; or any name you like.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Ethereum&lt;/strong&gt; and &lt;strong&gt;Mainnet&lt;/strong&gt; for chain and network.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Blank Template&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Then click &lt;strong&gt;Next&lt;/strong&gt; to proceed.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Configuring the QuickAlert notification name, chain, network, and template&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1920&quot; height=&quot;880&quot; src=&quot;https://jaspergabriel.dev/_astro/2-create-quickalert.Dmi7WTU6_Z1X1ock.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/2-create-quickalert.Dmi7WTU6_1vu8to.webp 680w, https://jaspergabriel.dev/_astro/2-create-quickalert.Dmi7WTU6_Z17AxQh.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Before continuing, you need to get a &lt;strong&gt;block number&lt;/strong&gt; to test your QuickAlert expression.&lt;/p&gt;
&lt;p&gt;Go to &lt;a href=&quot;https://etherscan.io/advanced-filter?tkn=0xdac17f958d2ee523a2206206994597c13d831ec7&amp;#x26;txntype=2&amp;#x26;amt=1000000%7e100000000&quot;&gt;Etherscan&lt;/a&gt; and choose any transaction you’d like to test.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Finding 1 million USDT and above transfer transactions on Etherscan&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1920&quot; height=&quot;880&quot; src=&quot;https://jaspergabriel.dev/_astro/3-select-transaction.XVFIf_oi_ZUtGgj.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/3-select-transaction.XVFIf_oi_1mibQ.webp 680w, https://jaspergabriel.dev/_astro/3-select-transaction.XVFIf_oi_1MaaDz.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Once you’ve chosen a transaction, copy the &lt;strong&gt;block number&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;USDT transfer transaction details on Etherscan&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1920&quot; height=&quot;880&quot; src=&quot;https://jaspergabriel.dev/_astro/4-get-block-number.CS3BZJox_ZjDesE.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/4-get-block-number.CS3BZJox_Zfczkw.webp 680w, https://jaspergabriel.dev/_astro/4-get-block-number.CS3BZJox_Z2k0OE3.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;After you’ve copied the block number:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Paste it on the &lt;strong&gt;Target Block&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Then click &lt;strong&gt;Get Data&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=&quot;Create QuickAlert expression&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1920&quot; height=&quot;880&quot; src=&quot;https://jaspergabriel.dev/_astro/5-update-target-block.fu1whCHu_ZDqzm3.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/5-update-target-block.fu1whCHu_Z22OMiB.webp 680w, https://jaspergabriel.dev/_astro/5-update-target-block.fu1whCHu_ZT2Dys.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I’ve created a &lt;a href=&quot;https://github.com/quiknode-labs/quickalerts-examples/pull/5&quot;&gt;sample expression&lt;/a&gt; to filter out transfers of at least 1 million USDT or USDC.&lt;/p&gt;
&lt;p&gt;Copy this expression and paste it into the &lt;strong&gt;Create Expression&lt;/strong&gt; field.&lt;/p&gt;
&lt;div class=&quot;code-block&quot;&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light-default github-dark-default&quot; data-language=&quot;ts&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;(&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  tx_logs_address &lt;/span&gt;&lt;span&gt;==&lt;/span&gt;&lt;span&gt; '0xdac17f958d2ee523a2206206994597c13d831ec7'&lt;/span&gt;&lt;span&gt; ||&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  tx_logs_address &lt;/span&gt;&lt;span&gt;==&lt;/span&gt;&lt;span&gt; '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;) &lt;/span&gt;&lt;span&gt;&amp;#x26;&amp;#x26;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;tx_logs_topic0 &lt;/span&gt;&lt;span&gt;==&lt;/span&gt;&lt;span&gt; '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef'&lt;/span&gt;&lt;span&gt; &amp;#x26;&amp;#x26;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;tx_logs_topic1 &lt;/span&gt;&lt;span&gt;=~&lt;/span&gt;&lt;span&gt; '^0x[0]{24}[a-fa-f0-9]{40}$'&lt;/span&gt;&lt;span&gt; &amp;#x26;&amp;#x26;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;tx_logs_topic2 &lt;/span&gt;&lt;span&gt;=~&lt;/span&gt;&lt;span&gt; '^0x[0]{24}[a-fa-f0-9]{40}$'&lt;/span&gt;&lt;span&gt; &amp;#x26;&amp;#x26;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;tx_logs_topic3 &lt;/span&gt;&lt;span&gt;==&lt;/span&gt;&lt;span&gt; ''&lt;/span&gt;&lt;span&gt; &amp;#x26;&amp;#x26;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;tx_logs_data_int &lt;/span&gt;&lt;span&gt;&gt;=&lt;/span&gt;&lt;span&gt; 1000000000000&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Then click &lt;strong&gt;Test Expression&lt;/strong&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; You should see your block number in the &lt;strong&gt;Blocks tested against&lt;/strong&gt; section.&lt;/p&gt;
&lt;p&gt;If there’s a &lt;strong&gt;check mark&lt;/strong&gt;, it means that your QuickAlert expression is working.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;After testing the expression, click &lt;strong&gt;Next&lt;/strong&gt; to proceed.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Test QuickAlert expression&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1920&quot; height=&quot;880&quot; src=&quot;https://jaspergabriel.dev/_astro/6-test-expression.DSLZU38Y_ZYNj0p.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/6-test-expression.DSLZU38Y_Z23Ydjw.webp 680w, https://jaspergabriel.dev/_astro/6-test-expression.DSLZU38Y_llkKy.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Now to create a Destination, click &lt;strong&gt;Create Destination&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Create QuickAlert Destination&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1920&quot; height=&quot;880&quot; src=&quot;https://jaspergabriel.dev/_astro/7-create-destination.DOcvhRnH_cbgaz.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/7-create-destination.DOcvhRnH_Z24uEFF.webp 680w, https://jaspergabriel.dev/_astro/7-create-destination.DOcvhRnH_Z2am0It.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select &lt;strong&gt;Webhook&lt;/strong&gt;, then click &lt;strong&gt;Continue&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Select Webhook as destination type&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1920&quot; height=&quot;880&quot; src=&quot;https://jaspergabriel.dev/_astro/8-select-webhook.CUIUfaX2_1a0B96.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/8-select-webhook.CUIUfaX2_Z1aFEf2.webp 680w, https://jaspergabriel.dev/_astro/8-select-webhook.CUIUfaX2_ZYmSMk.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configure the following for your webhook:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Webhook name to &lt;strong&gt;My Webhook&lt;/strong&gt; or any name you prefer.&lt;/li&gt;
&lt;li&gt;Paste your &lt;strong&gt;webhook&lt;/strong&gt; from earlier to the URL field.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;POST&lt;/strong&gt; for the request type.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;5 - Matched Receipts&lt;/strong&gt; for the payload type.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Then Click &lt;strong&gt;Create Webhook&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Configure webhook name, URL, request type, and payload type&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1920&quot; height=&quot;880&quot; src=&quot;https://jaspergabriel.dev/_astro/9-create-webhook.DqQNOC6a_ZDT0YO.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/9-create-webhook.DqQNOC6a_INMvy.webp 680w, https://jaspergabriel.dev/_astro/9-create-webhook.DqQNOC6a_2gTBRG.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click the &lt;strong&gt;slider&lt;/strong&gt; on the right to enable your webhook.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;code-block&quot;&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light-default github-dark-default&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Then click **Deploy Notification**.&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div class=&quot;code-block&quot;&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light-default github-dark-default&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;![Deploy QuickAlert notification](./real-time-blockchain-alerts-aws-quicknode/10-deploy-notification.png)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id=&quot;testing-the-quickalert-notification&quot;&gt;Testing the QuickAlert Notification&lt;/h2&gt;
&lt;p&gt;Now that you’ve created a QuickAlert notification, wait for it to deliver an alert. It usually takes a &lt;strong&gt;few seconds up to a few minutes&lt;/strong&gt; depending on your filter expressions.&lt;/p&gt;
&lt;p&gt;After waiting, refresh the page.&lt;/p&gt;
&lt;p&gt;You should see changes to the &lt;strong&gt;Last delivery&lt;/strong&gt;, which shows the time since the last notification was triggered.&lt;/p&gt;
&lt;p&gt;Then &lt;strong&gt;click anywhere&lt;/strong&gt; on your QuickAlert notification to view the settings.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Select created QuickAlert&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1920&quot; height=&quot;880&quot; src=&quot;https://jaspergabriel.dev/_astro/11-view-notification.yvmB8X93_1N8Sb6.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/11-view-notification.yvmB8X93_2oOF1P.webp 680w, https://jaspergabriel.dev/_astro/11-view-notification.yvmB8X93_ZyonHW.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;p&gt;Here, you can edit the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Notification Name&lt;/li&gt;
&lt;li&gt;Expression&lt;/li&gt;
&lt;li&gt;Destinations&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Scroll down&lt;/strong&gt; to the bottom of the page to see the events.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;QuickAlert notification settings&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1920&quot; height=&quot;880&quot; src=&quot;https://jaspergabriel.dev/_astro/12-notification-settings.BnFL5Wl2_2oUh0z.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/12-notification-settings.BnFL5Wl2_2mFfOW.webp 680w, https://jaspergabriel.dev/_astro/12-notification-settings.BnFL5Wl2_Z1lKfsO.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;p&gt;Once you’re at the bottom of the page, you should see the &lt;strong&gt;Events&lt;/strong&gt; section.&lt;/p&gt;
&lt;p&gt;This shows all the blockchain events sent by your QuickAlert notification to your webhook.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;QuickAlert notification sent events&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1920&quot; height=&quot;880&quot; src=&quot;https://jaspergabriel.dev/_astro/13-view-events.B7Q6YAzz_Dg332.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/13-view-events.B7Q6YAzz_ZkgoQd.webp 680w, https://jaspergabriel.dev/_astro/13-view-events.B7Q6YAzz_Dyvks.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;h3 id=&quot;checking-your-email-for-alerts&quot;&gt;Checking your email for alerts&lt;/h3&gt;
&lt;p&gt;Now, check the email you’ve configured earlier to see if you’ve received any emails.&lt;/p&gt;
&lt;p&gt;You should see something similar.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Email alert from SNS&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1920&quot; height=&quot;470&quot; src=&quot;https://jaspergabriel.dev/_astro/14-view-email.BXeDB2M0_ZFBTB7.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/14-view-email.BXeDB2M0_1g2a4W.webp 680w, https://jaspergabriel.dev/_astro/14-view-email.BXeDB2M0_Z1klBEG.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;p&gt;Then click the &lt;strong&gt;Etherscan link&lt;/strong&gt; to view the transaction.&lt;/p&gt;
&lt;p&gt;You should see &lt;strong&gt;at least 1 million USDT or USDC&lt;/strong&gt; was transferred.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Transaction details from email alert&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1700&quot; height=&quot;880&quot; src=&quot;https://jaspergabriel.dev/_astro/15-view-transaction.exmVzkSf_Z1JWabN.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/15-view-transaction.exmVzkSf_ZcJ3PF.webp 680w, https://jaspergabriel.dev/_astro/15-view-transaction.exmVzkSf_jTKXi.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;p&gt;After you’re done testing, don’t forget to &lt;strong&gt;disable&lt;/strong&gt; or &lt;strong&gt;delete&lt;/strong&gt; your QuickAlert notification to avoid wasting your credits.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Disable or delete QuickAlert notification&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1920&quot; height=&quot;880&quot; src=&quot;https://jaspergabriel.dev/_astro/16-disable-or-delete-notification.BUQVakv6_Ziltk3.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/16-disable-or-delete-notification.BUQVakv6_Z5IFcB.webp 680w, https://jaspergabriel.dev/_astro/16-disable-or-delete-notification.BUQVakv6_2jUGpA.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;To recap, you’ve successfully created a QuickAlert notification that sends an email whenever there are transfers of at least 1 million USDT or USDC.&lt;/p&gt;
&lt;p&gt;I hope this can help you with integrating real-time blockchain event notifications into your applications.&lt;/p&gt;
&lt;p&gt;Thank you for reading! If you have any questions or feedback, I’d love to hear from you.&lt;/p&gt;
&lt;h2 id=&quot;resources&quot;&gt;Resources&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/jdg2896/aws-lambda-sns-poc&quot;&gt;Sample Application: aws-lambda-sns-poc&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/&quot;&gt;AWS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/api-gateway/&quot;&gt;Amazon API Gateway&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/lambda/&quot;&gt;AWS Lambda&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/sns/&quot;&gt;Amazon SNS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/serverless/sam/&quot;&gt;AWS SAM&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.quicknode.com/&quot;&gt;QuickNode&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.quicknode.com/guides/quicknode-products/quickalerts/an-overview-of-quicknodes-quickalerts&quot;&gt;QuickAlerts&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://ethereum.org/en/&quot;&gt;Ethereum&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://ethereum.org/en/developers/docs/smart-contracts/&quot;&gt;Smart Contracts&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry>
  <entry>
    <title>5 Things I've Learned from the AWS Startups Build Accelerator 2023</title>
    <link href="https://jaspergabriel.dev/blog/aws-startups-build-accelerator-2023/" rel="alternate" type="text/html"/>
    <id>https://jaspergabriel.dev/blog/aws-startups-build-accelerator-2023/</id>
    <published>2023-12-17T00:00:00.000Z</published>
    <updated>2023-12-17T00:00:00.000Z</updated>
    <summary>Key startup lessons: focus on customers, scope MVPs properly, leverage existing solutions, and iterate toward MLP.</summary>
    <category term="personal"/>
    <content type="html">&lt;p&gt;Before &lt;a href=&quot;https://www.ycombinator.com/&quot;&gt;Y Combinator&lt;/a&gt; was &lt;a href=&quot;https://foundersatwork.posthaven.com/grow-the-puzzle-around-you/&quot;&gt;founded in 2005&lt;/a&gt; and ran its &lt;a href=&quot;https://www.businessofbusiness.com/articles/y-combinator-where-are-they-now-first-batch-reddit-twitch/&quot;&gt;first successful summer batch&lt;/a&gt;, startup accelerators weren’t a thing. Now, there are &lt;a href=&quot;https://about.crunchbase.com/blog/100-startup-accelerators-around-the-world/&quot;&gt;hundreds (if not thousands) of startup accelerators around the world&lt;/a&gt;. One of the accelerator programs startups can join is the &lt;a href=&quot;https://aws.amazon.com/startups/accelerators/build&quot;&gt;AWS Startups Build Accelerator&lt;/a&gt;, which is a 10-week virtual program that provides training and support for launching MVPs to market.&lt;/p&gt;
&lt;p&gt;For the 2023 cohort, out of 2000+ startups that applied, 500+ startups were selected for the program &lt;a href=&quot;https://www.linkedin.com/posts/p33r-finance_p33r-awsbuildaccelerator-activity-7121072561857208320-U9f-/&quot;&gt;including ours&lt;/a&gt;. The program provided $2,000 in AWS credits, self-paced courses on &lt;a href=&quot;https://skillbuilder.aws/&quot;&gt;AWS Skill Builder&lt;/a&gt;, a &lt;a href=&quot;https://slack.com/&quot;&gt;Slack&lt;/a&gt; community with other startup founders, and live AMA sessions with AWS Solution Architects.&lt;/p&gt;
&lt;p&gt;In the 10 weeks the program ran, the following topics were covered:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Understanding Customers&lt;/li&gt;
&lt;li&gt;Frontend Development&lt;/li&gt;
&lt;li&gt;Backend Development&lt;/li&gt;
&lt;li&gt;Security&lt;/li&gt;
&lt;li&gt;Scalable Architectures&lt;/li&gt;
&lt;li&gt;Databases&lt;/li&gt;
&lt;li&gt;Best Practices&lt;/li&gt;
&lt;li&gt;Generative AI&lt;/li&gt;
&lt;li&gt;Leveraging Vendors&lt;/li&gt;
&lt;li&gt;Innovating Iteratively Post-Launch&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;With the AWS Startups Build Accelerator for 2023 finally wrapped up, it’s time to reflect on the lessons learned.&lt;/p&gt;
&lt;p&gt;In this article, I’ll be sharing five things I’ve learned throughout the program. The lessons cover what I feel is essential for building successful MVPs, which can lead to further funding rounds and startup growth.&lt;/p&gt;
&lt;p&gt;Even though the accelerator program was intended for technical founders, non-technical founders and fellow software engineers can also find some valuable lessons applicable to their own startup journeys.&lt;/p&gt;
&lt;h2 id=&quot;1-focus-on-the-customer&quot;&gt;1. Focus on the customer&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a href=&quot;https://www.intercom.com/blog/making-things-people-want/&quot;&gt;It’s easier to make things people want than to make people want things.&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;One of the recurring themes in the weekly sessions was the emphasis on bringing value to customers. It makes sense since startups try to provide solutions to problems that customers are willing to pay.&lt;/p&gt;
&lt;p&gt;In order to provide value to customers, we first need to define who our potential customers are. One way to do this is by building a &lt;a href=&quot;https://blog.hubspot.com/marketing/buyer-persona-research&quot;&gt;Customer Persona&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Here are some questions to answer when building your &lt;strong&gt;customer persona&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Who are our customers?&lt;/li&gt;
&lt;li&gt;What are their pain points?&lt;/li&gt;
&lt;li&gt;Why are they trying to solve the pain?&lt;/li&gt;
&lt;li&gt;How can we help them?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Once you’ve defined who your customer is, it’s time to build something functional that adds value to customers.&lt;/p&gt;
&lt;p&gt;You should also focus on your &lt;a href=&quot;https://www.omniconvert.com/what-is/uvp-unique-value-proposition/&quot;&gt;Unique Value Proposition (UVP)&lt;/a&gt;, which defines how your potential customers will benefit from your solution.&lt;/p&gt;
&lt;p&gt;A framework for defining your UVP is, &lt;strong&gt;“We help X do Y by doing Z”&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;When presenting your UVP to your potential customers, focus on the &lt;strong&gt;benefits&lt;/strong&gt;, and reinforce it with &lt;strong&gt;features&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Another thing to keep in mind is the customer’s data. Make sure to securely handle customer data, especially &lt;a href=&quot;https://www.dol.gov/general/ppii#:~:text=Personal%20Identifiable%20Information%20(PII)%20is,either%20direct%20or%20indirect%20means.&quot;&gt;Personally Identifiable Information (PII)&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Remember, &lt;a href=&quot;https://www.codemotion.com/magazine/frontend/design-ux/ux-design-enhance-data-security/&quot;&gt;data security is part of the user experience&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&quot;2-scope-your-mvp&quot;&gt;2. Scope your MVP&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a href=&quot;https://www.linkedin.com/pulse/when-less-more-danger-over-engineering-trienpont-international/&quot;&gt;Don’t over-engineer or over-innovate.&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Once you’ve defined the customer pain points you’re trying to solve, it’s time to scope your MVP.&lt;/p&gt;
&lt;p&gt;Oftentimes, we make the mistake of thinking too far ahead in the future, losing focus on what’s important.&lt;/p&gt;
&lt;p&gt;Remember, the point of building an MVP is to &lt;strong&gt;validate&lt;/strong&gt; if your idea will solve the customer’s &lt;strong&gt;pain points&lt;/strong&gt;, and if customers are willing to &lt;strong&gt;pay&lt;/strong&gt; to use your product.&lt;/p&gt;
&lt;p&gt;For scoping out your MVP, here are some guidelines:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Who are your target customers?&lt;/li&gt;
&lt;li&gt;What is the problem that you’re trying to solve?&lt;/li&gt;
&lt;li&gt;How will you solve that problem?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Make sure to focus on features that will provide value to your potential customers.&lt;/p&gt;
&lt;h2 id=&quot;3-leverage-existing-solutions-for-non-core-functionality&quot;&gt;3. Leverage existing solutions for non-core functionality&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a href=&quot;https://softwareengineering.stackexchange.com/questions/29513/is-reinventing-the-wheel-really-all-that-bad&quot;&gt;Don’t reinvent the wheel.&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;After defining both your customers and the scope of your MVP, it’s time to start building.&lt;/p&gt;
&lt;p&gt;One mistake that I’ve encountered a lot is trying to build &lt;strong&gt;every part&lt;/strong&gt; of the system. This can be a costly mistake, especially for early-stage startups where your main goal is to &lt;strong&gt;validate your idea&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;By trying to build parts of your system that don’t provide value to customers, you risk losing your ability to move quickly and pivot if your assumptions are wrong.&lt;/p&gt;
&lt;p&gt;There’s also an opportunity cost since instead of building actual features that customers want, you’re wasting time building something that could easily be built with an existing solution.&lt;/p&gt;
&lt;p&gt;An example of where you can use existing solutions is &lt;strong&gt;authentication and user management&lt;/strong&gt;. Building one from scratch will take a lot of time and won’t be as secure as the existing solutions.&lt;/p&gt;
&lt;p&gt;The exception here is if your startup is focused on providing authentication services, then it’s a core part of your business and you should build it.&lt;/p&gt;
&lt;p&gt;Here are some examples of services where you can use existing solutions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Authentication and User Management&lt;/strong&gt;:
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/cognito/&quot;&gt;Cognito&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://auth0.com/&quot;&gt;Auth0&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.okta.com/&quot;&gt;Okta&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;AI Solutions&lt;/strong&gt;:
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://openai.com/&quot;&gt;OpenAI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/generative-ai/&quot;&gt;AWS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://cloud.google.com/ai/generative-ai&quot;&gt;Google Cloud&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://azure.microsoft.com/en-us/solutions/ai&quot;&gt;Azure&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;By using existing solutions, you allow your startup to go to market faster, and actually validate your ideas and get customer feedback.&lt;/p&gt;
&lt;p&gt;Just remember, &lt;a href=&quot;https://www.tokyodev.com/articles/all-code-is-technical-debt&quot;&gt;every code you write becomes technical debt&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&quot;become-a-great-buyer&quot;&gt;Become a Great Buyer&lt;/h3&gt;
&lt;p&gt;&lt;img alt=&quot;AWS Well-Architected for Vendors&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1000&quot; height=&quot;420&quot; src=&quot;https://jaspergabriel.dev/_astro/aws-well-architected.CkYqa247_ZnIJAU.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/aws-well-architected.CkYqa247_mkB3j.webp 680w, https://jaspergabriel.dev/_astro/aws-well-architected.CkYqa247_ZnIJAU.webp 1000w&quot;&gt;&lt;/p&gt;
&lt;p&gt;For guidelines on selecting 3rd-party vendors, the &lt;a href=&quot;https://docs.aws.amazon.com/wellarchitected/latest/framework/welcome.html&quot;&gt;AWS Well-Architected Framework&lt;/a&gt; can be applied here.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Operational Excellence&lt;/strong&gt; - Consider differentiation, switching cost, and criticality.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Security&lt;/strong&gt; - Consider compliance attestations in the short to long term.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reliability&lt;/strong&gt; - Consider reputation, funding, and existing traction.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Performance&lt;/strong&gt; - Consider product use patterns, frequency of need, and scalability.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cost Efficiency&lt;/strong&gt; - Consider vendor costs in the pricing model.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Use these guidelines when evaluating which vendor to use.&lt;/p&gt;
&lt;h3 id=&quot;outgrowing-an-existing-solution&quot;&gt;Outgrowing an existing solution&lt;/h3&gt;
&lt;p&gt;Eventually, if your idea is correct and you’ve found loyal customers, your startup will go through a rapid growth phase.&lt;/p&gt;
&lt;p&gt;In this case, you might outgrow solutions from existing vendors. You can also use the Well-Architected Framework to re-evaluate if the 3rd-party solutions are still worth it, or if it’s time to &lt;strong&gt;move&lt;/strong&gt; to another vendor or &lt;strong&gt;build&lt;/strong&gt; a custom solution.&lt;/p&gt;
&lt;p&gt;It might be time to move away from a vendor if:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Pricing&lt;/strong&gt; is prohibitively expensive at scale.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Security&lt;/strong&gt; is not compliant with your business requirements (HIPAA, ISO, SOC2).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Scalability&lt;/strong&gt; is not being supported, vendor solution is unstable.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Performance&lt;/strong&gt; is not predictable.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;leveraging-existing-solutions-with-the-startup-im-working-with&quot;&gt;Leveraging existing solutions with the startup I’m working with&lt;/h3&gt;
&lt;p&gt;Here is an example of leveraging existing solutions in the startup I’m currently working with.&lt;/p&gt;
&lt;p&gt;We have a service that allows customers to &lt;strong&gt;sell their crypto&lt;/strong&gt; and &lt;strong&gt;receive fiat&lt;/strong&gt; in their &lt;strong&gt;bank accounts or e-wallets&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Rails by P33R Finance High-Level Architecture&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;774&quot; height=&quot;307&quot; src=&quot;https://jaspergabriel.dev/_astro/rails-architecture.CiH7edB0_Z2jr8Qk.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/rails-architecture.CiH7edB0_1upUro.webp 680w, https://jaspergabriel.dev/_astro/rails-architecture.CiH7edB0_Z2jr8Qk.webp 774w&quot;&gt;&lt;/p&gt;
&lt;p&gt;There are two things in this flow where we opted to use a 3rd-party vendor:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Transaction gas fee computation&lt;/li&gt;
&lt;li&gt;Blockchain smart contract events alerting&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In order to deposit crypto into the smart contract, we used &lt;a href=&quot;https://web3js.org/&quot;&gt;Web3.js&lt;/a&gt; to interact with the smart contract.&lt;/p&gt;
&lt;p&gt;For sending transactions, we needed to properly compute gas fees. In testing our MVP, we’ve found that sometimes the default gas values provided by Web3.js weren’t enough, which caused some transactions to fail.&lt;/p&gt;
&lt;p&gt;Luckily, &lt;a href=&quot;https://metamask.io/news/developers/metamasks-gas-api-is-now-available-to-any-developer-via-infura/&quot;&gt;MetaMask’s Gas API was recently released to the public&lt;/a&gt;. Since &lt;a href=&quot;https://metamask.io/&quot;&gt;MetaMask&lt;/a&gt; is a leading crypto wallet and its Gas API is battle-tested in production, we decided to use their Gas API instead of building our own solution.&lt;/p&gt;
&lt;p&gt;Then after the crypto is deposited to the smart contract, we are using smart contract events to start the process of sending fiat to the customer.&lt;/p&gt;
&lt;p&gt;We originally implemented our own solution to listen and send smart contract events, which I documented &lt;a href=&quot;https://dev.to/jdg2896/how-to-implement-and-deploy-a-smart-contract-event-listener-with-aws-cdk-b1&quot;&gt;here&lt;/a&gt;. Later, we found out that it was causing problems and was harder to maintain at this early stage, so we switched to a 3rd-party solution with &lt;a href=&quot;https://www.quicknode.com/&quot;&gt;QuickNode&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In hindsight, we should’ve done this from the start, but that’s what happens when you reflect on your experiences. You discover better ways to approach a problem or improve an existing solution.&lt;/p&gt;
&lt;h2 id=&quot;4-aim-for-iteration-not-perfection&quot;&gt;4. Aim for iteration, not perfection&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a href=&quot;https://www.aha.io/roadmapping/guide/plans/what-is-a-minimum-lovable-product&quot;&gt;Iterate towards an MLP (Minimum Lovable Product).&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;img alt=&quot;Build, Test, Iterate&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1000&quot; height=&quot;420&quot; src=&quot;https://jaspergabriel.dev/_astro/build-test-iterate.XbfPiKER_Z215urp.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/build-test-iterate.XbfPiKER_165wDg.webp 680w, https://jaspergabriel.dev/_astro/build-test-iterate.XbfPiKER_Z215urp.webp 1000w&quot;&gt;&lt;/p&gt;
&lt;p&gt;After launching your MVP, you might think the journey is over and you can just wait to gain new customers. Well, not quite.&lt;/p&gt;
&lt;p&gt;The work is just getting started after you launch your MVP. You’ll need to continuously test, gather customer feedback, and improve your existing product. That’s the only way you’ll get and retain loyal customers, and in turn, grow your startup.&lt;/p&gt;
&lt;h3 id=&quot;testing-your-mvp&quot;&gt;Testing your MVP&lt;/h3&gt;
&lt;p&gt;Before conducting tests with real customers, you first need to make sure that you have sufficient monitoring in place for your systems.&lt;/p&gt;
&lt;p&gt;Ideally, you should be monitoring the &lt;strong&gt;health of your systems&lt;/strong&gt; and &lt;strong&gt;key metrics&lt;/strong&gt; that define success for your MVP. By having monitoring in place, you don’t rely on customers (you shouldn’t) to tell you that your product is not working.&lt;/p&gt;
&lt;p&gt;After ensuring you have proper monitoring, you can conduct testing for your MVP.&lt;/p&gt;
&lt;p&gt;Here are some approaches you can try for testing your MVP:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.browserstack.com/guide/what-is-ux-testing&quot;&gt;UX Testing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.productplan.com/glossary/beta-test/&quot;&gt;Beta Testing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.optimizely.com/optimization-glossary/ab-testing/&quot;&gt;A/B Tests&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And here are additional ways to capture customer feedback:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Survey tools:
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.surveymonkey.com/&quot;&gt;Survey Monkey&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.typeform.com/try/typeformbrand/&quot;&gt;Typeform&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.userinterviews.com/blog/the-ultimate-guide-to-doing-kickass-customer-interviews&quot;&gt;Customer interviews&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.questionpro.com/blog/focus-group/&quot;&gt;Focus groups&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;One tip for gathering customer feedback is to make it convenient. &lt;strong&gt;Make it easy for customers to provide feedback&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Then make sure you also have a presence in other channels such as:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Chatbots&lt;/li&gt;
&lt;li&gt;Cloud-based call center&lt;/li&gt;
&lt;li&gt;Notifications (push, SMS, email)&lt;/li&gt;
&lt;li&gt;Social channels&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;iterating-your-mvp&quot;&gt;Iterating your MVP&lt;/h3&gt;
&lt;p&gt;Once you’ve gathered enough customer feedback, it’s now time to iterate your product.&lt;/p&gt;
&lt;p&gt;Before you can quickly iterate your product, you need to have the proper infrastructure set in place to support fast iterations. Consider setting up &lt;a href=&quot;https://about.gitlab.com/topics/ci-cd/&quot;&gt;Continuous Integration / Continuous Deployment (CI/CD)&lt;/a&gt; pipelines and versioning.&lt;/p&gt;
&lt;p&gt;Having a &lt;strong&gt;CI/CD pipeline&lt;/strong&gt; allows you to automate repetitive tasks, such as building deployment files, running unit and integration tests, and so on.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Versioning&lt;/strong&gt; on the other hand allows you to keep track of your deployments, and if an issue occurs, you can quickly pinpoint which version caused the issues.&lt;/p&gt;
&lt;p&gt;After addressing the infrastructure, it’s time to review customer feedback. Make sure to allocate time to address issues raised by customers.&lt;/p&gt;
&lt;p&gt;Then here are ways to deal with different types of feedback:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Positive feedback&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Can be published as customer testimonials (with permission)&lt;/li&gt;
&lt;li&gt;Builds credibility and trust&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Negative feedback&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Opportunity to learn, adapt, and adjust approach to better meet customer expectations&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Make sure to reflect the customer’s voices into your products, be adaptable, and iterate as needed.&lt;/p&gt;
&lt;h2 id=&quot;5-document-wins-and-failures&quot;&gt;5. Document wins and failures&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a href=&quot;https://plan.io/blog/lessons-learned-from-failed-projects/&quot;&gt;“We do not learn from experience… we learn from reflecting on experience.”&lt;/a&gt; ― John Dewey&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Lastly, we should try to put as much as possible into writing. This means adding proper READMEs to code, creating diagrams on the system architecture and user journeys, and documenting decisions with &lt;a href=&quot;https://www.ietf.org/standards/rfcs/&quot;&gt;RFCs&lt;/a&gt; and &lt;a href=&quot;https://adr.github.io/&quot;&gt;ADRs&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I haven’t used RFCs and ADRs much, but there should be enough resources to help you get started in the links above.&lt;/p&gt;
&lt;p&gt;Also, here’s a useful resource for RFCs, &lt;a href=&quot;https://blog.pragmaticengineer.com/rfcs-and-design-docs/&quot;&gt;Companies Using RFCs or Design Docs and Examples of These&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;My lack of experience in using tools like RFCs and ADRs showed me the bad side of not properly documenting architecture, code, and decisions.&lt;/p&gt;
&lt;p&gt;Some of the negatives when you don’t document wins and failures:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;harder to onboard new engineers.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.thrivelearning.com/lms-glossary/what-is-a-knowledge-silo&quot;&gt;knowledge silos&lt;/a&gt;, where information is isolated to a few members of the team.&lt;/li&gt;
&lt;li&gt;issues repeat themselves (because of a lack of proper documentation).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;By starting to document wins and failures, only then can we learn from our experiences and be better engineers, be better startups.&lt;/p&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;To recap, I shared what I’ve learned in the AWS Startups Build Accelerator 2023, which are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;bringing value to customers&lt;/li&gt;
&lt;li&gt;scoping out MVPs&lt;/li&gt;
&lt;li&gt;leveraging existing solutions from vendors&lt;/li&gt;
&lt;li&gt;testing and iterating towards an MLP (Minimum Lovable Product)&lt;/li&gt;
&lt;li&gt;documenting wins and failures.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I hope you’ve picked up an idea or two from the lessons I shared, and may it help you in your own startup journey.&lt;/p&gt;
&lt;p&gt;Thank you for reading! If you have any questions or feedback, I’d love to hear from you.&lt;/p&gt;
&lt;h2 id=&quot;resources&quot;&gt;Resources&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://foundersatwork.posthaven.com/grow-the-puzzle-around-you/&quot;&gt;Grow the Puzzle Around You - Jessica Livingston (Y Combinator)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.businessofbusiness.com/articles/y-combinator-where-are-they-now-first-batch-reddit-twitch/&quot;&gt;Y Combinator’s First Batch: Where are they now?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://about.crunchbase.com/blog/100-startup-accelerators-around-the-world/&quot;&gt;100 Startup Accelerators Around the World You Need to Know About&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/startups/accelerators/build&quot;&gt;AWS Startups Build Accelerator&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.intercom.com/blog/making-things-people-want/&quot;&gt;Making things people want&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://blog.hubspot.com/marketing/buyer-persona-research&quot;&gt;How to Create Detailed Buyer Personas for Your Business&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.codemotion.com/magazine/frontend/design-ux/ux-design-enhance-data-security/&quot;&gt;7 Ways to Use UX Design to Enhance User Data Security&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.omniconvert.com/what-is/uvp-unique-value-proposition/&quot;&gt;What is UVP (Unique Value Proposition)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.linkedin.com/pulse/when-less-more-danger-over-engineering-trienpont-international/&quot;&gt;When Less Is More: The Danger of Over-Engineering&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://softwareengineering.stackexchange.com/questions/29513/is-reinventing-the-wheel-really-all-that-bad&quot;&gt;Is reinventing the wheel really all that bad?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.tokyodev.com/articles/all-code-is-technical-debt&quot;&gt;All code is technical debt&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.aws.amazon.com/wellarchitected/latest/framework/welcome.html&quot;&gt;AWS Well-Architected Framework&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.aha.io/roadmapping/guide/plans/what-is-a-minimum-lovable-product&quot;&gt;What is a Minimum Lovable Product (MLP)?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.browserstack.com/guide/what-is-ux-testing&quot;&gt;What is UX Testing with example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.productplan.com/glossary/beta-test/&quot;&gt;What is Beta Testing?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.optimizely.com/optimization-glossary/ab-testing/&quot;&gt;What is A/B Testing?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.userinterviews.com/blog/the-ultimate-guide-to-doing-kickass-customer-interviews&quot;&gt;The Ultimate Guide to Doing Kickass Customer Interviews&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.questionpro.com/blog/focus-group/&quot;&gt;Focus group: What It Is and How to Conduct It + Examples&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://about.gitlab.com/topics/ci-cd/&quot;&gt;What is CI/CD?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://plan.io/blog/lessons-learned-from-failed-projects/&quot;&gt;What to Do When a Project Fails: How to Document and Share Lessons Learned&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.ietf.org/standards/rfcs/&quot;&gt;IETF: Requests For Comment (RFCs)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://blog.pragmaticengineer.com/rfcs-and-design-docs/&quot;&gt;Companies Using RFCs or Design Docs and Examples of These&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://adr.github.io/&quot;&gt;Architectural Decision Records (ADRs)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry>
  <entry>
    <title>Starting My AWS Certification Journey as a Certified Cloud Practitioner</title>
    <link href="https://jaspergabriel.dev/blog/aws-certified-cloud-practitioner/" rel="alternate" type="text/html"/>
    <id>https://jaspergabriel.dev/blog/aws-certified-cloud-practitioner/</id>
    <published>2023-12-10T00:00:00.000Z</published>
    <updated>2023-12-10T00:00:00.000Z</updated>
    <summary>How I prepared for and passed the AWS Certified Cloud Practitioner exam, including study strategies and exam tips.</summary>
    <category term="tech"/>
    <category term="aws"/>
    <content type="html">&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;/h2&gt;
&lt;p&gt;As software engineers, we need to keep up with the pace of technology evolution by constantly learning. One example of evolving tech is cloud computing, which saw the rise of cloud providers like &lt;a href=&quot;https://aws.amazon.com/&quot;&gt;AWS&lt;/a&gt; being used in modern-day applications. Since cloud technologies are constantly evolving, certain standards for validating one’s skills in the cloud are needed, which is where &lt;a href=&quot;https://aws.amazon.com/certification/&quot;&gt;AWS Certifications&lt;/a&gt; come in.&lt;/p&gt;
&lt;p&gt;Getting a certification isn’t necessarily needed for most jobs, but having one gives you a sense of accomplishment and something to brag about.&lt;/p&gt;
&lt;p&gt;In this article, I’ll share how I got my first AWS certification, starting from my Google Cloud certification, my experience with AWS, scheduling and canceling my AWS Certified Solutions Architect - Associate exam, and finally taking and passing the AWS Certified Cloud Practitioner exam.&lt;/p&gt;
&lt;h2 id=&quot;before-starting-my-aws-certification-journey&quot;&gt;Before starting my AWS certification journey&lt;/h2&gt;
&lt;p&gt;Before I share my AWS certification journey, it would be helpful to share my professional background since my previous experiences helped me in getting my first certification.&lt;/p&gt;
&lt;p&gt;Back in 2019, I passed my &lt;a href=&quot;https://www.credential.net/947b6933-cf14-4a79-b094-37381ca4d4c3&quot;&gt;Google Cloud Certified Associate Cloud Engineer&lt;/a&gt; exam.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Google Cloud Certified Associate Cloud Engineer certificate&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1270&quot; height=&quot;978&quot; src=&quot;https://jaspergabriel.dev/_astro/google-cloud-certified-associate-cloud-engineer-certificate.CkSgmMWA_1CIA62.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/google-cloud-certified-associate-cloud-engineer-certificate.CkSgmMWA_Z1VhiW1.webp 680w, https://jaspergabriel.dev/_astro/google-cloud-certified-associate-cloud-engineer-certificate.CkSgmMWA_1CIA62.webp 1270w&quot;&gt;&lt;/p&gt;
&lt;p&gt;This was my first experience taking a certification exam at a testing center near my previous workplace. Then for my exam preparation, I mostly did hands-on labs in &lt;a href=&quot;https://go.qwiklabs.com/&quot;&gt;Qwiklabs&lt;/a&gt;. These hands-on activities helped me retain cloud concepts since Google Cloud (GCP) was my first experience with cloud computing.&lt;/p&gt;
&lt;p&gt;Then in 2020, I started working with AWS. My first two years with AWS were mostly interacting with the Node.js apps I’ve deployed in &lt;a href=&quot;https://aws.amazon.com/ec2/&quot;&gt;EC2&lt;/a&gt; and reviewing logs since we had a DevOps engineer who managed the cloud infrastructure.&lt;/p&gt;
&lt;p&gt;After two years, I moved to a Web3 startup where I was given a lead software engineer role. This new role gave me more hands-on experience with AWS, where  I’ve learned to implement serverless technologies like &lt;a href=&quot;https://aws.amazon.com/lambda/&quot;&gt;Lambda&lt;/a&gt; and &lt;a href=&quot;https://aws.amazon.com/dynamodb/&quot;&gt;DynamoDB&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;After a year, I joined a new startup founded by my previous colleagues, where I managed to explore AWS more deeply since I’m the only backend engineer. I architected backend systems using serverless technologies for the POCs and MVPs.&lt;/p&gt;
&lt;p&gt;Here’s a summary of the technologies I’ve used in AWS to give you a sense of my knowledge before taking my AWS certification exam:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/lambda/&quot;&gt;AWS Lambda&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/api-gateway/&quot;&gt;Amazon API Gateway&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/step-functions/&quot;&gt;AWS Step Functions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/dynamodb/&quot;&gt;Amazon DynamoDB&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/rds/&quot;&gt;Amazon RDS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/s3/&quot;&gt;Amazon S3&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/ec2/&quot;&gt;Amazon EC2&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/ecs/&quot;&gt;Amazon ECS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/fargate/&quot;&gt;AWS Fargate&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/sqs/&quot;&gt;Amazon SQS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/sns/&quot;&gt;Amazon SNS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/ses/&quot;&gt;Amazon SES&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/ecr/&quot;&gt;Amazon ECR&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/cognito/&quot;&gt;Amazon Cognito&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/cloudwatch/&quot;&gt;Amazon CloudWatch&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/amplify/&quot;&gt;AWS Amplify&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/systems-manager/&quot;&gt;AWS Systems Manager&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/systems-manager/features/#Parameter_Store&quot;&gt;AWS Parameter Store&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/systems-manager/features/#AppConfig&quot;&gt;AWS AppConfig&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/vpc/&quot;&gt;Amazon VPC&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/route53/&quot;&gt;Amazon Route 53&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/serverless/sam/&quot;&gt;AWS SAM&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/cdk/&quot;&gt;AWS CDK&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;With that out of the way, let’s continue with my journey.&lt;/p&gt;
&lt;h2 id=&quot;scheduling-and-canceling-my-aws-certified-solutions-architect---associate-exam&quot;&gt;Scheduling and canceling my AWS Certified Solutions Architect - Associate exam&lt;/h2&gt;
&lt;p&gt;Back in September, I saw a Facebook ad for the &lt;strong&gt;Get AWS Certified: Associate Challenge&lt;/strong&gt; where you can get a &lt;strong&gt;50% discount&lt;/strong&gt; on the exam fee. The fee costs &lt;strong&gt;150 USD&lt;/strong&gt; at the time of writing, so you only need to pay &lt;strong&gt;75 USD&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Get AWS Certified: Associate Challenge ad&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;715&quot; height=&quot;197&quot; src=&quot;https://jaspergabriel.dev/_astro/get-aws-certified-associate-challenge-ad.C_1ry-DQ_1pukFt.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/get-aws-certified-associate-challenge-ad.C_1ry-DQ_ZjhRX6.webp 680w, https://jaspergabriel.dev/_astro/get-aws-certified-associate-challenge-ad.C_1ry-DQ_1pukFt.webp 715w&quot;&gt;&lt;/p&gt;
&lt;p&gt;I signed up for the challenge and received an email with the voucher code.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Get AWS Certified: Associate Challenge email with voucher code&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;717&quot; height=&quot;587&quot; src=&quot;https://jaspergabriel.dev/_astro/get-aws-certified-associate-challenge-email.dzi5UZqn_ZKtwug.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/get-aws-certified-associate-challenge-email.dzi5UZqn_Z1QuEl7.webp 680w, https://jaspergabriel.dev/_astro/get-aws-certified-associate-challenge-email.dzi5UZqn_ZKtwug.webp 717w&quot;&gt;&lt;/p&gt;
&lt;p&gt;Then I scheduled my exam in October and reviewed the &lt;a href=&quot;https://aws.amazon.com/certification/certified-solutions-architect-associate/&quot;&gt;landing page&lt;/a&gt; and &lt;a href=&quot;https://training.resources.awscloud.com/get-certified-solutions-architect-associate&quot;&gt;resource hub&lt;/a&gt; to learn more about the AWS Certified Solutions Architect - Associate certification.&lt;/p&gt;
&lt;p&gt;For my preparation, I did the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Reviewed the &lt;a href=&quot;https://training.resources.awscloud.com/get-certified-solutions-architect-associate/aws-certified-solutions-architect-associate-exam-guide-2&quot;&gt;exam guide&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Answered the &lt;a href=&quot;https://d1.awsstatic.com/training-and-certification/docs-sa-assoc/AWS-Certified-Solutions-Architect-Associate_Sample-Questions.pdf&quot;&gt;sample exam questions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Took the following &lt;a href=&quot;https://skillbuilder.aws/&quot;&gt;AWS Skill Builder&lt;/a&gt; free courses:
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://explore.skillbuilder.aws/learn/course/external/view/elearning/13266/aws-certified-solutions-architect-associate-official-practice-question-set-saa-c03-english&quot;&gt;Exam Prep Official Practice Question Set&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://explore.skillbuilder.aws/learn/course/external/view/elearning/14760/exam-prep-aws-certified-solutions-architect-associate-saa-c03&quot;&gt;Exam Prep Standard Course&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://explore.skillbuilder.aws/learn/course/external/view/elearning/1851/aws-technical-essentials&quot;&gt;AWS Technical Essentials&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://explore.skillbuilder.aws/learn/course/external/view/elearning/8319/architecting-on-aws-online-course-supplement&quot;&gt;Architecting on AWS - Online Course Supplement&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://explore.skillbuilder.aws/learn/public/learning_plan/view/1044/solutions-architect-learning-plan&quot;&gt;Solutions Architect Knowledge Badge Assessment&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For the &lt;a href=&quot;https://explore.skillbuilder.aws/learn/course/external/view/elearning/13266/aws-certified-solutions-architect-associate-official-practice-question-set-saa-c03-english&quot;&gt;official practice question set&lt;/a&gt;, I scored &lt;strong&gt;50%&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;AWS Certified Solutions Architect - Associate Official Practice Question Set (SAA-C03) results&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;2414&quot; height=&quot;1320&quot; src=&quot;https://jaspergabriel.dev/_astro/aws-certified-solutions-architect-associate-practice-exam-result.EOv6cBY5_Zuwtsc.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/aws-certified-solutions-architect-associate-practice-exam-result.EOv6cBY5_2m639Y.webp 680w, https://jaspergabriel.dev/_astro/aws-certified-solutions-architect-associate-practice-exam-result.EOv6cBY5_ZeqD1v.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;p&gt;Then for the &lt;a href=&quot;https://explore.skillbuilder.aws/learn/public/learning_plan/view/1044/solutions-architect-learning-plan&quot;&gt;Solutions Architect Knowledge Badge Assessment&lt;/a&gt;, I didn’t pass. My score was &lt;strong&gt;62.3%&lt;/strong&gt; and the passing score was &lt;strong&gt;80% out of 50 questions&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;If you didn’t pass, you can always retake this assessment after 24 hours.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Solutions Architect Knowledge Badge Assessment results&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1784&quot; height=&quot;578&quot; src=&quot;https://jaspergabriel.dev/_astro/solutions-architect-knowledge-badge-result.dMvtv7SS_Z1hQ2DB.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/solutions-architect-knowledge-badge-result.dMvtv7SS_Z13O61H.webp 680w, https://jaspergabriel.dev/_astro/solutions-architect-knowledge-badge-result.dMvtv7SS_Z20336d.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;p&gt;Given the results of the assessments above and my exam schedule getting nearer, I didn’t feel confident enough to proceed with the certification exam.&lt;/p&gt;
&lt;p&gt;Then I decided to reschedule my exam to a later date. When I still felt that I lacked preparation, I finally canceled my certification exam and got a refund.&lt;/p&gt;
&lt;h2 id=&quot;scheduling-my-aws-certified-cloud-practitioner-exam&quot;&gt;Scheduling my AWS Certified Cloud Practitioner exam&lt;/h2&gt;
&lt;p&gt;After the Get AWS Certified: Associate Challenge ended in October, I saw another ad for the &lt;strong&gt;Get AWS Certified: Cloud Practitioner Challenge&lt;/strong&gt; where you can get a &lt;strong&gt;25% discount&lt;/strong&gt; on the exam fee. The fee for the AWS Certified Cloud Practitioner exam costs &lt;strong&gt;100 USD&lt;/strong&gt; at the time of writing, so you only need to pay &lt;strong&gt;75 USD&lt;/strong&gt;, which was the same price I paid for the AWS Certified Solutions Architect - Associate exam.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Get AWS Certified: Cloud Practitioner Challenge ad&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;716&quot; height=&quot;178&quot; src=&quot;https://jaspergabriel.dev/_astro/get-aws-certified-cloud-practitioner-challenge.DxdanBhm_1Fedmb.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/get-aws-certified-cloud-practitioner-challenge.DxdanBhm_Z17gwC0.webp 680w, https://jaspergabriel.dev/_astro/get-aws-certified-cloud-practitioner-challenge.DxdanBhm_1Fedmb.webp 716w&quot;&gt;&lt;/p&gt;
&lt;p&gt;I signed up for the new challenge and received an email with another voucher code.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Get AWS Certified: Cloud Practitioner Challenge email with voucher code&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;713&quot; height=&quot;596&quot; src=&quot;https://jaspergabriel.dev/_astro/get-aws-certified-cloud-practitioner-email.C7LnlUld_Z1FcXPQ.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/get-aws-certified-cloud-practitioner-email.C7LnlUld_Z1ca92w.webp 680w, https://jaspergabriel.dev/_astro/get-aws-certified-cloud-practitioner-email.C7LnlUld_Z1FcXPQ.webp 713w&quot;&gt;&lt;/p&gt;
&lt;h2 id=&quot;preparing-for-my-aws-certified-cloud-practitioner-exam&quot;&gt;Preparing for my AWS Certified Cloud Practitioner exam&lt;/h2&gt;
&lt;p&gt;To be honest, I only had one day of preparation for this exam. I scheduled the exam on a Monday and ended up cramming my review on a Sunday night.&lt;/p&gt;
&lt;p&gt;But as I’ve mentioned earlier, I already have over three years of professional experience with AWS. I have also previously attempted to take the AWS Certified Solutions Architect - Associate certification, where the preparation I did carried over.&lt;/p&gt;
&lt;p&gt;For my short preparation, I reviewed the &lt;a href=&quot;https://aws.amazon.com/certification/certified-cloud-practitioner/&quot;&gt;AWS Certified Cloud Practitioner page&lt;/a&gt; and took the following &lt;a href=&quot;https://skillbuilder.aws/&quot;&gt;AWS Skill Builder&lt;/a&gt; free courses:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://explore.skillbuilder.aws/learn/course/external/view/elearning/14050/aws-certified-cloud-practitioner-official-practice-question-set-clf-c02-english&quot;&gt;Exam Prep Official Question Set: AWS Certified Cloud Practitioner (CLF-C02 - English)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://explore.skillbuilder.aws/learn/course/external/view/elearning/134/aws-cloud-practitioner-essentials&quot;&gt;AWS Cloud Practitioner Essentials&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And here are my results on the assessment tests.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;AWS Certified Cloud Practitioner Official Practice Question Set results&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1214&quot; height=&quot;748&quot; src=&quot;https://jaspergabriel.dev/_astro/aws-certified-cloud-practitioner-practice-exam-result.Dz5n0kdD_r21Dw.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/aws-certified-cloud-practitioner-practice-exam-result.Dz5n0kdD_1dzet8.webp 680w, https://jaspergabriel.dev/_astro/aws-certified-cloud-practitioner-practice-exam-result.Dz5n0kdD_r21Dw.webp 1214w&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;AWS Cloud Practitioner Essentials assessment results&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1711&quot; height=&quot;824&quot; src=&quot;https://jaspergabriel.dev/_astro/aws-cloud-practitioner-essentials-result.C1q8eBOU_Z2tdgrY.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/aws-cloud-practitioner-essentials-result.C1q8eBOU_Z2ecRSa.webp 680w, https://jaspergabriel.dev/_astro/aws-cloud-practitioner-essentials-result.C1q8eBOU_PSNWj.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;p&gt;For the &lt;a href=&quot;https://explore.skillbuilder.aws/learn/course/external/view/elearning/134/aws-cloud-practitioner-essentials&quot;&gt;AWS Cloud Practitioner Essentials course&lt;/a&gt;, I skimmed through the transcripts, finishing the course in three hours.&lt;/p&gt;
&lt;p&gt;Having passed both assessments on the first try, I was more confident going into exam day.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;There’s also the &lt;a href=&quot;https://explore.skillbuilder.aws/learn/course/external/view/elearning/16434/exam-prep-standard-course-aws-certified-cloud-practitioner-clf-c02-english&quot;&gt;Exam Prep Standard Course: AWS Certified Cloud Practitioner&lt;/a&gt;, which I didn’t take due to lack of time.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id=&quot;taking-my-aws-certified-cloud-practitioner-exam&quot;&gt;Taking my AWS Certified Cloud Practitioner exam&lt;/h2&gt;
&lt;p&gt;On the exam day, I received a text message saying that I could take the exam earlier from 11:00 am onwards if I wanted to. My exam is scheduled at noon and I’m already planning to go to the testing center one hour early to give myself time to settle down.&lt;/p&gt;
&lt;p&gt;After arriving at the testing center, I did the registration steps; verifying my identity, signing terms and conditions, and emptying my pockets. Then I took a few deep breaths before asking the proctor to start my exam. The proctor showed me to my computer, then I started the test.&lt;/p&gt;
&lt;p&gt;The exam has &lt;strong&gt;65 questions&lt;/strong&gt; with a &lt;strong&gt;90-minute time limit&lt;/strong&gt;. After completing and submitting my answers, I filled up a post-exam survey. Then, the final screen showed that &lt;strong&gt;I had passed the exam&lt;/strong&gt;!&lt;/p&gt;
&lt;p&gt;I finished the exam in &lt;strong&gt;30 minutes&lt;/strong&gt;, which surprised the proctors, and then I happily shared that I passed the exam.&lt;/p&gt;
&lt;h2 id=&quot;some-tips-i-found-helpful-when-taking-the-exam&quot;&gt;Some tips I found helpful when taking the exam&lt;/h2&gt;
&lt;p&gt;For taking certification exams, or any exam in general, here are tips that I’ve found helpful.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Rest&lt;/strong&gt; well the night before the exam day.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Read&lt;/strong&gt; the whole question and understand what is being asked.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;When you’re not sure about your answer to a question:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Skip&lt;/strong&gt; questions you’re not sure of and flag them for review later.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Spend&lt;/strong&gt; one minute max per question, if you still can’t answer, review it later.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Eliminate&lt;/strong&gt; choices when you know it isn’t the answer.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Sometimes, our brains fill in the gaps which ends up misinterpreting the question. That’s why I recommend being &lt;strong&gt;intentional&lt;/strong&gt; when reading the question.&lt;/p&gt;
&lt;p&gt;Then for questions you’re not sure of, always answer with your &lt;strong&gt;best guess&lt;/strong&gt; and avoid spending &lt;strong&gt;too much time&lt;/strong&gt; on one question. It’s important to &lt;strong&gt;keep moving&lt;/strong&gt; since you have &lt;strong&gt;limited time and resources&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;For eliminating choices, let’s say “a company requires an object storage solution” and you’re given four choices:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Amazon DynamoDB&lt;/li&gt;
&lt;li&gt;AWS Lambda&lt;/li&gt;
&lt;li&gt;Amazon S3&lt;/li&gt;
&lt;li&gt;Amazon RDS&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Continuing with the example, you’re not familiar with object storage solutions in AWS, but know what DynamoDB, Lambda, and RDS are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;DynamoDB is a serverless key-value NoSQL database.&lt;/li&gt;
&lt;li&gt;Lambda is a serverless function.&lt;/li&gt;
&lt;li&gt;RDS is a fully managed relational database.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Knowing that none of the services you know are “object storage”, you can eliminate them when deciding on your best guess. Then you’ll end up answering &lt;strong&gt;Amazon S3&lt;/strong&gt;, which is the correct answer.&lt;/p&gt;
&lt;p&gt;This is a simple example. In actual exams, you might find it harder to eliminate more than one choice for difficult questions. The point is increasing your odds of having a correct answer for questions you’re not sure of. This in turn maximizes your chances for passing the exam.&lt;/p&gt;
&lt;h2 id=&quot;passing-the-aws-certified-cloud-practitioner-exam&quot;&gt;Passing the AWS Certified Cloud Practitioner exam&lt;/h2&gt;
&lt;p&gt;When I got home, I received an email for my &lt;a href=&quot;https://www.credly.com/badges/bfdf4f0d-3e2f-4b00-8827-3954e00afc54/public_url&quot;&gt;digital badge&lt;/a&gt; on Credly.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;AWS Certified Cloud Practitioner Digital Badge&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1151&quot; height=&quot;757&quot; src=&quot;https://jaspergabriel.dev/_astro/aws-certified-cloud-practitioner-badge.Cdd4koUE_Z1J7nOE.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/aws-certified-cloud-practitioner-badge.Cdd4koUE_bMRYA.webp 680w, https://jaspergabriel.dev/_astro/aws-certified-cloud-practitioner-badge.Cdd4koUE_Z1J7nOE.webp 1151w&quot;&gt;&lt;/p&gt;
&lt;p&gt;I also checked my &lt;a href=&quot;https://www.aws.training/certification&quot;&gt;AWS Certification account&lt;/a&gt; and saw the results along with the perks for passing a certification exam, which includes a &lt;strong&gt;50% discount voucher&lt;/strong&gt; for my next certification exam.&lt;/p&gt;
&lt;p&gt;Here are my exam results, where I scored &lt;strong&gt;739/1000&lt;/strong&gt;, which is just a little above the passing score of &lt;strong&gt;700&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;AWS Certified Cloud Practitioner exam result&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;719&quot; height=&quot;336&quot; src=&quot;https://jaspergabriel.dev/_astro/aws-certified-cloud-practitioner-exam-results.Dwi-8_5V_Z2vmt2z.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/aws-certified-cloud-practitioner-exam-results.Dwi-8_5V_Z2tk0EX.webp 680w, https://jaspergabriel.dev/_astro/aws-certified-cloud-practitioner-exam-results.Dwi-8_5V_Z2vmt2z.webp 719w&quot;&gt;&lt;/p&gt;
&lt;p&gt;The exam results showed me that my one-day preparation was good enough to pass the exam, while also realizing that I need to have better preparation for my future certification attempts. Ideally, I’d like to pass my future certification exams with a higher buffer from the passing score, scoring at least 800 and above.&lt;/p&gt;
&lt;p&gt;And finally here’s my digital certificate.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;AWS Certified Cloud Practitioner Digital Certificate&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;833&quot; height=&quot;636&quot; src=&quot;https://jaspergabriel.dev/_astro/aws-certified-cloud-practitioner-certificate.BHT2_-ct_1aKvuW.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/aws-certified-cloud-practitioner-certificate.BHT2_-ct_1vqyT3.webp 680w, https://jaspergabriel.dev/_astro/aws-certified-cloud-practitioner-certificate.BHT2_-ct_1aKvuW.webp 833w&quot;&gt;&lt;/p&gt;
&lt;h2 id=&quot;whats-next-for-me&quot;&gt;What’s next for me?&lt;/h2&gt;
&lt;p&gt;In starting my AWS certification journey, I achieved what I set out to do. By passing the AWS Certified Cloud Practitioner foundational certification, it helped me familiarize myself with the certification process and gave me a boost in confidence, while also showing areas for improvement in my preparation and review processes.&lt;/p&gt;
&lt;p&gt;For 2024, I’m targeting the &lt;strong&gt;Application Architect certification path&lt;/strong&gt; shown &lt;a href=&quot;https://d1.awsstatic.com/training-and-certification/docs/AWS_certification_paths.pdf&quot;&gt;here&lt;/a&gt;, which consists of the following certifications:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/certification/certified-cloud-practitioner/&quot;&gt;AWS Certified Cloud Practitioner&lt;/a&gt; - PASSED&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/certification/certified-solutions-architect-associate/&quot;&gt;AWS Certified Solutions Architect - Associate&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/certification/certified-developer-associate/&quot;&gt;AWS Certified Developer - Associate&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/certification/certified-devops-engineer-professional/&quot;&gt;AWS Certified DevOps Engineer - Professional&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/certification/certified-solutions-architect-professional/&quot;&gt;AWS Certified Solutions Architect - Professional&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Then I’d also want to take the &lt;a href=&quot;https://aws.amazon.com/certification/certified-security-specialty/&quot;&gt;AWS Certified Security - Specialty&lt;/a&gt; certification if I still have time, since security is important for cloud-based solutions.&lt;/p&gt;
&lt;p&gt;I hope my experience can help and give you ideas for your own AWS certification journey.&lt;/p&gt;
&lt;p&gt;Thank you for reading! If you have any questions or feedback, I’d love to hear from you.&lt;/p&gt;
&lt;h2 id=&quot;resources&quot;&gt;Resources&lt;/h2&gt;
&lt;h3 id=&quot;aws-certified-cloud-practitioner&quot;&gt;AWS Certified Cloud Practitioner&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/certification/certified-cloud-practitioner/&quot;&gt;AWS Certified Cloud Practitioner&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://explore.skillbuilder.aws/learn/course/external/view/elearning/14050/aws-certified-cloud-practitioner-official-practice-question-set-clf-c02-english&quot;&gt;Exam Prep Official Question Set&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://explore.skillbuilder.aws/learn/course/external/view/elearning/134/aws-cloud-practitioner-essentials&quot;&gt;AWS Cloud Practitioner Essentials&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://explore.skillbuilder.aws/learn/course/external/view/elearning/16434/exam-prep-standard-course-aws-certified-cloud-practitioner-clf-c02-english&quot;&gt;Exam Prep Standard Course&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;aws-certified-solutions-architect---associate&quot;&gt;AWS Certified Solutions Architect - Associate&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/certification/certified-solutions-architect-associate/&quot;&gt;AWS Certified Solutions Architect - Associate&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://explore.skillbuilder.aws/learn/course/external/view/elearning/13266/aws-certified-solutions-architect-associate-official-practice-question-set-saa-c03-english&quot;&gt;Exam Prep Official Practice Question Set&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://explore.skillbuilder.aws/learn/course/external/view/elearning/14760/exam-prep-aws-certified-solutions-architect-associate-saa-c03&quot;&gt;Exam Prep Standard Course&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://explore.skillbuilder.aws/learn/course/external/view/elearning/1851/aws-technical-essentials&quot;&gt;AWS Technical Essentials&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://explore.skillbuilder.aws/learn/course/external/view/elearning/8319/architecting-on-aws-online-course-supplement&quot;&gt;Architecting on AWS - Online Course Supplement&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://explore.skillbuilder.aws/learn/public/learning_plan/view/1044/solutions-architect-learning-plan&quot;&gt;Solutions Architect Knowledge Badge Assessment&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry>
  <entry>
    <title>A Developer's Journal: Simplifying the Twelve-Factor App</title>
    <link href="https://jaspergabriel.dev/blog/simplifying-the-twelve-factor-app/" rel="alternate" type="text/html"/>
    <id>https://jaspergabriel.dev/blog/simplifying-the-twelve-factor-app/</id>
    <published>2023-12-03T00:00:00.000Z</published>
    <updated>2023-12-03T00:00:00.000Z</updated>
    <summary>A simplified breakdown of the 12-factor app methodology — codebase, config, processes, and deployment best practices.</summary>
    <category term="tech"/>
    <category term="devops"/>
    <content type="html">&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;/h2&gt;
&lt;p&gt;In my journey of constantly learning, while going through week 7 of the &lt;a href=&quot;https://aws.amazon.com/startups/accelerators/build&quot;&gt;AWS Build Accelerator 2023&lt;/a&gt; on software engineering best practices, I encountered the concept of the &lt;a href=&quot;https://12factor.net/&quot;&gt;Twelve-Factor App&lt;/a&gt;. Naturally, I was curious and read the document to learn about the best practices derived from the authors’ experiences in building, deploying, and scaling production applications.&lt;/p&gt;
&lt;p&gt;If you’re a developer looking for a quick read on what the Twelve-Factor app is, then you’ve come to the right place.&lt;/p&gt;
&lt;p&gt;In this article, I try to simplify the concepts that I’ve read from the Twelve-Factor App. I’ve also included high-level illustrations that use practical examples and AWS services.&lt;/p&gt;
&lt;p&gt;Then, let’s define what a Twelve-Factor App is.&lt;/p&gt;
&lt;h2 id=&quot;what-is-the-twelve-factor-app&quot;&gt;What is the Twelve-Factor App?&lt;/h2&gt;
&lt;p&gt;The &lt;a href=&quot;https://12factor.net/&quot;&gt;Twelve-Factor App&lt;/a&gt; is a collection of best practices for building scalable applications. These were documented from the experiences and observations of contributors from &lt;a href=&quot;https://www.heroku.com/&quot;&gt;Heroku&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;According to them, &lt;strong&gt;Twelve-Factor Apps&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;automate setup processes&lt;/strong&gt; to minimize friction when onboarding new developers&lt;/li&gt;
&lt;li&gt;are &lt;strong&gt;portable&lt;/strong&gt; between different execution environments&lt;/li&gt;
&lt;li&gt;can be deployed on &lt;strong&gt;modern cloud providers&lt;/strong&gt; such as AWS, GCP, and Azure.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;minimize differences&lt;/strong&gt; between development and production environments and &lt;strong&gt;use CI/CD&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;can &lt;strong&gt;scale out&lt;/strong&gt; without significant changes to the architecture.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To make our applications compliant with the definition of Twelve-Factor Apps, there are twelve guidelines to consider.&lt;/p&gt;
&lt;h2 id=&quot;1-codebase&quot;&gt;1. Codebase&lt;/h2&gt;
&lt;h3 id=&quot;one-codebase-tracked-in-revision-control-many-deploys&quot;&gt;&lt;em&gt;One codebase tracked in revision control, many deploys&lt;/em&gt;&lt;/h3&gt;
&lt;h4 id=&quot;a-twelve-factor-app-is&quot;&gt;A Twelve-Factor App is:&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;tracked in a &lt;a href=&quot;https://en.wikipedia.org/wiki/Version_control&quot;&gt;version control system (VCS)&lt;/a&gt;.
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://git-scm.com/&quot;&gt;Git&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.mercurial-scm.org/&quot;&gt;Mercurial&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://subversion.apache.org/&quot;&gt;Subversion&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;correlated to &lt;strong&gt;one codebase&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;deployed to different environments using the same codebase.
&lt;ul&gt;
&lt;li&gt;Production&lt;/li&gt;
&lt;li&gt;Staging&lt;/li&gt;
&lt;li&gt;Local development&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=&quot;Twelve-Factor App Codebase&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;525&quot; height=&quot;409&quot; src=&quot;https://jaspergabriel.dev/_astro/codebase-1.BtsihqHt_Z26lJaK.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/codebase-1.BtsihqHt_Z26lJaK.webp 525w&quot;&gt;&lt;/p&gt;
&lt;h4 id=&quot;a-twelve-factor-app-does-not&quot;&gt;A Twelve-Factor App &lt;strong&gt;does not&lt;/strong&gt;:&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;have &lt;strong&gt;multiple codebases&lt;/strong&gt;.
&lt;ul&gt;
&lt;li&gt;Multiple codebases are &lt;strong&gt;distributed systems&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Each &lt;strong&gt;component&lt;/strong&gt; of the distributed system is an &lt;strong&gt;app&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;share the &lt;strong&gt;same code&lt;/strong&gt; with &lt;strong&gt;different apps&lt;/strong&gt;.
&lt;ul&gt;
&lt;li&gt;Use shared libraries for sharing code to multiple apps.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=&quot;Twelve-Factor App Distributed System&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;550&quot; height=&quot;739&quot; src=&quot;https://jaspergabriel.dev/_astro/codebase-2.CIgh_Nns_Z1mxVX3.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/codebase-2.CIgh_Nns_Z1mxVX3.webp 550w&quot;&gt;&lt;/p&gt;
&lt;h2 id=&quot;2-dependencies&quot;&gt;2. Dependencies&lt;/h2&gt;
&lt;h3 id=&quot;explicitly-declare-and-isolate-dependencies&quot;&gt;&lt;em&gt;Explicitly declare and isolate dependencies&lt;/em&gt;&lt;/h3&gt;
&lt;h4 id=&quot;a-twelve-factor-app&quot;&gt;A Twelve-Factor App:&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;explicitly declare dependencies.&lt;/li&gt;
&lt;li&gt;uses package managers.
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.npmjs.com/&quot;&gt;npm&lt;/a&gt; (JavaScript)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://pypi.org/project/pip/&quot;&gt;pip&lt;/a&gt; (Python)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;doesn’t rely on system-wide packages.&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;Not relying on system-wide packages means that you should declare all dependencies needed to run your application.&lt;/p&gt;
&lt;p&gt;An alternative here is using &lt;a href=&quot;https://www.docker.com/&quot;&gt;Docker&lt;/a&gt; to build your application, then you can be sure that your app has access to packages in the operating system.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;By following the guidelines on app dependencies, developers can run the app locally with only the language runtime and dependency manager (JavaScript and npm, Python and pip).&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Twelve-Factor App Dependencies&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;562&quot; height=&quot;445&quot; src=&quot;https://jaspergabriel.dev/_astro/dependencies.Bvn1gdeH_ZDGpdY.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/dependencies.Bvn1gdeH_ZDGpdY.webp 562w&quot;&gt;&lt;/p&gt;
&lt;h2 id=&quot;3-config&quot;&gt;3. Config&lt;/h2&gt;
&lt;h3 id=&quot;store-config-in-the-environment&quot;&gt;&lt;em&gt;Store config in the environment&lt;/em&gt;&lt;/h3&gt;
&lt;h4 id=&quot;a-twelve-factor-app-1&quot;&gt;A Twelve-Factor App:&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;stores configs in the environment (&lt;code&gt;.env&lt;/code&gt; file).&lt;/li&gt;
&lt;li&gt;has &lt;strong&gt;different configs&lt;/strong&gt; for each deployment.&lt;/li&gt;
&lt;li&gt;has &lt;strong&gt;no hard-coded configs&lt;/strong&gt; in the codebase.
&lt;ul&gt;
&lt;li&gt;A codebase doesn’t have hard-coded configs if you can &lt;strong&gt;open-source&lt;/strong&gt; it without leaking credentials.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=&quot;Twelve-Factor App Config&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;724&quot; height=&quot;239&quot; src=&quot;https://jaspergabriel.dev/_astro/config.Dm_RgOeh_lM2W7.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/config.Dm_RgOeh_ZrM0IU.webp 680w, https://jaspergabriel.dev/_astro/config.Dm_RgOeh_lM2W7.webp 724w&quot;&gt;&lt;/p&gt;
&lt;h2 id=&quot;4-backing-services&quot;&gt;4. Backing services&lt;/h2&gt;
&lt;h3 id=&quot;treat-backing-services-as-attached-resources&quot;&gt;&lt;em&gt;Treat backing services as attached resources&lt;/em&gt;&lt;/h3&gt;
&lt;h4 id=&quot;a-twelve-factor-app-can&quot;&gt;A Twelve-Factor App can:&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;use &lt;strong&gt;local&lt;/strong&gt; and &lt;strong&gt;third-party services&lt;/strong&gt;.
&lt;ul&gt;
&lt;li&gt;The app can use a local &lt;a href=&quot;https://www.postgresql.org/&quot;&gt;PostgreSQL&lt;/a&gt; and has no issues using a cloud service like &lt;a href=&quot;https://aws.amazon.com/rds/&quot;&gt;Amazon RDS&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;add, remove, or replace backing services as needed.
&lt;ul&gt;
&lt;li&gt;If there is a database issue, you can spin up a new database restored from a recent backup.&lt;/li&gt;
&lt;li&gt;There should be no code changes needed.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Backing services are used by the app over the network.&lt;/p&gt;
&lt;h4 id=&quot;examples-of-backing-services-are&quot;&gt;Examples of backing services are:&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Data Stores&lt;/strong&gt; (&lt;a href=&quot;https://aws.amazon.com/rds/&quot;&gt;Amazon RDS&lt;/a&gt;, &lt;a href=&quot;https://www.mysql.com/&quot;&gt;MySQL&lt;/a&gt;, &lt;a href=&quot;https://www.postgresql.org/&quot;&gt;PostgreSQL&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Messaging/Queueing Systems&lt;/strong&gt; (&lt;a href=&quot;https://aws.amazon.com/sqs/&quot;&gt;Amazon SQS&lt;/a&gt;, &lt;a href=&quot;https://www.rabbitmq.com/&quot;&gt;RabbitMQ&lt;/a&gt;, &lt;a href=&quot;https://beanstalkd.github.io/&quot;&gt;Beanstalkd&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SMTP&lt;/strong&gt; (&lt;a href=&quot;https://aws.amazon.com/ses/&quot;&gt;Amazon SES&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Caching Systems&lt;/strong&gt; (&lt;a href=&quot;https://aws.amazon.com/elasticache/&quot;&gt;Amazon ElastiCache&lt;/a&gt;, &lt;a href=&quot;https://memcached.org/&quot;&gt;Memcached&lt;/a&gt;, &lt;a href=&quot;https://redis.io/&quot;&gt;Redis&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=&quot;Twelve-Factor App Backing Services&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;401&quot; height=&quot;543&quot; src=&quot;https://jaspergabriel.dev/_astro/backing-services.BOhV2Hx1_Z21semi.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/backing-services.BOhV2Hx1_Z21semi.webp 401w&quot;&gt;&lt;/p&gt;
&lt;h2 id=&quot;5-build-release-run&quot;&gt;5. Build, release, run&lt;/h2&gt;
&lt;h3 id=&quot;strictly-separate-build-and-run-stages&quot;&gt;&lt;em&gt;Strictly separate build and run stages&lt;/em&gt;&lt;/h3&gt;
&lt;p&gt;The &lt;strong&gt;Build stage&lt;/strong&gt; converts code into an executable bundle, fetches dependencies, and compiles binaries and assets.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A build is triggered by developers when &lt;strong&gt;new code is deployed&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;The build stage allows &lt;strong&gt;complex workflows&lt;/strong&gt; such as adding &lt;strong&gt;unit and integration tests&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The &lt;strong&gt;Release stage&lt;/strong&gt; combines the build with deployment configs.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A release should have a &lt;strong&gt;unique release ID&lt;/strong&gt;, with a timestamp, or an incrementing number.&lt;/li&gt;
&lt;li&gt;Deployment tools have &lt;strong&gt;release management tools&lt;/strong&gt;, where you can roll back to a previous release.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The &lt;strong&gt;Runtime stage&lt;/strong&gt; runs the app in the execution environment.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Twelve-Factor App Build, Release, Run&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;749&quot; height=&quot;559&quot; src=&quot;https://jaspergabriel.dev/_astro/build-release-run.C7hgHBJS_1eVvcO.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/build-release-run.C7hgHBJS_ZB8akq.webp 680w, https://jaspergabriel.dev/_astro/build-release-run.C7hgHBJS_1eVvcO.webp 749w&quot;&gt;&lt;/p&gt;
&lt;h2 id=&quot;6-processes&quot;&gt;6. Processes&lt;/h2&gt;
&lt;h3 id=&quot;execute-the-app-as-one-or-more-stateless-processes&quot;&gt;&lt;em&gt;Execute the app as one or more stateless processes&lt;/em&gt;&lt;/h3&gt;
&lt;h4 id=&quot;a-twelve-factor-app-2&quot;&gt;A Twelve-Factor App:&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;is &lt;strong&gt;stateless&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;never assumes that anything cached will be available for a future request.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;stores data&lt;/strong&gt; that needs to be persisted in a &lt;strong&gt;stateful backing service&lt;/strong&gt; like a database.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;stores session state&lt;/strong&gt; in a &lt;strong&gt;session store&lt;/strong&gt; like &lt;a href=&quot;https://memcached.org/&quot;&gt;Memcached&lt;/a&gt; or &lt;a href=&quot;https://redis.io/&quot;&gt;Redis&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;The memory or filesystem can be used as cache for a single transaction.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;img alt=&quot;Twelve-Factor App Processes&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;552&quot; height=&quot;331&quot; src=&quot;https://jaspergabriel.dev/_astro/processes.TQsGL1vf_1bi4LD.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/processes.TQsGL1vf_1bi4LD.webp 552w&quot;&gt;&lt;/p&gt;
&lt;h2 id=&quot;7-port-binding&quot;&gt;7. Port binding&lt;/h2&gt;
&lt;h3 id=&quot;export-services-via-port-binding&quot;&gt;&lt;em&gt;Export services via port binding&lt;/em&gt;&lt;/h3&gt;
&lt;h4 id=&quot;a-twelve-factor-app-3&quot;&gt;A Twelve-Factor App:&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;exposes HTTP endpoints by port binding.&lt;/li&gt;
&lt;li&gt;listens to incoming requests from the port.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;With port binding, an app can be the backing service for another app by providing the backing service URL. For example, a frontend app using a backend app.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Twelve-Factor App Port Binding&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;522&quot; height=&quot;585&quot; src=&quot;https://jaspergabriel.dev/_astro/port-binding.DabMEFNH_Z1Mjra8.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/port-binding.DabMEFNH_Z1Mjra8.webp 522w&quot;&gt;&lt;/p&gt;
&lt;h2 id=&quot;8-concurrency&quot;&gt;8. Concurrency&lt;/h2&gt;
&lt;h3 id=&quot;scale-out-via-the-process-model&quot;&gt;&lt;em&gt;Scale out via the process model&lt;/em&gt;&lt;/h3&gt;
&lt;h4 id=&quot;a-twelve-factor-app-4&quot;&gt;A Twelve-Factor App:&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;scales out (horizontal scaling) when needing more capacity.&lt;/li&gt;
&lt;li&gt;handles diverse workloads.
&lt;ul&gt;
&lt;li&gt;HTTP requests are handled by a web process.&lt;/li&gt;
&lt;li&gt;Long-running tasks are handled by a worker process.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Scaling out (horizontal scaling)&lt;/strong&gt; is the preferred scaling solution since if you follow the guidelines of the Twelve-Factor App, your application can support more requests by &lt;strong&gt;adding more instances&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Scaling up (Vertical scaling)&lt;/strong&gt; is limited in scalability since it only &lt;strong&gt;upgrades the instance configuration&lt;/strong&gt; (memory, CPU, GPU), not to mention you also need to stop that instance to perform the upgrade.&lt;/p&gt;
&lt;p&gt;When building scalable applications, a &lt;strong&gt;mix of scaling up and scaling out&lt;/strong&gt; is ideal.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Twelve-Factor App Concurrency&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;527&quot; height=&quot;852&quot; src=&quot;https://jaspergabriel.dev/_astro/concurrency._51ABFu7_lrTNM.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/concurrency._51ABFu7_lrTNM.webp 527w&quot;&gt;&lt;/p&gt;
&lt;h2 id=&quot;9-disposability&quot;&gt;9. Disposability&lt;/h2&gt;
&lt;h3 id=&quot;maximize-robustness-with-fast-startup-and-graceful-shutdown&quot;&gt;&lt;em&gt;Maximize robustness with fast startup and graceful shutdown&lt;/em&gt;&lt;/h3&gt;
&lt;h4 id=&quot;a-twelve-factor-app-5&quot;&gt;A Twelve-Factor App:&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;can be started or stopped quickly.&lt;/li&gt;
&lt;li&gt;minimizes startup time.&lt;/li&gt;
&lt;li&gt;shuts down gracefully.&lt;/li&gt;
&lt;li&gt;can handle unexpected, non-graceful terminations.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For shutting down gracefully:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;process current requests before shutting down.&lt;/li&gt;
&lt;li&gt;worker process should return unprocessed jobs to the queue.&lt;/li&gt;
&lt;li&gt;jobs should be &lt;a href=&quot;https://en.wikipedia.org/wiki/Reentrancy_(computing)&quot;&gt;reentrant&lt;/a&gt; and workers should be &lt;a href=&quot;https://en.wikipedia.org/wiki/Idempotence&quot;&gt;idempotent&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=&quot;Twelve-Factor App Disposability&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;662&quot; height=&quot;261&quot; src=&quot;https://jaspergabriel.dev/_astro/disposability.CS_ARuvR_Z1JRiXU.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/disposability.CS_ARuvR_Z1JRiXU.webp 662w&quot;&gt;&lt;/p&gt;
&lt;h2 id=&quot;10-devprod-parity&quot;&gt;10. Dev/prod parity&lt;/h2&gt;
&lt;h3 id=&quot;keep-development-staging-and-production-as-similar-as-possible&quot;&gt;&lt;em&gt;Keep development, staging, and production as similar as possible&lt;/em&gt;&lt;/h3&gt;
&lt;h4 id=&quot;a-twelve-factor-app-6&quot;&gt;A Twelve-Factor App:&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;supports &lt;strong&gt;continuous deployment&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;minimizes time gaps, personnel gaps, and tools gaps.&lt;/li&gt;
&lt;li&gt;has &lt;strong&gt;similar backing services&lt;/strong&gt; for development and production.&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;Backing services like database, queue, and cache should have dev/prod parity.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4 id=&quot;types-of-development-process-gaps&quot;&gt;Types of development process gaps:&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Time gap&lt;/strong&gt; - A developer works on a feature or bug fix, which takes time.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Personnel gap&lt;/strong&gt; - A developer writes code, while another developer deploys it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tools gap&lt;/strong&gt; - Different tools are used in development and production.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;to-minimize-development-process-gaps-and-support-continuous-deployment&quot;&gt;To &lt;strong&gt;minimize development process gaps&lt;/strong&gt; and &lt;strong&gt;support continuous deployment&lt;/strong&gt;:&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Developers should be able to &lt;strong&gt;write code&lt;/strong&gt; and &lt;strong&gt;deploy&lt;/strong&gt; it after a &lt;strong&gt;few minutes&lt;/strong&gt; or a &lt;strong&gt;few hours&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Developers are closely involved in &lt;strong&gt;deploying&lt;/strong&gt; and &lt;strong&gt;observing their code&lt;/strong&gt; in &lt;strong&gt;production&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Development and production should be &lt;strong&gt;as similar as possible&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;Tools like &lt;a href=&quot;https://www.docker.com/&quot;&gt;Docker&lt;/a&gt; and &lt;a href=&quot;https://www.vagrantup.com/&quot;&gt;Vagrant&lt;/a&gt; can be used to allow local environments to mimic production environments.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;img alt=&quot;Twelve-Factor App Dev/Prod Parity&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;552&quot; height=&quot;651&quot; src=&quot;https://jaspergabriel.dev/_astro/dev-prod-parity.DsO7IDhy_1aFFXb.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/dev-prod-parity.DsO7IDhy_1aFFXb.webp 552w&quot;&gt;&lt;/p&gt;
&lt;h2 id=&quot;11-logs&quot;&gt;11. Logs&lt;/h2&gt;
&lt;h3 id=&quot;treat-logs-as-event-streams&quot;&gt;&lt;em&gt;Treat logs as event streams&lt;/em&gt;&lt;/h3&gt;
&lt;h4 id=&quot;a-twelve-factor-app-7&quot;&gt;A Twelve-Factor App:&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;doesn’t route or store it’s output logs.&lt;/li&gt;
&lt;li&gt;doesn’t write or manage log files.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;stream&lt;/strong&gt; logs to different services for &lt;strong&gt;analysis&lt;/strong&gt; and &lt;strong&gt;monitoring&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=&quot;Twelve-Factor App Logs&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;444&quot; height=&quot;186&quot; src=&quot;https://jaspergabriel.dev/_astro/logs.DDt6Z7gA_Z1gcX9g.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/logs.DDt6Z7gA_Z1gcX9g.webp 444w&quot;&gt;&lt;/p&gt;
&lt;h2 id=&quot;12-admin-processes&quot;&gt;12. Admin processes&lt;/h2&gt;
&lt;h3 id=&quot;run-adminmanagement-tasks-as-one-off-processes&quot;&gt;&lt;em&gt;Run admin/management tasks as one-off processes&lt;/em&gt;&lt;/h3&gt;
&lt;h4 id=&quot;a-twelve-factor-app-8&quot;&gt;A Twelve-Factor App:&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;runs admin processes in identical environments.&lt;/li&gt;
&lt;li&gt;deploys admin process code along with the application code.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;admin-processes-can-include&quot;&gt;Admin processes can include:&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;running database migrations.&lt;/li&gt;
&lt;li&gt;running console commands via SSH.&lt;/li&gt;
&lt;li&gt;running one-time scripts (like fixing bad records).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=&quot;Twelve-Factor App Admin Processes&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;434&quot; height=&quot;322&quot; src=&quot;https://jaspergabriel.dev/_astro/admin-processes._pReiu4i_HSuN1.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/admin-processes._pReiu4i_HSuN1.webp 434w&quot;&gt;&lt;/p&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;To recap, we’ve learned how we can make our applications more secure and scalable by following the &lt;a href=&quot;https://12factor.net/&quot;&gt;Twelve-Factor App&lt;/a&gt; guidelines.&lt;/p&gt;
&lt;p&gt;The Twelve-Factor App consists of:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Codebase&lt;/strong&gt; – One codebase tracked in revision control, many deploys&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Dependencies&lt;/strong&gt; – Explicitly declare and isolate dependencies&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Configuration&lt;/strong&gt; – Store configuration in the environment&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Backing services&lt;/strong&gt; – Treat backing services as attached resources&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Build, release, run&lt;/strong&gt; – Strictly separate build and run stages&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Processes&lt;/strong&gt; – Execute the app as one or more stateless processes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Port binding&lt;/strong&gt; – Export services via port binding&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Concurrency&lt;/strong&gt; – Scale-out via the process model&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Disposability&lt;/strong&gt; – Maximize robustness with fast start-up and graceful shutdown&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Dev/prod parity&lt;/strong&gt; – Keep development, staging, and production as similar as possible&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Logs&lt;/strong&gt; – Treat logs as event streams&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Admin processes&lt;/strong&gt; – Run admin/management tasks as one-off processes&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I recommend reading through the &lt;a href=&quot;https://12factor.net/&quot;&gt;Twelve-Factor App&lt;/a&gt; since it’s always a good thing to read through the source material. It should take you about an hour or two to finish reading the entire document.&lt;/p&gt;
&lt;p&gt;Thank you for reading! If you have any questions or feedback, I’d love to hear from you.&lt;/p&gt;
&lt;h2 id=&quot;further-reading&quot;&gt;Further reading&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://12factor.net/&quot;&gt;The Twelve-Factor App&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/blogs/compute/applying-the-twelve-factor-app-methodology-to-serverless-applications/&quot;&gt;Applying the Twelve-Factor App Methodology to Serverless Applications&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://repost.aws/articles/ARYSH2AsjKRnaXhRHrn0HDgA/aws-and-the-12-factor-app-methodology-maximizing-efficiency-and-scalability&quot;&gt;AWS and the 12 Factor App Methodology: Maximizing Efficiency and Scalability&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://cloud.google.com/architecture/twelve-factor-app-development-on-gcp&quot;&gt;Twelve-factor app development on Google Cloud&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.ibm.com/articles/creating-a-12-factor-application-with-open-liberty/&quot;&gt;Creating cloud-native applications: 12-factor applications&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry>
  <entry>
    <title>How I Contributed One Line of Code to Ethereum</title>
    <link href="https://jaspergabriel.dev/blog/contributed-one-line-to-ethereum/" rel="alternate" type="text/html"/>
    <id>https://jaspergabriel.dev/blog/contributed-one-line-to-ethereum/</id>
    <published>2023-11-26T00:00:00.000Z</published>
    <updated>2023-11-26T00:00:00.000Z</updated>
    <summary>Story of fixing a broken Discord link in Ethereum.org docs — proof that small open source contributions still matter.</summary>
    <category term="tech"/>
    <category term="blockchain"/>
    <category term="open-source"/>
    <content type="html">&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;/h2&gt;
&lt;p&gt;As a software engineer who has never contributed to &lt;a href=&quot;https://opensource.com/resources/what-open-source&quot;&gt;open-source&lt;/a&gt; before 2023, I’ve been looking for ways to contribute. Being passionate about &lt;a href=&quot;https://ethereum.org/en/web3/&quot;&gt;Web3&lt;/a&gt;, I looked for interesting projects in this space. It was not hard to find one where I could contribute since Web3 is about &lt;strong&gt;openness&lt;/strong&gt; and &lt;strong&gt;decentralization&lt;/strong&gt;. Eventually, I found a project where I made my first &lt;a href=&quot;https://dev.to/jdg2896/my-first-open-source-contribution-how-i-did-it-1jh6&quot;&gt;open-source contribution&lt;/a&gt; which is &lt;a href=&quot;https://taiko.xyz/&quot;&gt;Taiko&lt;/a&gt;, a &lt;a href=&quot;https://taiko.mirror.xyz/w7NSKDeKfJoEy0p89I9feixKfdK-20JgWF9HZzxfeBo&quot;&gt;type 1 ZK-EVM&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;After my first open-source contribution, I looked for other projects where I could contribute. One of those projects was &lt;a href=&quot;https://ethereum.org/en/&quot;&gt;Ethereum&lt;/a&gt;, which is a blockchain network that enables &lt;a href=&quot;https://ethereum.org/en/defi/&quot;&gt;Decentralized Finance&lt;/a&gt;, &lt;a href=&quot;https://ethereum.org/en/nft/&quot;&gt;tokenization of assets&lt;/a&gt;, and an &lt;a href=&quot;https://ethereum.org/en/dapps/?category=technology&quot;&gt;open internet&lt;/a&gt;. While reading through their contributing guidelines, I found an issue in their documentation and ended up fixing it, making my second open-source contribution.&lt;/p&gt;
&lt;p&gt;In this article, I’ll be sharing my journey on how I contributed exactly one line of code to one of Ethereum’s open-source repositories, &lt;a href=&quot;https://github.com/ethereum/ethereum-org-website&quot;&gt;Ethereum.org&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&quot;looking-for-ways-to-contribute-to-ethereum&quot;&gt;Looking for ways to contribute to Ethereum&lt;/h2&gt;
&lt;p&gt;Ethereum has a lot of open-source repositories on their &lt;a href=&quot;https://github.com/ethereum&quot;&gt;GitHub&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Some notable repositories I was looking at were:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/ethereum/go-ethereum&quot;&gt;Geth&lt;/a&gt; - Official Go implementation of the Ethereum protocol.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/ethereum/solidity&quot;&gt;Solidity&lt;/a&gt; - Smart contract programming language.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/ethereum/remix-project&quot;&gt;Remix&lt;/a&gt; - Browser-based compiler and IDE for Ethereum smart contracts written with Solidity.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/ethereum/ethereum-org-website&quot;&gt;Ethereum.org&lt;/a&gt; - Official website and online resource for the Ethereum community.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;When choosing which repository I could contribute to, I had to consider my current skill sets.&lt;/p&gt;
&lt;p&gt;Being proficient in &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/JavaScript&quot;&gt;JavaScript&lt;/a&gt; and &lt;a href=&quot;https://www.typescriptlang.org/&quot;&gt;TypeScript&lt;/a&gt;, Geth and Solidity are out of the question, since Geth requires knowledge of &lt;a href=&quot;https://go.dev/&quot;&gt;Go&lt;/a&gt;, while Solidity requires knowing &lt;a href=&quot;https://isocpp.org/&quot;&gt;C++&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Remix on the other hand is mostly written in &lt;a href=&quot;https://www.typescriptlang.org/&quot;&gt;TypeScript&lt;/a&gt;, while Ethereum.org uses &lt;a href=&quot;https://www.markdownguide.org/&quot;&gt;Markdown&lt;/a&gt;. These are the Ethereum projects that I focused on contributing to.&lt;/p&gt;
&lt;h2 id=&quot;finding-a-bug-on-ethereumorgs-website&quot;&gt;Finding a bug on Ethereum.org’s website&lt;/h2&gt;
&lt;p&gt;After choosing Ethereum.org as a potential repository where I could contribute, I reviewed their website’s &lt;a href=&quot;https://ethereum.org/en/contributing/&quot;&gt;contributing&lt;/a&gt; section.&lt;/p&gt;
&lt;p&gt;While browsing through the different &lt;a href=&quot;https://ethereum.org/en/contributing/&quot;&gt;ways to contribute&lt;/a&gt; to Ethereum.org, I saw their &lt;a href=&quot;https://ethereum.org/en/contributing/translation-program/&quot;&gt;translation program&lt;/a&gt; and checked if I could contribute by translating their documentation. As I was reading through the &lt;a href=&quot;https://ethereum.org/en/contributing/translation-program/resources&quot;&gt;translation program resources page&lt;/a&gt;, I noticed a broken Discord link in the &lt;a href=&quot;https://ethereum.org/en/contributing/translation-program/resources/#office-hours&quot;&gt;Office hours for translators section&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Ethereum translation program resources: Office hours for translators&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1596&quot; height=&quot;962&quot; src=&quot;https://jaspergabriel.dev/_astro/translation-program-resources.BD5QAA4Z_LvKfi.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/translation-program-resources.BD5QAA4Z_KnjsS.webp 680w, https://jaspergabriel.dev/_astro/translation-program-resources.BD5QAA4Z_1wnsaV.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;p&gt;The Discord link should redirect to &lt;a href=&quot;https://discord.com/invite/rZz26QWfCg&quot;&gt;Ethereum.org’s Discord server&lt;/a&gt;. Instead, I got an &lt;code&gt;Invite Invalid&lt;/code&gt; error message.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Ethereum.org Discord &amp;#x22;Invite Invalid&amp;#x22; error&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1746&quot; height=&quot;1096&quot; src=&quot;https://jaspergabriel.dev/_astro/discord-invite-invalid.CP9uOcBe_2o84q5.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/discord-invite-invalid.CP9uOcBe_Za6XNI.webp 680w, https://jaspergabriel.dev/_astro/discord-invite-invalid.CP9uOcBe_ZYEx0R.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;h2 id=&quot;reviewing-ethereumorgs-open-source-contribution-guidelines&quot;&gt;Reviewing Ethereum.org’s open-source contribution guidelines&lt;/h2&gt;
&lt;p&gt;Before proceeding to fix the invalid Discord invite link, I reviewed Ethereum.org’s &lt;a href=&quot;https://github.com/ethereum/ethereum-org-website/blob/dev/CONTRIBUTING.md&quot;&gt;CONTRIBUTING.md&lt;/a&gt; file to make sure I was following their open-source contributing guidelines.&lt;/p&gt;
&lt;p&gt;The guide pointed to the contributing sections in Ethereum.org’s &lt;a href=&quot;https://ethereum.org/en/contributing/&quot;&gt;website&lt;/a&gt; and &lt;a href=&quot;https://github.com/ethereum/ethereum-org-website/tree/dev#-welcome-to-ethereumorg&quot;&gt;README.md&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Ethereum.org CONTRIBUTING.md&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;2324&quot; height=&quot;1230&quot; src=&quot;https://jaspergabriel.dev/_astro/contributing-md.Bo5U-dbY_Z15Ic2I.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/contributing-md.Bo5U-dbY_eGH23.webp 680w, https://jaspergabriel.dev/_astro/contributing-md.Bo5U-dbY_GXmez.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;h2 id=&quot;creating-an-issue-on-ethereumorgs-github-repository&quot;&gt;Creating an issue on Ethereum.org’s GitHub repository&lt;/h2&gt;
&lt;p&gt;After reviewing the contributing guidelines, I looked at existing &lt;a href=&quot;https://github.com/ethereum/ethereum-org-website/issues&quot;&gt;issues&lt;/a&gt; to see if someone else had already reported the &lt;strong&gt;broken Discord invite link&lt;/strong&gt; on the &lt;strong&gt;translation program resources page&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Once I verified that no one else reported the issue, I created an &lt;a href=&quot;https://github.com/ethereum/ethereum-org-website/issues/10530&quot;&gt;issue&lt;/a&gt; on Ethereum.org’s GitHub repository.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Invalid Discord invite GitHub issue&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;2612&quot; height=&quot;1630&quot; src=&quot;https://jaspergabriel.dev/_astro/github-issue.DdxIdiME_ZzAYap.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/github-issue.DdxIdiME_112RVV.webp 680w, https://jaspergabriel.dev/_astro/github-issue.DdxIdiME_Z2aoHno.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;p&gt;Creating an issue was easy since there are templates for different types of issues. In my case, I needed to create a &lt;strong&gt;Bug report issue&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Creating a bug report issue on Ethereum.org&amp;#x27;s GitHub repository&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1954&quot; height=&quot;728&quot; src=&quot;https://jaspergabriel.dev/_astro/create-issue-1.Bs1odrh3_1QcdQf.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/create-issue-1.Bs1odrh3_1PLjFM.webp 680w, https://jaspergabriel.dev/_astro/create-issue-1.Bs1odrh3_ls3xg.webp 1360w&quot;&gt;
&lt;img alt=&quot;Creating a bug report issue using a template&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;2538&quot; height=&quot;1594&quot; src=&quot;https://jaspergabriel.dev/_astro/create-issue-2.BeLJx08P_4w5yO.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/create-issue-2.BeLJx08P_1DaGop.webp 680w, https://jaspergabriel.dev/_astro/create-issue-2.BeLJx08P_pIvuD.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;h2 id=&quot;forking-ethereumorgs-repository-and-testing-the-fix&quot;&gt;Forking Ethereum.org’s repository and testing the fix&lt;/h2&gt;
&lt;p&gt;After creating the issue, I &lt;a href=&quot;https://github.com/jdg2896/ethereum-org-website&quot;&gt;forked Ethereum.org’s GitHub repository&lt;/a&gt; and followed their &lt;a href=&quot;https://github.com/ethereum/ethereum-org-website#3-set-up-your-local-environment-optional&quot;&gt;local environment setup guide&lt;/a&gt;. Once I’ve set up my local environment, I started working on the fix.&lt;/p&gt;
&lt;p&gt;The fix was easy since I only needed to replace the Discord invite link with a working one.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Commit that fixes the invalid Ethereum.org Discord invite link&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;2900&quot; height=&quot;1036&quot; src=&quot;https://jaspergabriel.dev/_astro/code-commit.DpkqOMVP_ZOPD9J.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/code-commit.DpkqOMVP_eOFxw.webp 680w, https://jaspergabriel.dev/_astro/code-commit.DpkqOMVP_ZNbdOm.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;p&gt;I tested the fix locally to verify that the translation page is still working and that my commit fixed the issue.&lt;/p&gt;
&lt;h2 id=&quot;creating-a-pull-request-on-ethereumorgs-github-repository&quot;&gt;Creating a pull request on Ethereum.org’s GitHub repository&lt;/h2&gt;
&lt;p&gt;After verifying that my commit fixed the &lt;a href=&quot;https://github.com/ethereum/ethereum-org-website/issues/10530&quot;&gt;issue&lt;/a&gt;, I created a &lt;a href=&quot;https://github.com/ethereum/ethereum-org-website/pull/10531&quot;&gt;pull request&lt;/a&gt; to Ethereum.org’s repository with the fix for the invalid Discord invite link.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Pull request with the fix for the invalid Ethereum.org Discord invite link&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;2560&quot; height=&quot;1636&quot; src=&quot;https://jaspergabriel.dev/_astro/pull-request.B70xHLIf_ZuiSsc.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/pull-request.B70xHLIf_Znc9fY.webp 680w, https://jaspergabriel.dev/_astro/pull-request.B70xHLIf_ZKtzjV.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;h2 id=&quot;pull-request-reviewed-and-merged&quot;&gt;Pull request reviewed and merged!&lt;/h2&gt;
&lt;p&gt;After creating the pull request, I waited for the code owners and maintainers to review the pull request.&lt;/p&gt;
&lt;p&gt;A few days later, &lt;a href=&quot;https://github.com/corwintines&quot;&gt;corwintines&lt;/a&gt; reviewed my &lt;a href=&quot;https://github.com/ethereum/ethereum-org-website/pull/10531&quot;&gt;pull request&lt;/a&gt;. In his code review, he gave valuable feedback and updated my code changes by replacing the Discord invite link with the official Ethereum.org Discord invite link.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Code owner reviews the pull request&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;2908&quot; height=&quot;1604&quot; src=&quot;https://jaspergabriel.dev/_astro/code-review.CamtAsGd_lIH1.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/code-review.CamtAsGd_Z3n5il.webp 680w, https://jaspergabriel.dev/_astro/code-review.CamtAsGd_1QnnNb.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;p&gt;Then, he approved and merged my pull request. He also thanked me for my contribution, which left a warm feeling even though I only contributed one line of code (less than that if you consider that he updated my code changes).&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Approving and merging the pull request&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1902&quot; height=&quot;1032&quot; src=&quot;https://jaspergabriel.dev/_astro/approve-and-merge-pr.B4Smyav0_UpQWB.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/approve-and-merge-pr.B4Smyav0_ZQdCW5.webp 680w, https://jaspergabriel.dev/_astro/approve-and-merge-pr.B4Smyav0_ZqwXdm.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;p&gt;After the pull request was merged, I also got a &lt;a href=&quot;https://www.gitpoap.io/&quot;&gt;GitPOAP&lt;/a&gt;, as recognition for my contribution to Ethereum.org in 2023.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Ethereum.org GitPOAP&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;912&quot; height=&quot;538&quot; src=&quot;https://jaspergabriel.dev/_astro/gitpoap.spljk1_X_Z2sCEwn.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/gitpoap.spljk1_X_2m5SIr.webp 680w, https://jaspergabriel.dev/_astro/gitpoap.spljk1_X_Z2sCEwn.webp 912w&quot;&gt;&lt;/p&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;In this journey, I’ve learned that it is possible to make small contributions to large projects such as Ethereum. The beauty of open-source is that anyone can make changes, &lt;strong&gt;no matter how small&lt;/strong&gt;. In fact, the majority of open-source contributions fix small issues like the one I encountered. These small changes are also easier for the open-source maintainers to review.&lt;/p&gt;
&lt;p&gt;As the scouts’ saying goes, “Always leave the campground cleaner than you found it”. For us open-source contributors and software engineers, we should also leave the codebase &lt;strong&gt;better than we first saw it&lt;/strong&gt;. That means if you see a mistake on an open-source documentation, you can suggest a fix to the maintainers.&lt;/p&gt;
&lt;p&gt;If you’re looking to make open-source contributions yourself, I hope my story has inspired you to do the same.&lt;/p&gt;
&lt;p&gt;Thank you for reading! If you have any questions or feedback, I’d love to hear from you.&lt;/p&gt;</content>
  </entry>
  <entry>
    <title>How to Implement and Deploy a Smart Contract Event Listener with AWS CDK</title>
    <link href="https://jaspergabriel.dev/blog/smart-contract-event-listener-aws-cdk/" rel="alternate" type="text/html"/>
    <id>https://jaspergabriel.dev/blog/smart-contract-event-listener-aws-cdk/</id>
    <published>2023-11-20T00:00:00.000Z</published>
    <updated>2023-11-20T00:00:00.000Z</updated>
    <summary>Deploy Ethereum smart contract event listeners to AWS using CDK, with WebSocket connections and CloudWatch logging.</summary>
    <category term="tech"/>
    <category term="blockchain"/>
    <category term="aws"/>
    <category term="nodejs"/>
    <content type="html">&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;/h2&gt;
&lt;p&gt;When you think of blockchain technologies, Ethereum, and smart contracts come to mind. Ethereum is one of the leading decentralized blockchains that pioneered smart contracts, which are programmable contracts that automatically execute the contract’s terms.&lt;/p&gt;
&lt;p&gt;A powerful feature of smart contracts is their ability to emit events after successful transactions. For example, a &lt;code&gt;Transfer&lt;/code&gt; event is emitted when a cryptocurrency like USDT is transferred from one person to another. This feature opens up a lot of possibilities for developers, such as implementing real-time updates into their applications.&lt;/p&gt;
&lt;p&gt;This tutorial will guide you through setting up a smart contract event listener for Ethereum’s USDT contract. You’ll also learn to deploy the smart contract event listener to AWS using AWS CDK. After that, I’ll share my personal experiences in using a smart contract event listener.&lt;/p&gt;
&lt;h2 id=&quot;before-starting&quot;&gt;Before starting&lt;/h2&gt;
&lt;p&gt;This guide assumes that you’re familiar with:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/JavaScript&quot;&gt;JavaScript&lt;/a&gt;, &lt;a href=&quot;https://www.typescriptlang.org/&quot;&gt;TypeScript&lt;/a&gt;, and &lt;a href=&quot;https://nodejs.org/en/&quot;&gt;Node.js&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://ethereum.org/en/&quot;&gt;Ethereum&lt;/a&gt; and &lt;a href=&quot;https://ethereum.org/en/developers/docs/smart-contracts/&quot;&gt;Smart Contracts&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Then you should be familiar with &lt;a href=&quot;https://aws.amazon.com/?nc2=h_lg&quot;&gt;AWS&lt;/a&gt; resources and already have an AWS account.&lt;/p&gt;
&lt;p&gt;If not, then you can follow this &lt;a href=&quot;https://docs.aws.amazon.com/accounts/latest/reference/manage-acct-creating.html&quot;&gt;guide&lt;/a&gt; on setting up your AWS account.&lt;/p&gt;
&lt;p&gt;Knowledge of the following is helpful, but not required:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/cli/&quot;&gt;AWS CLI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/cdk/&quot;&gt;AWS CDK&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://web3js.org/&quot;&gt;Web3.js&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://ethereum.org/en/developers/tutorials/using-websockets/&quot;&gt;WebSockets&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.docker.com/&quot;&gt;Docker&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;With that out of the way, let’s start with setting up the smart contract event listener.&lt;/p&gt;
&lt;h2 id=&quot;setting-up-the-smart-contract-event-listener&quot;&gt;Setting up the smart contract event listener&lt;/h2&gt;
&lt;p&gt;Before we start, make sure to check or clone the &lt;a href=&quot;https://github.com/jdg2896/smart-contract-event-listener&quot;&gt;sample repository&lt;/a&gt;, which contains all the necessary code and files for the smart contract event listener. We’ll refer to this repository throughout the guide.&lt;/p&gt;
&lt;p&gt;By the end of this section, you’ll have a working smart contract event listener that is ready for deployment.&lt;/p&gt;
&lt;p&gt;Let’s get started!&lt;/p&gt;
&lt;h2 id=&quot;setting-up-the-environment-variables&quot;&gt;Setting up the environment variables&lt;/h2&gt;
&lt;p&gt;To listen to smart contract events, you’ll first need to configure two environment variables:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;WebSocket endpoint&lt;/li&gt;
&lt;li&gt;Contract address&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;getting-the-websocket-endpoint&quot;&gt;Getting the WebSocket endpoint&lt;/h3&gt;
&lt;p&gt;For this guide, we’ll use a WebSocket endpoint from Alchemy, which looks like &lt;code&gt;wss://eth-mainnet.g.alchemy.com/v2/&amp;#x3C;YOUR_API_KEY&gt;&lt;/code&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;You can get a WebSocket from popular providers such as &lt;a href=&quot;https://www.alchemy.com/&quot;&gt;Alchemy&lt;/a&gt; and &lt;a href=&quot;https://www.infura.io/&quot;&gt;Infura&lt;/a&gt;. Here’s a &lt;a href=&quot;https://ethereum.org/en/developers/tutorials/using-websockets/&quot;&gt;guide&lt;/a&gt; for using WebSockets with Alchemy.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id=&quot;getting-the-smart-contract-address&quot;&gt;Getting the smart contract address&lt;/h3&gt;
&lt;p&gt;For the smart contract address, we’ll use Ethereum’s &lt;a href=&quot;https://etherscan.io/token/0xdac17f958d2ee523a2206206994597c13d831ec7&quot;&gt;USDT&lt;/a&gt; contract, with an address of &lt;code&gt;0xdAC17F958D2ee523a2206206994597C13D831ec7&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Alternatively, if you prefer to use a different smart contract, you can:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Find Ethereum smart contracts on &lt;a href=&quot;https://etherscan.io/&quot;&gt;Etherscan&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Locate ERC20 token addresses on &lt;a href=&quot;https://www.coingecko.com/&quot;&gt;Coingecko&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Or, use your own deployed contract address.&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; Remember to update the &lt;code&gt;src/abi.json&lt;/code&gt; file with the ABI for your chosen smart contract.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Depending on your use case, you can choose to listen to events of popular smart contracts or your deployed smart contracts. You can also choose to listen to smart contracts in different blockchain networks as long as it’s EVM-compatible and you have a WebSocket endpoint for that blockchain network.&lt;/p&gt;
&lt;h3 id=&quot;configuring-the-env-file&quot;&gt;Configuring the .env file&lt;/h3&gt;
&lt;p&gt;Once you have both the &lt;strong&gt;WebSocket endpoint&lt;/strong&gt; and the &lt;strong&gt;smart contract address&lt;/strong&gt;, you can configure your &lt;code&gt;.env&lt;/code&gt; file like this:&lt;/p&gt;
&lt;div class=&quot;code-block&quot;&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light-default github-dark-default&quot; data-language=&quot;makefile&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;ETH_WSS_ENDPOINT=wss://eth-mainnet.g.alchemy.com/v2/&amp;#x3C;YOUR_API_KEY&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;ETH_SMART_CONTRACT_ADDRESS=0xdac17f958d2ee523a2206206994597c13d831ec7&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id=&quot;reviewing-and-testing-the-code&quot;&gt;Reviewing and testing the code&lt;/h2&gt;
&lt;p&gt;Now that you’ve set up the environment variables, let’s review the code to understand how the smart contract event listener works. We’ll also test the code to verify that it works before we deploy it to AWS.&lt;/p&gt;
&lt;h3 id=&quot;reviewing-the-smart-contract-event-listener-code&quot;&gt;Reviewing the smart contract event listener code&lt;/h3&gt;
&lt;p&gt;The code can be divided into several parts:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Imports and Workarounds&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;We import the following libraries:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;dotenv&lt;/code&gt; - to load environment variables from &lt;code&gt;.env&lt;/code&gt; files for local development.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;abi.json&lt;/code&gt; - the ABI of the smart contract you plan to listen to. In this case, an ERC20 ABI.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;web3&lt;/code&gt; - library to allow subscription to smart contract events.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Then a workaround is implemented for &lt;code&gt;BigInt&lt;/code&gt; to allow JSON.stringify() of smart contract event logs, which improves the readability of CloudWatch logs when we deploy to AWS later.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;code-block&quot;&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light-default github-dark-default&quot; data-language=&quot;ts&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;import&lt;/span&gt;&lt;span&gt; 'dotenv/config'&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;import&lt;/span&gt;&lt;span&gt; *&lt;/span&gt;&lt;span&gt; as&lt;/span&gt;&lt;span&gt; erc20abi &lt;/span&gt;&lt;span&gt;from&lt;/span&gt;&lt;span&gt; './abi.json'&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;import&lt;/span&gt;&lt;span&gt; Web3, { Contract, WebSocketProvider } &lt;/span&gt;&lt;span&gt;from&lt;/span&gt;&lt;span&gt; 'web3'&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;/* &lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Workaround for JSON.stringify() event logs with BigInt values. &lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;We need to stringify event logs for more readable logging in CloudWatch.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;https://github.com/GoogleChromeLabs/jsbi/issues/30&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;*/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;BigInt&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;prototype&lt;/span&gt;&lt;span&gt; as&lt;/span&gt;&lt;span&gt; any&lt;/span&gt;&lt;span&gt;).&lt;/span&gt;&lt;span&gt;toJSON&lt;/span&gt;&lt;span&gt; =&lt;/span&gt;&lt;span&gt; function&lt;/span&gt;&lt;span&gt; () {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;return&lt;/span&gt;&lt;span&gt; this&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;toString&lt;/span&gt;&lt;span&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;};&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Main Function - &lt;code&gt;startEventListener()&lt;/code&gt;&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This function creates a WebSocket connection using your WebSocket endpoint.&lt;/li&gt;
&lt;li&gt;Then, the function subscribes to the smart contract address that you’ve specified.&lt;/li&gt;
&lt;li&gt;Finally, the function subscribes to the &lt;code&gt;Transfer&lt;/code&gt; and &lt;code&gt;Approval&lt;/code&gt; events using the &lt;code&gt;subscribeToEvent()&lt;/code&gt; function.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;code-block&quot;&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light-default github-dark-default&quot; data-language=&quot;ts&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;/**&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; * Starts the smart contract event listener. &lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; * Websocket Provider config: https://docs.web3js.org/api/web3-providers-ws/class/WebSocketProvider&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; * &lt;/span&gt;&lt;span&gt;@param&lt;/span&gt;&lt;span&gt; chain&lt;/span&gt;&lt;span&gt; - Name of the blockchain network for logging purposes.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; * &lt;/span&gt;&lt;span&gt;@param&lt;/span&gt;&lt;span&gt; wssEndpoint&lt;/span&gt;&lt;span&gt; - Websocket endpoint for the blockchain network.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; * &lt;/span&gt;&lt;span&gt;@param&lt;/span&gt;&lt;span&gt; contractAddress&lt;/span&gt;&lt;span&gt; - Smart contract address.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; */&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;const&lt;/span&gt;&lt;span&gt; startEventListener&lt;/span&gt;&lt;span&gt; =&lt;/span&gt;&lt;span&gt; async&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span&gt;chain&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt; string&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;wssEndpoint&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt; string&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;contractAddress&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt; string&lt;/span&gt;&lt;span&gt;) &lt;/span&gt;&lt;span&gt;=&gt;&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;const&lt;/span&gt;&lt;span&gt; provider&lt;/span&gt;&lt;span&gt; =&lt;/span&gt;&lt;span&gt; new&lt;/span&gt;&lt;span&gt; WebSocketProvider&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    wssEndpoint,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    {},&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    autoReconnect: &lt;/span&gt;&lt;span&gt;true&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    delay: &lt;/span&gt;&lt;span&gt;10000&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;// Default: 5000 ms&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    maxAttempts: &lt;/span&gt;&lt;span&gt;10&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;// Default: 5&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;provider.&lt;/span&gt;&lt;span&gt;on&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;'connect'&lt;/span&gt;&lt;span&gt;, () &lt;/span&gt;&lt;span&gt;=&gt;&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    console.&lt;/span&gt;&lt;span&gt;log&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;`Connected to ${&lt;/span&gt;&lt;span&gt;chain&lt;/span&gt;&lt;span&gt;} websocket provider`&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;});&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;provider.&lt;/span&gt;&lt;span&gt;on&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;'disconnect'&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;error&lt;/span&gt;&lt;span&gt; =&gt;&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    console.&lt;/span&gt;&lt;span&gt;error&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;`Closed ${&lt;/span&gt;&lt;span&gt;chain&lt;/span&gt;&lt;span&gt;} webSocket connection`&lt;/span&gt;&lt;span&gt;, error);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;});&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;const&lt;/span&gt;&lt;span&gt; web3&lt;/span&gt;&lt;span&gt; =&lt;/span&gt;&lt;span&gt; new&lt;/span&gt;&lt;span&gt; Web3&lt;/span&gt;&lt;span&gt;(provider);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;/*&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    Smart contract event listeners&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    Listening to events:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    - Transfer&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    - Approval&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;*/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;const&lt;/span&gt;&lt;span&gt; contract&lt;/span&gt;&lt;span&gt; =&lt;/span&gt;&lt;span&gt; new&lt;/span&gt;&lt;span&gt; web3.eth.&lt;/span&gt;&lt;span&gt;Contract&lt;/span&gt;&lt;span&gt;(erc20abi, contractAddress);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;await&lt;/span&gt;&lt;span&gt; subscribeToEvent&lt;/span&gt;&lt;span&gt;(chain, contract, &lt;/span&gt;&lt;span&gt;'Transfer'&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;await&lt;/span&gt;&lt;span&gt; subscribeToEvent&lt;/span&gt;&lt;span&gt;(chain, contract, &lt;/span&gt;&lt;span&gt;'Approval'&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;};&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Helper Function:  &lt;code&gt;subscribeToEvent()&lt;/code&gt;&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This makes the event subscription reusable, especially if you plan to listen to multiple smart contract events.&lt;/li&gt;
&lt;li&gt;After creating a smart contract event subscription, we listen to these subscription events:
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;connected&lt;/strong&gt; - it means that you’ve successfully subscribed to a smart contract event.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;data&lt;/strong&gt; - every time an event is generated by smart contract interactions, you’ll receive event logs here.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;changed&lt;/strong&gt; - if for some reason the event has been changed or reverted by the blockchain network, you’ll receive event logs here.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;error&lt;/strong&gt; - if there’s an error while listening to smart contract events, you’ll receive the error details here.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;code-block&quot;&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light-default github-dark-default&quot; data-language=&quot;ts&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;/**&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; * Subscribes to a smart contract event.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; * &lt;/span&gt;&lt;span&gt;@param&lt;/span&gt;&lt;span&gt; chain&lt;/span&gt;&lt;span&gt; - Name of the blockchain network for logging purposes.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; * &lt;/span&gt;&lt;span&gt;@param&lt;/span&gt;&lt;span&gt; contract&lt;/span&gt;&lt;span&gt; - Smart contract address.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; * &lt;/span&gt;&lt;span&gt;@param&lt;/span&gt;&lt;span&gt; eventName&lt;/span&gt;&lt;span&gt; - Name of the event to subscribe to.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; */&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;const&lt;/span&gt;&lt;span&gt; subscribeToEvent&lt;/span&gt;&lt;span&gt; =&lt;/span&gt;&lt;span&gt; async&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span&gt;chain&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt; string&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;contract&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt; Contract&lt;/span&gt;&lt;span&gt;&amp;#x3C;&lt;/span&gt;&lt;span&gt;typeof&lt;/span&gt;&lt;span&gt; erc20abi&gt;, &lt;/span&gt;&lt;span&gt;eventName&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt; string&lt;/span&gt;&lt;span&gt;) &lt;/span&gt;&lt;span&gt;=&gt;&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;const&lt;/span&gt;&lt;span&gt; subscription&lt;/span&gt;&lt;span&gt; =&lt;/span&gt;&lt;span&gt; await&lt;/span&gt;&lt;span&gt; contract.events[eventName]();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;subscription.&lt;/span&gt;&lt;span&gt;on&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;'connected'&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;subscriptionId&lt;/span&gt;&lt;span&gt; =&gt;&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    console.&lt;/span&gt;&lt;span&gt;log&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;`${&lt;/span&gt;&lt;span&gt;chain&lt;/span&gt;&lt;span&gt;} USDT '${&lt;/span&gt;&lt;span&gt;eventName&lt;/span&gt;&lt;span&gt;}' SubID:`&lt;/span&gt;&lt;span&gt;, subscriptionId);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;});&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;subscription.&lt;/span&gt;&lt;span&gt;on&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;'data'&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;event&lt;/span&gt;&lt;span&gt; =&gt;&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    console.&lt;/span&gt;&lt;span&gt;log&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;`${&lt;/span&gt;&lt;span&gt;chain&lt;/span&gt;&lt;span&gt;} USDT '${&lt;/span&gt;&lt;span&gt;eventName&lt;/span&gt;&lt;span&gt;}'`&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;JSON&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;stringify&lt;/span&gt;&lt;span&gt;({ event })); &lt;/span&gt;&lt;span&gt;// cannot json.stringify BigInt...&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;});&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;subscription.&lt;/span&gt;&lt;span&gt;on&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;'changed'&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;event&lt;/span&gt;&lt;span&gt; =&gt;&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    // Remove event from local database&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;});&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;subscription.&lt;/span&gt;&lt;span&gt;on&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;'error'&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;error&lt;/span&gt;&lt;span&gt; =&gt;&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    console.&lt;/span&gt;&lt;span&gt;error&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;`${&lt;/span&gt;&lt;span&gt;chain&lt;/span&gt;&lt;span&gt;} USDT '${&lt;/span&gt;&lt;span&gt;eventName&lt;/span&gt;&lt;span&gt;}' error:`&lt;/span&gt;&lt;span&gt;, error);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;});&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Starting the Listener&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Finally, the &lt;code&gt;startEventListener()&lt;/code&gt; function is called to start listening to smart contract events.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;code-block&quot;&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light-default github-dark-default&quot; data-language=&quot;ts&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;/*&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Start smart contract event listeners&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Chains:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    - Ethereum&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;*/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;startEventListener&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;'Ethereum'&lt;/span&gt;&lt;span&gt;, process.env.&lt;/span&gt;&lt;span&gt;ETH_WSS_ENDPOINT&lt;/span&gt;&lt;span&gt;!&lt;/span&gt;&lt;span&gt;, process.env.&lt;/span&gt;&lt;span&gt;ETH_SMART_CONTRACT_ADDRESS&lt;/span&gt;&lt;span&gt;!&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Here is the full snippet of the smart contract event listener code.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/jdg2896/smart-contract-event-listener/blob/main/src/app.ts&quot;&gt;src/app.ts&lt;/a&gt;&lt;/p&gt;
&lt;div class=&quot;code-block&quot;&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light-default github-dark-default&quot; data-language=&quot;ts&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;import&lt;/span&gt;&lt;span&gt; 'dotenv/config'&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;import&lt;/span&gt;&lt;span&gt; *&lt;/span&gt;&lt;span&gt; as&lt;/span&gt;&lt;span&gt; erc20abi &lt;/span&gt;&lt;span&gt;from&lt;/span&gt;&lt;span&gt; './abi.json'&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;import&lt;/span&gt;&lt;span&gt; Web3, { Contract, WebSocketProvider } &lt;/span&gt;&lt;span&gt;from&lt;/span&gt;&lt;span&gt; 'web3'&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;/* &lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  Workaround for JSON.stringify() event logs with BigInt values. &lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  We need to stringify event logs for more readable logging in CloudWatch.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  https://github.com/GoogleChromeLabs/jsbi/issues/30&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;*/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;BigInt&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;prototype&lt;/span&gt;&lt;span&gt; as&lt;/span&gt;&lt;span&gt; any&lt;/span&gt;&lt;span&gt;).&lt;/span&gt;&lt;span&gt;toJSON&lt;/span&gt;&lt;span&gt; =&lt;/span&gt;&lt;span&gt; function&lt;/span&gt;&lt;span&gt; () {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  return&lt;/span&gt;&lt;span&gt; this&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;toString&lt;/span&gt;&lt;span&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;};&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;/**&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; * Starts the smart contract event listener.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; * Websocket Provider config: https://docs.web3js.org/api/web3-providers-ws/class/WebSocketProvider&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; * &lt;/span&gt;&lt;span&gt;@param&lt;/span&gt;&lt;span&gt; chain&lt;/span&gt;&lt;span&gt; - Name of the blockchain network for logging purposes.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; * &lt;/span&gt;&lt;span&gt;@param&lt;/span&gt;&lt;span&gt; wssEndpoint&lt;/span&gt;&lt;span&gt; - Websocket endpoint for the blockchain network.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; * &lt;/span&gt;&lt;span&gt;@param&lt;/span&gt;&lt;span&gt; contractAddress&lt;/span&gt;&lt;span&gt; - Smart contract address.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; */&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;const&lt;/span&gt;&lt;span&gt; startEventListener&lt;/span&gt;&lt;span&gt; =&lt;/span&gt;&lt;span&gt; async&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span&gt;chain&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt; string&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;wssEndpoint&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt; string&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;contractAddress&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt; string&lt;/span&gt;&lt;span&gt;) &lt;/span&gt;&lt;span&gt;=&gt;&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  const&lt;/span&gt;&lt;span&gt; provider&lt;/span&gt;&lt;span&gt; =&lt;/span&gt;&lt;span&gt; new&lt;/span&gt;&lt;span&gt; WebSocketProvider&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    wssEndpoint,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    {},&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      autoReconnect: &lt;/span&gt;&lt;span&gt;true&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      delay: &lt;/span&gt;&lt;span&gt;10000&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;// Default: 5000 ms&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      maxAttempts: &lt;/span&gt;&lt;span&gt;10&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;// Default: 5&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  );&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  provider.&lt;/span&gt;&lt;span&gt;on&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;'connect'&lt;/span&gt;&lt;span&gt;, () &lt;/span&gt;&lt;span&gt;=&gt;&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    console.&lt;/span&gt;&lt;span&gt;log&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;`Connected to ${&lt;/span&gt;&lt;span&gt;chain&lt;/span&gt;&lt;span&gt;} websocket provider`&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  provider.&lt;/span&gt;&lt;span&gt;on&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;'disconnect'&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;error&lt;/span&gt;&lt;span&gt; =&gt;&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    console.&lt;/span&gt;&lt;span&gt;error&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;`Closed ${&lt;/span&gt;&lt;span&gt;chain&lt;/span&gt;&lt;span&gt;} webSocket connection`&lt;/span&gt;&lt;span&gt;, error);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  const&lt;/span&gt;&lt;span&gt; web3&lt;/span&gt;&lt;span&gt; =&lt;/span&gt;&lt;span&gt; new&lt;/span&gt;&lt;span&gt; Web3&lt;/span&gt;&lt;span&gt;(provider);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  /*&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    Smart contract event listeners&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    Listening to events:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      - Transfer&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      - Approval&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  */&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  const&lt;/span&gt;&lt;span&gt; contract&lt;/span&gt;&lt;span&gt; =&lt;/span&gt;&lt;span&gt; new&lt;/span&gt;&lt;span&gt; web3.eth.&lt;/span&gt;&lt;span&gt;Contract&lt;/span&gt;&lt;span&gt;(erc20abi, contractAddress);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  await&lt;/span&gt;&lt;span&gt; subscribeToEvent&lt;/span&gt;&lt;span&gt;(chain, contract, &lt;/span&gt;&lt;span&gt;'Transfer'&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  await&lt;/span&gt;&lt;span&gt; subscribeToEvent&lt;/span&gt;&lt;span&gt;(chain, contract, &lt;/span&gt;&lt;span&gt;'Approval'&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;};&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;/**&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; * Subscribes to a smart contract event.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; * &lt;/span&gt;&lt;span&gt;@param&lt;/span&gt;&lt;span&gt; chain&lt;/span&gt;&lt;span&gt; - Name of the blockchain network for logging purposes.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; * &lt;/span&gt;&lt;span&gt;@param&lt;/span&gt;&lt;span&gt; contract&lt;/span&gt;&lt;span&gt; - Smart contract address.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; * &lt;/span&gt;&lt;span&gt;@param&lt;/span&gt;&lt;span&gt; eventName&lt;/span&gt;&lt;span&gt; - Name of the event to subscribe to.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; */&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;const&lt;/span&gt;&lt;span&gt; subscribeToEvent&lt;/span&gt;&lt;span&gt; =&lt;/span&gt;&lt;span&gt; async&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span&gt;chain&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt; string&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;contract&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt; Contract&lt;/span&gt;&lt;span&gt;&amp;#x3C;&lt;/span&gt;&lt;span&gt;typeof&lt;/span&gt;&lt;span&gt; erc20abi&gt;, &lt;/span&gt;&lt;span&gt;eventName&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt; string&lt;/span&gt;&lt;span&gt;) &lt;/span&gt;&lt;span&gt;=&gt;&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  const&lt;/span&gt;&lt;span&gt; subscription&lt;/span&gt;&lt;span&gt; =&lt;/span&gt;&lt;span&gt; await&lt;/span&gt;&lt;span&gt; contract.events[eventName]();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  subscription.&lt;/span&gt;&lt;span&gt;on&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;'connected'&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;subscriptionId&lt;/span&gt;&lt;span&gt; =&gt;&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    console.&lt;/span&gt;&lt;span&gt;log&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;`${&lt;/span&gt;&lt;span&gt;chain&lt;/span&gt;&lt;span&gt;} USDT '${&lt;/span&gt;&lt;span&gt;eventName&lt;/span&gt;&lt;span&gt;}' SubID:`&lt;/span&gt;&lt;span&gt;, subscriptionId);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  subscription.&lt;/span&gt;&lt;span&gt;on&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;'data'&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;event&lt;/span&gt;&lt;span&gt; =&gt;&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    console.&lt;/span&gt;&lt;span&gt;log&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;`${&lt;/span&gt;&lt;span&gt;chain&lt;/span&gt;&lt;span&gt;} USDT '${&lt;/span&gt;&lt;span&gt;eventName&lt;/span&gt;&lt;span&gt;}'`&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;JSON&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;stringify&lt;/span&gt;&lt;span&gt;({ event })); &lt;/span&gt;&lt;span&gt;// cannot json.stringify BigInt...&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  subscription.&lt;/span&gt;&lt;span&gt;on&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;'changed'&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;event&lt;/span&gt;&lt;span&gt; =&gt;&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    // Remove event from local database&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  subscription.&lt;/span&gt;&lt;span&gt;on&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;'error'&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;error&lt;/span&gt;&lt;span&gt; =&gt;&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    console.&lt;/span&gt;&lt;span&gt;error&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;`${&lt;/span&gt;&lt;span&gt;chain&lt;/span&gt;&lt;span&gt;} USDT '${&lt;/span&gt;&lt;span&gt;eventName&lt;/span&gt;&lt;span&gt;}' error:`&lt;/span&gt;&lt;span&gt;, error);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;};&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;/*&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  Start smart contract event listeners&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  Chains:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    - Ethereum&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;*/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;startEventListener&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;'Ethereum'&lt;/span&gt;&lt;span&gt;, process.env.&lt;/span&gt;&lt;span&gt;ETH_WSS_ENDPOINT&lt;/span&gt;&lt;span&gt;!&lt;/span&gt;&lt;span&gt;, process.env.&lt;/span&gt;&lt;span&gt;ETH_SMART_CONTRACT_ADDRESS&lt;/span&gt;&lt;span&gt;!&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h3 id=&quot;testing-the-smart-contract-event-listener-code&quot;&gt;Testing the smart contract event listener code&lt;/h3&gt;
&lt;p&gt;Now that we’ve reviewed the code, let’s test the code to make sure everything is working as expected.&lt;/p&gt;
&lt;p&gt;There are multiple ways to test the code locally:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;TypeScript&lt;/strong&gt;: Run the TypeScript file using &lt;code&gt;ts-node&lt;/code&gt;:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;npm run start:dev&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;JavaScript&lt;/strong&gt;: Build and run the JavaScript file using &lt;code&gt;node&lt;/code&gt;:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;npm run build&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;npm run start&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Docker:&lt;/strong&gt;: Build the Docker image and run the container:
&lt;ol&gt;
&lt;li&gt;Build the TypeScript file: &lt;code&gt;npm run build&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Build the Docker image: &lt;code&gt;docker build -t smart-contract-event-listener:latest .&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Run the Docker container in detached mode: &lt;code&gt;docker run -d --env-file .env --name smart-contract-event-listener smart-contract-event-listener:latest&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Get the Docker container logs: &lt;code&gt;docker logs smart-contract-event-listener&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Stop the Docker container: &lt;code&gt;docker stop smart-contract-event-listener&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;I recommend building the Docker image and running the container locally to make sure the code works as expected before deploying to AWS.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;After testing, you should see some Ethereum USDT &lt;code&gt;Transfer&lt;/code&gt; and &lt;code&gt;Approval&lt;/code&gt; events in your logs.&lt;/p&gt;
&lt;div class=&quot;code-block&quot;&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light-default github-dark-default&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Ethereum&lt;/span&gt;&lt;span&gt; USDT&lt;/span&gt;&lt;span&gt; 'Transfer'&lt;/span&gt;&lt;span&gt; {&quot;event&quot;:{&quot;address&quot;:&quot;0xdac17f958d2ee523a2206206994597c13d831ec7&quot;,&quot;topics&quot;:[&quot;0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef&quot;,&quot;0x0000000000000000000000001fbcb0803529aea20d6b4af5845fd041e54c50d0&quot;,&quot;0x0000000000000000000000009a4b7d5916d750b9a864f316b9a2483576412bb1&quot;],&quot;data&quot;:&quot;0x000000000000000000000000000000000000000000000000000000000ee6b280&quot;,&quot;blockNumber&quot;:&quot;18597353&quot;,&quot;transactionHash&quot;:&quot;0x61adfbd4a045c02d1b5fea0cce8747dab9b969d552db6091c19168176da6d04c&quot;,&quot;transactionIndex&quot;:&quot;116&quot;,&quot;blockHash&quot;:&quot;0xdc592d23957f1a9fe63e2bd7e03c394b759b7bf48139845877bf0098e82aa8c4&quot;,&quot;logIndex&quot;:&quot;445&quot;,&quot;removed&quot;:&lt;/span&gt;&lt;span&gt;false&lt;/span&gt;&lt;span&gt;,&quot;returnValues&quot;:{&quot;0&quot;:&quot;0x1fBCb0803529AeA20d6B4AF5845FD041E54c50d0&quot;,&quot;1&quot;:&quot;0x9A4b7D5916D750B9A864F316b9a2483576412BB1&quot;,&quot;2&quot;:&quot;250000000&quot;,&quot;__length__&quot;:3,&quot;from&quot;:&quot;0x1fBCb0803529AeA20d6B4AF5845FD041E54c50d0&quot;,&quot;to&quot;:&quot;0x9A4b7D5916D750B9A864F316b9a2483576412BB1&quot;,&quot;value&quot;:&quot;250000000&quot;},&quot;event&quot;:&quot;Transfer&quot;,&quot;signature&quot;:&quot;0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef&quot;,&quot;raw&quot;:{&quot;data&quot;:&quot;0x000000000000000000000000000000000000000000000000000000000ee6b280&quot;,&quot;topics&quot;:[&quot;0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef&quot;,&quot;0x0000000000000000000000001fbcb0803529aea20d6b4af5845fd041e54c50d0&quot;,&quot;0x0000000000000000000000009a4b7d5916d750b9a864f316b9a2483576412bb1&quot;]}}}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Ethereum&lt;/span&gt;&lt;span&gt; USDT&lt;/span&gt;&lt;span&gt; 'Approval'&lt;/span&gt;&lt;span&gt; {&quot;event&quot;:{&quot;address&quot;:&quot;0xdac17f958d2ee523a2206206994597c13d831ec7&quot;,&quot;topics&quot;:[&quot;0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925&quot;,&quot;0x00000000000000000000000062844dc43c064253e21b2b8ac830b28f307184f0&quot;,&quot;0x000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3&quot;],&quot;data&quot;:&quot;0x000000000000000000000000000000000000000000000000000000012a05f200&quot;,&quot;blockNumber&quot;:&quot;18597353&quot;,&quot;transactionHash&quot;:&quot;0x29de66457b8cd4895e354aee842404e66ed34e176fdd3582bb3b9352d9ac7c8f&quot;,&quot;transactionIndex&quot;:&quot;129&quot;,&quot;blockHash&quot;:&quot;0xdc592d23957f1a9fe63e2bd7e03c394b759b7bf48139845877bf0098e82aa8c4&quot;,&quot;logIndex&quot;:&quot;465&quot;,&quot;removed&quot;:&lt;/span&gt;&lt;span&gt;false&lt;/span&gt;&lt;span&gt;,&quot;returnValues&quot;:{&quot;0&quot;:&quot;0x62844Dc43C064253E21B2b8aC830B28f307184F0&quot;,&quot;1&quot;:&quot;0x000000000022D473030F116dDEE9F6B43aC78BA3&quot;,&quot;2&quot;:&quot;5000000000&quot;,&quot;__length__&quot;:3,&quot;owner&quot;:&quot;0x62844Dc43C064253E21B2b8aC830B28f307184F0&quot;,&quot;spender&quot;:&quot;0x000000000022D473030F116dDEE9F6B43aC78BA3&quot;,&quot;value&quot;:&quot;5000000000&quot;},&quot;event&quot;:&quot;Approval&quot;,&quot;signature&quot;:&quot;0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925&quot;,&quot;raw&quot;:{&quot;data&quot;:&quot;0x000000000000000000000000000000000000000000000000000000012a05f200&quot;,&quot;topics&quot;:[&quot;0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925&quot;,&quot;0x00000000000000000000000062844dc43c064253e21b2b8ac830b28f307184f0&quot;,&quot;0x000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3&quot;]}}}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id=&quot;deploying-the-smart-contract-event-listener&quot;&gt;Deploying the smart contract event listener&lt;/h2&gt;
&lt;p&gt;Now that you have a working smart contract event listener, we’ll deploy the resources to AWS using &lt;a href=&quot;https://aws.amazon.com/cdk/&quot;&gt;AWS CDK&lt;/a&gt;, which is an Infrastructure as Code (IaC) tool. AWS CDK allows you to configure, deploy, and manage AWS cloud resources using popular programming languages such as TypeScript.&lt;/p&gt;
&lt;p&gt;The &lt;a href=&quot;https://github.com/jdg2896/smart-contract-event-listener&quot;&gt;sample repository&lt;/a&gt; I shared with you earlier is generated with AWS CDK. The smart contract listener code and cloud resources are added after.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;For more info on generating your own AWS CDK TypeScript boilerplate, check this &lt;a href=&quot;https://docs.aws.amazon.com/cdk/v2/guide/work-with-cdk-typescript.html#typescript-newproject&quot;&gt;AWS documentation&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id=&quot;installing-the-aws-cli&quot;&gt;Installing the AWS CLI&lt;/h3&gt;
&lt;p&gt;If you don’t have AWS CLI installed, you can go to the &lt;a href=&quot;https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html&quot;&gt;Get Started&lt;/a&gt; section and &lt;a href=&quot;https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html&quot;&gt;Install/Update&lt;/a&gt; section of the AWS CLI documentation.&lt;/p&gt;
&lt;h3 id=&quot;configuring-a-named-profile-in-aws-cli&quot;&gt;Configuring a named profile in AWS CLI&lt;/h3&gt;
&lt;p&gt;Now you’ll configure your AWS CLI credentials so that you have the permissions needed to deploy AWS resources in the region that you specify.&lt;/p&gt;
&lt;p&gt;You can either configure a &lt;strong&gt;default profile&lt;/strong&gt; or use a &lt;strong&gt;named profile&lt;/strong&gt; for your AWS CLI credentials.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I recommend configuring a named profile especially if you’re working with multiple AWS accounts.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Make sure you already have your own AWS IAM account or access keys. If not, then you can refer to this &lt;a href=&quot;https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html&quot;&gt;guide&lt;/a&gt;.&lt;/p&gt;
&lt;h4 id=&quot;to-configure-an-aws-cli-named-profile&quot;&gt;To configure an AWS CLI named profile:&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;Run the &lt;code&gt;aws configure --name profile-name&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Add your AWS IAM account &lt;code&gt;Access Key&lt;/code&gt; and &lt;code&gt;Secret Access Key&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Specify the &lt;a href=&quot;https://aws.amazon.com/about-aws/global-infrastructure/regions_az/?p=ngi&amp;#x26;loc=2&amp;#x26;refid=c4f45c53-585c-4b31-8fbf-d39fbcdc603a&amp;#x26;trkcampaign=innovate-mad-apj&quot;&gt;region&lt;/a&gt; where you’ll deploy your AWS resources.&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&quot;then-to-use-the-credentials-in-the-named-profile&quot;&gt;Then to use the credentials in the named profile:&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;For Linux or macOS: &lt;code&gt;export AWS_PROFILE=profile-name&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;For Windows: &lt;code&gt;setx AWS_PROFILE profile-name&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For more information, refer to the &lt;a href=&quot;https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html#cli-configure-files-using-profiles&quot;&gt;AWS CLI documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&quot;installing-the-aws-cdk-cli&quot;&gt;Installing the AWS CDK CLI&lt;/h3&gt;
&lt;p&gt;Now that you’ve installed and configured AWS CLI, it’s time to install AWS CDK CLI.&lt;/p&gt;
&lt;p&gt;To install AWS CDK:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Run the install command: &lt;code&gt;npm install -g aws-cdk&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Then check that AWS CDK is installed correctly: &lt;code&gt;cdk --version&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For more information, refer to the &lt;a href=&quot;https://docs.aws.amazon.com/cdk/v2/guide/getting_started.html#getting_started_install&quot;&gt;AWS CDK documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&quot;reviewing-the-aws-cdk-code&quot;&gt;Reviewing the AWS CDK code&lt;/h3&gt;
&lt;p&gt;Before we deploy the smart contract event listener, let’s review the AWS CDK code and the AWS resources that we’ll deploy.&lt;/p&gt;
&lt;p&gt;The first file &lt;code&gt;bin/smart-contract-event-listener.ts&lt;/code&gt; imports the &lt;code&gt;SmartContractEventListenerStack&lt;/code&gt;, then instantiates a CDK app where we can specify the &lt;code&gt;stack name&lt;/code&gt; and optional properties.&lt;/p&gt;
&lt;p&gt;If you noticed in the comments, you can also configure your AWS account and region in the properties. But since you’ve already configured your AWS CLI credentials earlier, you don’t need to uncomment these.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/jdg2896/smart-contract-event-listener/blob/main/bin/smart-contract-event-listener.ts&quot;&gt;bin/smart-contract-event-listener.ts&lt;/a&gt;&lt;/p&gt;
&lt;div class=&quot;code-block&quot;&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light-default github-dark-default&quot; data-language=&quot;ts&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;#!/usr/bin/env node&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;import&lt;/span&gt;&lt;span&gt; 'source-map-support/register'&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;import&lt;/span&gt;&lt;span&gt; *&lt;/span&gt;&lt;span&gt; as&lt;/span&gt;&lt;span&gt; cdk &lt;/span&gt;&lt;span&gt;from&lt;/span&gt;&lt;span&gt; 'aws-cdk-lib'&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;import&lt;/span&gt;&lt;span&gt; { SmartContractEventListenerStack } &lt;/span&gt;&lt;span&gt;from&lt;/span&gt;&lt;span&gt; '../lib/smart-contract-event-listener-stack'&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;const&lt;/span&gt;&lt;span&gt; app&lt;/span&gt;&lt;span&gt; =&lt;/span&gt;&lt;span&gt; new&lt;/span&gt;&lt;span&gt; cdk.&lt;/span&gt;&lt;span&gt;App&lt;/span&gt;&lt;span&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;new&lt;/span&gt;&lt;span&gt; SmartContractEventListenerStack&lt;/span&gt;&lt;span&gt;(app, &lt;/span&gt;&lt;span&gt;'SmartContractEventListenerStack'&lt;/span&gt;&lt;span&gt;, {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  /* If you don't specify 'env', this stack will be environment-agnostic.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;   * Account/Region-dependent features and context lookups will not work,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;   * but a single synthesized template can be deployed anywhere. */&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  /* Uncomment the next line to specialize this stack for the AWS Account&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;   * and Region that are implied by the current CLI configuration. */&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  // env: { account: process.env.CDK_DEFAULT_ACCOUNT, region: process.env.CDK_DEFAULT_REGION },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  /* Uncomment the next line if you know exactly what Account and Region you&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;   * want to deploy the stack to. */&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  // env: { account: '123456789012', region: 'us-east-1' },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  /* For more information, see https://docs.aws.amazon.com/cdk/latest/guide/environments.html */&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;});&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Then the &lt;code&gt;lib/smart-contract-event-listener-stack.ts&lt;/code&gt; file defined the AWS cloud resources that we’ll deploy.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;SmartContractEventListenerStack&lt;/code&gt; will deploy the following resources:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.aws.amazon.com/vpc/latest/userguide/what-is-amazon-vpc.html&quot;&gt;VPC&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/ecs/&quot;&gt;ECS Cluster&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/fargate/&quot;&gt;Fargate Service&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.aws.amazon.com/AmazonECS/latest/userguide/task_definitions.html&quot;&gt;Fargate Task Definition&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=&quot;SmartContractEventListenerStack Diagram&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;281&quot; height=&quot;281&quot; src=&quot;https://jaspergabriel.dev/_astro/ecs.DhVh27kb_Z1EJra7.svg&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/jdg2896/smart-contract-event-listener/blob/main/lib/smart-contract-event-listener-stack.ts&quot;&gt;lib/smart-contract-event-listener-stack.ts&lt;/a&gt;&lt;/p&gt;
&lt;div class=&quot;code-block&quot;&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light-default github-dark-default&quot; data-language=&quot;ts&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;import&lt;/span&gt;&lt;span&gt; 'dotenv/config'&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;import&lt;/span&gt;&lt;span&gt; *&lt;/span&gt;&lt;span&gt; as&lt;/span&gt;&lt;span&gt; cdk &lt;/span&gt;&lt;span&gt;from&lt;/span&gt;&lt;span&gt; 'aws-cdk-lib'&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;import&lt;/span&gt;&lt;span&gt; { Construct } &lt;/span&gt;&lt;span&gt;from&lt;/span&gt;&lt;span&gt; 'constructs'&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;import&lt;/span&gt;&lt;span&gt; *&lt;/span&gt;&lt;span&gt; as&lt;/span&gt;&lt;span&gt; ec2 &lt;/span&gt;&lt;span&gt;from&lt;/span&gt;&lt;span&gt; 'aws-cdk-lib/aws-ec2'&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;import&lt;/span&gt;&lt;span&gt; *&lt;/span&gt;&lt;span&gt; as&lt;/span&gt;&lt;span&gt; ecs &lt;/span&gt;&lt;span&gt;from&lt;/span&gt;&lt;span&gt; 'aws-cdk-lib/aws-ecs'&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;export&lt;/span&gt;&lt;span&gt; class&lt;/span&gt;&lt;span&gt; SmartContractEventListenerStack&lt;/span&gt;&lt;span&gt; extends&lt;/span&gt;&lt;span&gt; cdk&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;Stack&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  constructor&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;scope&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt; Construct&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;id&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt; string&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;props&lt;/span&gt;&lt;span&gt;?:&lt;/span&gt;&lt;span&gt; cdk&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;StackProps&lt;/span&gt;&lt;span&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    super&lt;/span&gt;&lt;span&gt;(scope, id, props);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    const&lt;/span&gt;&lt;span&gt; vpc&lt;/span&gt;&lt;span&gt; =&lt;/span&gt;&lt;span&gt; new&lt;/span&gt;&lt;span&gt; ec2.&lt;/span&gt;&lt;span&gt;Vpc&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;this&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;'SmartContractEventListenerVPC'&lt;/span&gt;&lt;span&gt;, {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      vpcName: &lt;/span&gt;&lt;span&gt;'SmartContractEventListenerVPC'&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      // EIP soft limit is 5, need to increase limit to increase AZ&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      maxAzs: &lt;/span&gt;&lt;span&gt;1&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    const&lt;/span&gt;&lt;span&gt; cluster&lt;/span&gt;&lt;span&gt; =&lt;/span&gt;&lt;span&gt; new&lt;/span&gt;&lt;span&gt; ecs.&lt;/span&gt;&lt;span&gt;Cluster&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;this&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;'SmartContractEventListenerCluster'&lt;/span&gt;&lt;span&gt;, {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      clusterName: &lt;/span&gt;&lt;span&gt;'SmartContractEventListenerCluster'&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      vpc: vpc,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    const&lt;/span&gt;&lt;span&gt; taskDefinition&lt;/span&gt;&lt;span&gt; =&lt;/span&gt;&lt;span&gt; new&lt;/span&gt;&lt;span&gt; ecs.&lt;/span&gt;&lt;span&gt;FargateTaskDefinition&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;this&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;'SmartContractEventListenerTaskDef'&lt;/span&gt;&lt;span&gt;, {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      family: &lt;/span&gt;&lt;span&gt;'TaskDef'&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    taskDefinition.&lt;/span&gt;&lt;span&gt;addContainer&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;'SmartContractEventListener'&lt;/span&gt;&lt;span&gt;, {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      containerName: &lt;/span&gt;&lt;span&gt;'Container'&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      environment: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;        ETH_WSS_ENDPOINT: process.env.&lt;/span&gt;&lt;span&gt;ETH_WSS_ENDPOINT&lt;/span&gt;&lt;span&gt;!&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;        ETH_SMART_CONTRACT_ADDRESS: process.env.&lt;/span&gt;&lt;span&gt;ETH_SMART_CONTRACT_ADDRESS&lt;/span&gt;&lt;span&gt;!&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      // can be .fromContainerRegistry() if available to ECR&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      image: ecs.ContainerImage.&lt;/span&gt;&lt;span&gt;fromAsset&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;''&lt;/span&gt;&lt;span&gt;),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      logging: &lt;/span&gt;&lt;span&gt;new&lt;/span&gt;&lt;span&gt; ecs.&lt;/span&gt;&lt;span&gt;AwsLogDriver&lt;/span&gt;&lt;span&gt;({&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;        streamPrefix: &lt;/span&gt;&lt;span&gt;'SmartContractEventListener'&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;        mode: ecs.AwsLogDriverMode.&lt;/span&gt;&lt;span&gt;NON_BLOCKING&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      }),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    new&lt;/span&gt;&lt;span&gt; ecs.&lt;/span&gt;&lt;span&gt;FargateService&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;this&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;'SmartContractEventListenerFargateService'&lt;/span&gt;&lt;span&gt;, {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      serviceName: &lt;/span&gt;&lt;span&gt;'FargateService'&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      cluster,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      taskDefinition,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h3 id=&quot;deploying-the-aws-resources-using-aws-cdk&quot;&gt;Deploying the AWS resources using AWS CDK&lt;/h3&gt;
&lt;p&gt;Now that we’ve reviewed the AWS CDK code and AWS resources, it’s time to deploy your smart contract event listener.&lt;/p&gt;
&lt;p&gt;To deploy your smart contract event listener:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Build the source files: &lt;code&gt;npm run build&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Deploy the AWS resources: &lt;code&gt;cdk deploy&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Review the changes, then when prompted with &lt;code&gt;Do you wish to deploy these changes (y/n)?&lt;/code&gt;, enter &lt;code&gt;y&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;You should see a progress bar of the AWS resources that are being deployed.
&lt;img alt=&quot;AWS CDK deployment progress bar&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1644&quot; height=&quot;344&quot; src=&quot;https://jaspergabriel.dev/_astro/deployment-progress.Cbt82_J__1V4dpx.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/deployment-progress.Cbt82_J__lsNIO.webp 680w, https://jaspergabriel.dev/_astro/deployment-progress.Cbt82_J__1VXiGL.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;p&gt;The deployment should take around 5 minutes to complete, so in the meantime, you can take a quick break.&lt;/p&gt;
&lt;p&gt;Once the deployment completes, you should see the deployment time and the CloudFormation stack ARN.
&lt;img alt=&quot;AWS CDK deployment complete&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1806&quot; height=&quot;330&quot; src=&quot;https://jaspergabriel.dev/_astro/deployment-complete.ChQB24fp_2ictn2.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/deployment-complete.ChQB24fp_Z1dbShW.webp 680w, https://jaspergabriel.dev/_astro/deployment-complete.ChQB24fp_1bVVLV.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; If your deployment takes longer than 5 minutes and seems to be stuck, then you can check the ECS service logs, as shown in &lt;a href=&quot;https://jaspergabriel.dev/blog/smart-contract-event-listener-aws-cdk/###Check-the-smart-contract-event-listener-logs-in-AWS&quot;&gt;this section&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If the logs show runtime errors, then you can do the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Follow this &lt;a href=&quot;https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-console-delete-stack.html&quot;&gt;guide&lt;/a&gt; to delete the &lt;code&gt;SmartContractEventListenerStack&lt;/code&gt; in CloudFormation.&lt;/li&gt;
&lt;li&gt;Review and test the code and Docker build locally to verify it’s working as intended.&lt;/li&gt;
&lt;li&gt;Build and redeploy using the above steps.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;h3 id=&quot;check-the-smart-contract-event-listener-logs-in-aws&quot;&gt;Check the smart contract event listener logs in AWS&lt;/h3&gt;
&lt;p&gt;Now that you’ve successfully deployed a smart contract event listener, it’s time to verify if it’s receiving events from the Ethereum USDT contract or your contract.&lt;/p&gt;
&lt;p&gt;Here are the steps to check the logs from your smart contract event listener:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;In the AWS console, go to the &lt;strong&gt;ECS&lt;/strong&gt;, then click on &lt;strong&gt;SmartContractEventListenerCluster&lt;/strong&gt;.
&lt;img alt=&quot;AWS Console ECS Dashboard&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1904&quot; height=&quot;720&quot; src=&quot;https://jaspergabriel.dev/_astro/ecs-dashboard.B-_qesR3_sbj6B.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/ecs-dashboard.B-_qesR3_2sxVP3.webp 680w, https://jaspergabriel.dev/_astro/ecs-dashboard.B-_qesR3_Z1bwSaO.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Then, go to &lt;strong&gt;Services&lt;/strong&gt;, and click &lt;strong&gt;FargateService&lt;/strong&gt;.
&lt;img alt=&quot;AWS Console ECS Services&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1898&quot; height=&quot;782&quot; src=&quot;https://jaspergabriel.dev/_astro/ecs-services.zNi9tPKf_Z2iz6Vm.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/ecs-services.zNi9tPKf_2pdWTc.webp 680w, https://jaspergabriel.dev/_astro/ecs-services.zNi9tPKf_Z1tC5zI.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Finally, click &lt;strong&gt;Logs&lt;/strong&gt;.
&lt;img alt=&quot;AWS Console ECS Logs&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1884&quot; height=&quot;793&quot; src=&quot;https://jaspergabriel.dev/_astro/ecs-logs.CyuZmBEI_Z1KU6Yf.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/ecs-logs.CyuZmBEI_ZGHCmT.webp 680w, https://jaspergabriel.dev/_astro/ecs-logs.CyuZmBEI_Z2go6q2.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;You should now be seeing the logging of events from the Ethereum USDT contract or the smart contract you specified.&lt;/p&gt;
&lt;h3 id=&quot;cleaning-up-the-aws-resources-optional&quot;&gt;Cleaning up the AWS resources (Optional)&lt;/h3&gt;
&lt;p&gt;After testing the smart contract event listener, it’s recommended to clean up the deployed AWS resources especially if you’re just doing a proof of concept.&lt;/p&gt;
&lt;p&gt;To delete the deployed AWS resources, run the &lt;code&gt;cdk destroy&lt;/code&gt; command.&lt;/p&gt;
&lt;p&gt;This makes sure that you &lt;strong&gt;avoid incurring unnecessary charges&lt;/strong&gt; on your AWS account, since running an ECS cluster is not part of the &lt;a href=&quot;https://aws.amazon.com/free/&quot;&gt;AWS Free Tier&lt;/a&gt;, and would incur charges if it’s left running in the cloud.&lt;/p&gt;
&lt;h2 id=&quot;some-caveats-and-improvements-to-consider&quot;&gt;Some caveats and improvements to consider&lt;/h2&gt;
&lt;p&gt;We’ve verified that the smart contract event listener is working. Now I’ll go through some of the caveats and improvements to consider since I’ve personally implemented a smart contract event listener at the &lt;a href=&quot;https://p33r.finance/&quot;&gt;startup&lt;/a&gt; I’m currently working at.&lt;/p&gt;
&lt;h3 id=&quot;integrating-smart-contract-events-into-other-services&quot;&gt;Integrating smart contract events into other services&lt;/h3&gt;
&lt;p&gt;You might be wondering how you can integrate smart contract events into your backend systems, so here are some ideas:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.aws.amazon.com/lambda/latest/dg/services-cloudwatchlogs.html&quot;&gt;Trigger a Lambda with CloudWatch Logs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Add code in the smart contract event listener subscriptions to trigger other parts of your system.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I would recommend the first idea since Lambda is flexible and can fit a lot of use cases. You can also trigger Lambda functions every time a smart contract event is logged into CloudWatch.&lt;/p&gt;
&lt;p&gt;At &lt;a href=&quot;https://www.rails.p33r.finance/&quot;&gt;RAILS by P33R&lt;/a&gt;, we use this approach. The app allows customers to off-ramp their crypto &lt;a href=&quot;https://www.investopedia.com/terms/s/stablecoin.asp&quot;&gt;stablecoins&lt;/a&gt; (&lt;a href=&quot;https://tether.to/en/&quot;&gt;USDT&lt;/a&gt;, &lt;a href=&quot;https://www.circle.com/en/usdc&quot;&gt;USDC&lt;/a&gt;, and &lt;a href=&quot;https://makerdao.com/en/&quot;&gt;DAI&lt;/a&gt;) into fiat currencies (SGD, PHP).&lt;/p&gt;
&lt;p&gt;A high-level implementation of the app’s crypto-to-fiat use case is shown below. The flow is as follows:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Customer&lt;/strong&gt; deposits &lt;strong&gt;crypto stablecoins&lt;/strong&gt; to the &lt;strong&gt;escrow smart contract&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Escrow smart contract&lt;/strong&gt; emits a &lt;code&gt;Deposit&lt;/code&gt; event.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Smart contract event listener&lt;/strong&gt; receives the &lt;code&gt;Deposit&lt;/code&gt; event, and logs to &lt;strong&gt;CloudWatch&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CloudWatch log&lt;/strong&gt; triggers the &lt;strong&gt;Fiat Disbursement Lambda function&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Customer&lt;/strong&gt; receives &lt;strong&gt;fiat&lt;/strong&gt; in their &lt;strong&gt;bank account&lt;/strong&gt; or &lt;strong&gt;e-wallet&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=&quot;RAILS&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;596&quot; height=&quot;396&quot; src=&quot;https://jaspergabriel.dev/_astro/rails-high-level-drawio.D1pxIJ0n_Z1lxw7K.svg&quot;&gt;&lt;/p&gt;
&lt;p&gt;This is an example implementation that you can reference for your own use cases.&lt;/p&gt;
&lt;h3 id=&quot;health-checks-and-error-handling&quot;&gt;Health checks and error handling&lt;/h3&gt;
&lt;p&gt;If you plan to use smart contract event listeners in production, monitoring the health of the service and handling errors is a requirement.&lt;/p&gt;
&lt;p&gt;At the time of writing this, I hadn’t figured out how to implement health checks for the smart contract event listeners in ECS. A workaround for this is to implement &lt;a href=&quot;https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html&quot;&gt;CloudWatch alarms&lt;/a&gt;. You can send email alerts when the smart contract event listener throws an error.&lt;/p&gt;
&lt;p&gt;I also encountered a specific issue related to the &lt;strong&gt;block limit when querying smart contract events over 10,000 blocks&lt;/strong&gt;. This was an issue with &lt;a href=&quot;https://www.quicknode.com/&quot;&gt;QuickNode&lt;/a&gt;, but other providers also have a 10,000 block limit for querying logs and events. For more information, here is &lt;a href=&quot;https://support.quicknode.com/hc/en-us/articles/10258449939473-Is-there-a-block-range-limit-for-querying-logs-and-events&quot;&gt;QuickNode’s support article&lt;/a&gt; on this topic.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;This 10,000 block limit error happens because when you create a smart contract event subscription in &lt;code&gt;Web3.js&lt;/code&gt;, it automatically filters for smart contract events, starting from the block number at the time of the subscription. Let’s assume that the current block number is at 1,001. Then the smart contract event listener can safely query for events until block number 11,001. The WebSocket provider will throw an error when the block number exceeds 11,001.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Fortunately, whenever the smart contract event listener throws an error, the ECS cluster will automatically restart the service. This is the default behavior since ECS is a fully managed AWS service for container orchestration. Even with this, it’s still important to improve the health checks and error handling, and not fully rely on AWS error handling.&lt;/p&gt;
&lt;h3 id=&quot;improving-reliability-with-the-aws-well-architected-framework&quot;&gt;Improving reliability with the AWS Well-Architected framework&lt;/h3&gt;
&lt;p&gt;As we’re building cloud infrastructure in AWS, it’s important to follow the &lt;a href=&quot;https://aws.amazon.com/architecture/well-architected/?wa-lens-whitepapers.sort-by=item.additionalFields.sortDate&amp;#x26;wa-lens-whitepapers.sort-order=desc&amp;#x26;wa-guidance-whitepapers.sort-by=item.additionalFields.sortDate&amp;#x26;wa-guidance-whitepapers.sort-order=desc&quot;&gt;AWS Well-Architected framework&lt;/a&gt;. One of the pillars of the Well-Architected framework is &lt;a href=&quot;https://docs.aws.amazon.com/wellarchitected/latest/reliability-pillar/welcome.html&quot;&gt;Reliability&lt;/a&gt;. This means removing single points of failure in the smart contract event listener, resulting in more resilient architectures.&lt;/p&gt;
&lt;p&gt;One way of improving the reliability of the smart contract event listener is to support multiple availability zones in the ECS cluster. This ensures redundancy in the event of a failure in one availability zone. For more information, here’s a blog on &lt;a href=&quot;https://aws.amazon.com/blogs/containers/amazon-ecs-availability-best-practices/&quot;&gt;Amazon ECS availability best practices&lt;/a&gt; and AWS’ &lt;a href=&quot;https://docs.aws.amazon.com/wellarchitected/latest/reliability-pillar/shared-responsibility-model-for-resiliency.html&quot;&gt;Shared Responsibility Model for Resiliency&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Once you’ve implemented the smart contract event listener cluster to be in multiple availability zones, you’ll need your systems to be &lt;a href=&quot;https://en.wikipedia.org/wiki/Idempotence&quot;&gt;idempotent&lt;/a&gt;. This means that when you receive the same smart contract event multiple times, it should only be processed once in your system.&lt;/p&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;To recap, we’ve gone through the process of implementing and deploying a smart contract event listener with the following steps:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Configuring the &lt;strong&gt;WebSocket endpoint&lt;/strong&gt; and &lt;strong&gt;smart contract address&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Reviewing and testing the smart contract event listener code.&lt;/li&gt;
&lt;li&gt;Deploying the smart contract event listener to AWS using &lt;strong&gt;AWS CDK&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Verifying the deployed smart contract event listener is working.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I’ve also shared some caveats and improvements to consider as you build on top of the listener:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Integrating the smart contract event listener with different AWS services such as &lt;strong&gt;Lambda functions&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Improving reliability by deploying the smart contract event listener to multiple &lt;strong&gt;availability zones (AZ)&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Setting up CloudWatch alarms for error monitoring.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Listening to smart contract events enables developers to integrate smart contracts into different APIs and enable real-time updates. AWS CDK allows you to deploy reliable cloud infrastructure with just a few lines of code, giving you more confidence in your deployments, and allowing you to focus on solving real-world problems.&lt;/p&gt;
&lt;p&gt;If you’ve made it this far, thank you for reading! If you have any questions, I’d love to hear from you.&lt;/p&gt;</content>
  </entry>
  <entry>
    <title>OpenAI DevDay and GitHub Universe 2023: What It Means for Us Software Engineers</title>
    <link href="https://jaspergabriel.dev/blog/openai-devday-github-universe-2023/" rel="alternate" type="text/html"/>
    <id>https://jaspergabriel.dev/blog/openai-devday-github-universe-2023/</id>
    <published>2023-11-12T00:00:00.000Z</published>
    <updated>2023-11-12T00:00:00.000Z</updated>
    <summary>Analysis of GPT-4 Turbo, Copilot Chat, and Assistants API — what these AI advancements mean for software engineers.</summary>
    <category term="tech"/>
    <category term="ai"/>
    <category term="github"/>
    <content type="html">&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Earlier this week, the team and I rented an Airbnb to prepare for our upcoming &lt;a href=&quot;https://www.eventbrite.co.uk/e/tenity-singapore-incubation-batch-vi-demoday-tickets-740213898697&quot;&gt;demo day&lt;/a&gt; on November 23rd. We had internal discussions and started preparing our pitch deck. Then while on a break, looking for videos to watch on YouTube, we happened to see a recent video on &lt;a href=&quot;https://www.youtube.com/watch?v=U9mJuUkhUzk&amp;#x26;ab_channel=OpenAI&quot;&gt;OpenAI’s DevDay&lt;/a&gt;. After watching the video, we were amazed, and we started discussing the possibilities enabled by OpenAI’s new features. After a few days, &lt;a href=&quot;https://www.youtube.com/watch?v=NrQkdDVupQE&quot;&gt;GitHub Universe 2023&lt;/a&gt; started. We binged the keynotes which added to our excitement and slight worries.&lt;/p&gt;
&lt;p&gt;Our feelings of excitement stemmed from discussions on how we can leverage AI to improve developer workflows and stay lean at our startup. Meaning not needing to hire additional engineering resources while we build out our MVPs. There are also new features that make it easier to integrate AI assistants into our future applications, which helps in providing a modern experience.&lt;/p&gt;
&lt;p&gt;Our worries came from the disruptions caused by AI advancements. We can’t help but think about our future job security since AI is becoming more capable of doing development tasks. We also thought about how certain startups can become obsolete after OpenAI’s announcements.&lt;/p&gt;
&lt;p&gt;If you’re a software engineer wondering what these developments mean for you, then you’ve come to the right place. In this article, I’ll recap what we’ve witnessed from OpenAI and GitHub. Then I’ll share some thoughts on its impact on us software engineers.&lt;/p&gt;
&lt;h2 id=&quot;openai-devday&quot;&gt;OpenAI DevDay&lt;/h2&gt;
&lt;p&gt;OpenAI had its first &lt;a href=&quot;https://devday.openai.com/&quot;&gt;DevDay&lt;/a&gt;, which generated a lot of buzz throughout the AI and developer communities. Let’s go through the key features.&lt;/p&gt;
&lt;h3 id=&quot;gpt-4-turbo&quot;&gt;GPT-4 Turbo&lt;/h3&gt;
&lt;p&gt;The first announcement introduced &lt;a href=&quot;https://help.openai.com/en/articles/8555510-gpt-4-turbo&quot;&gt;GPT-4 Turbo&lt;/a&gt;, the latest generation model from OpenAI that had the following updates:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Four times more &lt;strong&gt;context length&lt;/strong&gt; than the previous GPT-4 model (32k tokens) at &lt;strong&gt;128k tokens&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cheaper pricing&lt;/strong&gt; for input and output tokens.&lt;/li&gt;
&lt;li&gt;More recent knowledge cut-off date of &lt;strong&gt;April 2023&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Support for &lt;strong&gt;function calling&lt;/strong&gt; and &lt;strong&gt;JSON mode&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Support for &lt;strong&gt;code interpreter&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Reproducible outputs with &lt;strong&gt;seed&lt;/strong&gt; parameter.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Context length is important in GPTs because the more details and instructions you can provide, the more accurate the GPTs’ responses will be. Combined with cheaper pricing, you can provide more context that is cost-effective.&lt;/p&gt;
&lt;p&gt;Support for function calling and JSON mode allows for easier API integrations when using GPT-4 Turbo and other supported models.&lt;/p&gt;
&lt;p&gt;Then support for code interpreters allows GPTs to generate and run Python code as needed. This allows for use cases that need to parse and process files, calculate data, and a lot more.&lt;/p&gt;
&lt;h3 id=&quot;gpts&quot;&gt;“GPTs”&lt;/h3&gt;
&lt;p&gt;The next announcement was about “GPTs”, where users can create their own GPT versions for different use cases without having to write code. Sam Altman demoed this functionality by creating a “Startup Mentor” GPT since he usually gets similar questions from early-stage startup founders during &lt;a href=&quot;https://www.ycombinator.com/blog/open-office-hours-sign-up-for-office-hours-with-yc-partners&quot;&gt;YC office hours&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;OpenAI DevDay - Sam Altman&amp;#x27;s Demo&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;2696&quot; height=&quot;1186&quot; src=&quot;https://jaspergabriel.dev/_astro/openai-devday-2.Bp__Q4Uw_1X6mhs.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/openai-devday-2.Bp__Q4Uw_1TNpig.webp 680w, https://jaspergabriel.dev/_astro/openai-devday-2.Bp__Q4Uw_Z2qi3N4.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Screenshot from &lt;a href=&quot;https://www.youtube.com/watch?v=U9mJuUkhUzk&amp;#x26;ab_channel=OpenAI&quot;&gt;OpenAI’s DevDay video&lt;/a&gt; on OpenAI’s YouTube channel.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;A GPT store will also be rolled out later this month allowing users to share their work with the public and possibly earn money depending on their GPTs’ usage and popularity.&lt;/p&gt;
&lt;h3 id=&quot;assistants-api&quot;&gt;Assistants API&lt;/h3&gt;
&lt;p&gt;After that, they showed the new Assistants API. With similar capabilities to GPTs, this enables developers to leverage GPTs programmatically for their use cases.&lt;/p&gt;
&lt;p&gt;The demo shown using this feature was on a sample travel website, where users can use an AI assistant to plan their travels.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;OpenAI DevDay - Assistants API Demo&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;2682&quot; height=&quot;1198&quot; src=&quot;https://jaspergabriel.dev/_astro/openai-devday-1.CusKDMXr_gS5oD.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/openai-devday-1.CusKDMXr_Z1fWK9n.webp 680w, https://jaspergabriel.dev/_astro/openai-devday-1.CusKDMXr_6fdnl.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Screenshot from &lt;a href=&quot;https://www.youtube.com/watch?v=U9mJuUkhUzk&amp;#x26;ab_channel=OpenAI&quot;&gt;OpenAI’s DevDay video&lt;/a&gt; on OpenAI’s YouTube channel.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id=&quot;github-universe-2023&quot;&gt;GitHub Universe 2023&lt;/h2&gt;
&lt;p&gt;After a few days, GitHub Universe 2023 opened up with some exciting announcements. Let’s walk through the key highlights.&lt;/p&gt;
&lt;h3 id=&quot;copilot-chat&quot;&gt;Copilot Chat&lt;/h3&gt;
&lt;p&gt;The first announcement made was with &lt;a href=&quot;https://docs.github.com/en/copilot/github-copilot-chat/using-github-copilot-chat-in-your-ide&quot;&gt;Copilot Chat&lt;/a&gt;, which is coming in December.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;GitHub Universe 2023 - Copilot Chat Demo&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;2784&quot; height=&quot;1580&quot; src=&quot;https://jaspergabriel.dev/_astro/github-universe-2023-1.CjXWJYqk_Z2qxX2D.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/github-universe-2023-1.CjXWJYqk_ZkiXsQ.webp 680w, https://jaspergabriel.dev/_astro/github-universe-2023-1.CjXWJYqk_pSt1f.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Screenshot from &lt;a href=&quot;https://www.youtube.com/watch?v=NrQkdDVupQE&amp;#x26;ab_channel=GitHub&quot;&gt;GitHub Universe 2023 video&lt;/a&gt; on GitHub’s YouTube channel.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This brings different features such as:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Using GPT-4 models&lt;/li&gt;
&lt;li&gt;Code-aware guidance and code generation&lt;/li&gt;
&lt;li&gt;Iterate on code in line&lt;/li&gt;
&lt;li&gt;Shortcuts to generate unit tests, fix suggestions, pull request descriptions, and much more.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;All of these features are integrated into popular IDEs such as VS Code, which helps with staying in the development flow.&lt;/p&gt;
&lt;h3 id=&quot;copilot-enterprise&quot;&gt;Copilot Enterprise&lt;/h3&gt;
&lt;p&gt;While Copilot Chat is integrated per repository, Copilot Enterprise is instead integrated with your organization’s codebase.&lt;/p&gt;
&lt;p&gt;This helps developers quickly get insights, especially in large organizations with thousands of repositories and billions of lines of code.&lt;/p&gt;
&lt;h3 id=&quot;ai-powered-security&quot;&gt;AI-Powered Security&lt;/h3&gt;
&lt;p&gt;Then, an announcement on AI-powered security was made. This helps minimize insecure coding practices by detecting and correcting hard-coded credentials and secrets, and vulnerabilities such as SQL injection.&lt;/p&gt;
&lt;h2 id=&quot;what-these-ai-announcements-mean-for-us-software-engineers&quot;&gt;What These AI Announcements Mean for Us Software Engineers&lt;/h2&gt;
&lt;h3 id=&quot;the-positives&quot;&gt;The Positives&lt;/h3&gt;
&lt;p&gt;Most of the announced features are aimed at improving developer experiences. Whether you’re a front-end, back-end, full-stack, or any other engineering role, these changes can help you be more productive and allow you to focus on building creative solutions to engineering problems.&lt;/p&gt;
&lt;p&gt;Here are some ways these AI tools help:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Integrate AI assistants in your applications with &lt;strong&gt;OpenAI Assistants API&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Create &lt;strong&gt;GPTs&lt;/strong&gt; for your specific use cases (Code reviewer, Mentor, etc.).&lt;/li&gt;
&lt;li&gt;Implement Test-Driven Development (TDD) with &lt;strong&gt;GitHub Copilot&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Improve developer workflows with &lt;strong&gt;GitHub Copilot Chat&lt;/strong&gt; and &lt;strong&gt;Copilot Enterprise&lt;/strong&gt;:
&lt;ul&gt;
&lt;li&gt;Build documentation&lt;/li&gt;
&lt;li&gt;Suggest code based on open files and repositories&lt;/li&gt;
&lt;li&gt;Generate pull request summaries&lt;/li&gt;
&lt;li&gt;Review pull requests&lt;/li&gt;
&lt;li&gt;Fix bugs and issues&lt;/li&gt;
&lt;li&gt;Remediate security vulnerabilities&lt;/li&gt;
&lt;li&gt;Ask Copilot Chat questions about the codebase&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;the-not-so-positives&quot;&gt;The Not So Positives&lt;/h3&gt;
&lt;p&gt;While these AI tools improve developer workflows and productivity, you can also argue that this might lead to a reduction in engineering resources for some companies. Some startups might even become obsolete if they do not pivot or solidify their &lt;a href=&quot;https://www.omniconvert.com/what-is/uvp-unique-value-proposition/&quot;&gt;unique value proposition (UVP)&lt;/a&gt;, which will inevitably cause some job losses. Startups have always been risky, and disruptions are always bound to happen. It’s just that advancements in AI accelerated this &lt;a href=&quot;https://gongos.com/thinking-post/how-disruptions-are-born-and-how-it-applies-to-the-market-research-discipline/&quot;&gt;disruption cycle&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Even with these concerns, I wouldn’t worry too much about the job market, especially if you’re continuously improving yourself. While there is a &lt;strong&gt;surplus&lt;/strong&gt; of &lt;strong&gt;software engineers&lt;/strong&gt;, there’s also a &lt;strong&gt;shortage&lt;/strong&gt; of &lt;strong&gt;talented software engineers&lt;/strong&gt;. If you start learning and leveraging these AI tools in your everyday workflows, you can keep up with the latest trends in tech, and in turn, be a valuable asset for any tech company.&lt;/p&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;The opening keynotes from &lt;a href=&quot;https://www.youtube.com/watch?v=U9mJuUkhUzk&amp;#x26;ab_channel=OpenAI&quot;&gt;OpenAI’s DevDay&lt;/a&gt; and &lt;a href=&quot;https://www.youtube.com/watch?v=NrQkdDVupQE&amp;#x26;ab_channel=GitHub&quot;&gt;GitHub Universe 2023&lt;/a&gt; showcased new and improved AI tools that software engineers can use to make their development experiences more enjoyable, from prompting ChatGPT and Copilot Chat to generating documentation and unit tests. As tech keeps on evolving, it’s important for us as engineers to also adapt, innovate, and continuously learn to keep up with the trend.&lt;/p&gt;
&lt;p&gt;Our team and I have already availed &lt;a href=&quot;https://openai.com/blog/chatgpt-plus&quot;&gt;ChatGPT Plus&lt;/a&gt;, &lt;a href=&quot;https://platform.openai.com/docs/overview&quot;&gt;OpenAI Platform APIs&lt;/a&gt;, and &lt;a href=&quot;https://github.com/features/copilot&quot;&gt;GitHub Copilot&lt;/a&gt;. I’ll be playing around and experimenting with these new features and how they can enhance my developer workflows, and I’ll be sure to write about interesting stuff I learn along the way.&lt;/p&gt;
&lt;p&gt;As we part ways, I thank you for reading and I’ll leave you with one question, &lt;strong&gt;How will you leverage these new AI tools in your development workflows?&lt;/strong&gt;&lt;/p&gt;
&lt;h2 id=&quot;further-reading-and-resources&quot;&gt;Further Reading and Resources&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=U9mJuUkhUzk&amp;#x26;ab_channel=OpenAI&quot;&gt;OpenAI DevDay Opening Keynote&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=NrQkdDVupQE&amp;#x26;ab_channel=GitHub&quot;&gt;GitHub Universe 2023 Opening Keynote&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://devday.openai.com/&quot;&gt;OpenAI DevDay Landing Page&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.blog/2023-11-08-universe-2023-copilot-transforms-github-into-the-ai-powered-developer-platform/&quot;&gt;GitHub Universe 2023 Blog&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.latent.space/p/ai-engineer&quot;&gt;The Rise of the AI Engineer - swyx&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry>
  <entry>
    <title>How to Reliably Read QR Codes in Node.js</title>
    <link href="https://jaspergabriel.dev/blog/read-qr-codes-nodejs/" rel="alternate" type="text/html"/>
    <id>https://jaspergabriel.dev/blog/read-qr-codes-nodejs/</id>
    <published>2023-11-04T00:00:00.000Z</published>
    <updated>2023-11-04T00:00:00.000Z</updated>
    <summary>Implement a production-ready QR code decoder in Node.js using jsQR and Jimp instead of unmaintained alternatives.</summary>
    <category term="tech"/>
    <category term="nodejs"/>
    <content type="html">&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;/h2&gt;
&lt;p&gt;In today’s digital landscape, QR codes are widely used. Thanks to the QR code’s efficiency in storing and reading data, you can see QR codes being used in restaurants, public transportation, app downloads, survey forms, and a whole lot of other applications.&lt;/p&gt;
&lt;p&gt;Reading QR codes is usually handled by frontend applications via scanners or image uploads, but if you need a way to read QR codes in the backend, then you’ve come to the right place!&lt;/p&gt;
&lt;h2 id=&quot;why-i-made-this-blog-post&quot;&gt;Why I made this blog post&lt;/h2&gt;
&lt;p&gt;I was figuring out how to read QR codes in Node.js, so I’ve tried following existing guides from &lt;a href=&quot;https://blog.logrocket.com/create-read-qr-codes-node-js/&quot;&gt;LogRocket&lt;/a&gt; and &lt;a href=&quot;https://www.geeksforgeeks.org/reading-qr-codes-using-node-js/&quot;&gt;GeeksforGeeks&lt;/a&gt;. They both had similar solutions using &lt;a href=&quot;https://www.npmjs.com/package/qrcode-reader&quot;&gt;qrcode-reader&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Upon testing the solution multiple times, I’ve encountered &lt;a href=&quot;https://github.com/edi9999/jsqrcode/issues/65&quot;&gt;occasional bugs&lt;/a&gt; with &lt;code&gt;qrcode-reader&lt;/code&gt;, which made it unsuitable for production workloads.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;qrcode-reader&lt;/code&gt; package is &lt;a href=&quot;https://github.com/edi9999/jsqrcode/issues/32#issuecomment-575042561&quot;&gt;no longer maintained&lt;/a&gt; and the owner recommended &lt;a href=&quot;https://www.npmjs.com/package/jsqr&quot;&gt;jsqr&lt;/a&gt; as an alternative, which is what we’re going to use.&lt;/p&gt;
&lt;h2 id=&quot;qr-code-reader-solution&quot;&gt;QR Code Reader Solution&lt;/h2&gt;
&lt;p&gt;Now let’s walk through the solution for reading QR codes in Node.js. You can follow along or check the sample repository &lt;a href=&quot;https://github.com/jdg2896/qrcode-decoder-nodejs&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&quot;installing-jimp-and-jsqr&quot;&gt;Installing Jimp and jsQR&lt;/h3&gt;
&lt;p&gt;For the npm packages, we’ll be using &lt;a href=&quot;https://www.npmjs.com/package/jimp&quot;&gt;jimp&lt;/a&gt; for the image loader and &lt;a href=&quot;https://www.npmjs.com/package/jsqr&quot;&gt;jsqr&lt;/a&gt; for the QR code reader.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;npm install jimp jsqr&lt;/code&gt;&lt;/p&gt;
&lt;h3 id=&quot;typescript-code-srcappts&quot;&gt;TypeScript Code (src/app.ts)&lt;/h3&gt;
&lt;p&gt;The sample QR code &lt;code&gt;src/qr.png&lt;/code&gt; is in the &lt;a href=&quot;https://github.com/jdg2896/qrcode-decoder-nodejs&quot;&gt;sample repository&lt;/a&gt;. You can also replace &lt;code&gt;src/qr.png&lt;/code&gt; and use any QR code image if you want.&lt;/p&gt;
&lt;div class=&quot;code-block&quot;&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light-default github-dark-default&quot; data-language=&quot;ts&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;import&lt;/span&gt;&lt;span&gt; Jimp &lt;/span&gt;&lt;span&gt;from&lt;/span&gt;&lt;span&gt; 'jimp'&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;import&lt;/span&gt;&lt;span&gt; jsQR &lt;/span&gt;&lt;span&gt;from&lt;/span&gt;&lt;span&gt; 'jsqr'&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;const&lt;/span&gt;&lt;span&gt; decodeQR&lt;/span&gt;&lt;span&gt; =&lt;/span&gt;&lt;span&gt; async&lt;/span&gt;&lt;span&gt; ()&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt; Promise&lt;/span&gt;&lt;span&gt;&amp;#x3C;&lt;/span&gt;&lt;span&gt;string&lt;/span&gt;&lt;span&gt;&gt; &lt;/span&gt;&lt;span&gt;=&gt;&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    try&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;        // Load the image with Jimp&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;        const&lt;/span&gt;&lt;span&gt; image&lt;/span&gt;&lt;span&gt; =&lt;/span&gt;&lt;span&gt; await&lt;/span&gt;&lt;span&gt; Jimp.&lt;/span&gt;&lt;span&gt;read&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;'src/qr.png'&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;        // Get the image data&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;        const&lt;/span&gt;&lt;span&gt; imageData&lt;/span&gt;&lt;span&gt; =&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;            data: &lt;/span&gt;&lt;span&gt;new&lt;/span&gt;&lt;span&gt; Uint8ClampedArray&lt;/span&gt;&lt;span&gt;(image.bitmap.data),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;            width: image.bitmap.width,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;            height: image.bitmap.height,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;        };&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;        // Use jsQR to decode the QR code&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;        const&lt;/span&gt;&lt;span&gt; decodedQR&lt;/span&gt;&lt;span&gt; =&lt;/span&gt;&lt;span&gt; jsQR&lt;/span&gt;&lt;span&gt;(imageData.data, imageData.width, imageData.height);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;        if&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span&gt;!&lt;/span&gt;&lt;span&gt;decodedQR) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;            throw&lt;/span&gt;&lt;span&gt; new&lt;/span&gt;&lt;span&gt; Error&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;'QR code not found in the image.'&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;        }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;        return&lt;/span&gt;&lt;span&gt; decodedQR.data;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    } &lt;/span&gt;&lt;span&gt;catch&lt;/span&gt;&lt;span&gt; (error) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;        console.&lt;/span&gt;&lt;span&gt;error&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;'Error decoding QR code:'&lt;/span&gt;&lt;span&gt;, error);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;// Test the decodeQR() function&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;const&lt;/span&gt;&lt;span&gt; run&lt;/span&gt;&lt;span&gt; =&lt;/span&gt;&lt;span&gt; async&lt;/span&gt;&lt;span&gt; () &lt;/span&gt;&lt;span&gt;=&gt;&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    console.&lt;/span&gt;&lt;span&gt;log&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;await&lt;/span&gt;&lt;span&gt; decodeQR&lt;/span&gt;&lt;span&gt;());&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;run&lt;/span&gt;&lt;span&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Optional:&lt;/strong&gt; If you need to read base64 string QR codes, replace the &lt;code&gt;Jimp.read()&lt;/code&gt; function with this.&lt;/p&gt;
&lt;div class=&quot;code-block&quot;&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light-default github-dark-default&quot; data-language=&quot;ts&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;const&lt;/span&gt;&lt;span&gt; base64&lt;/span&gt;&lt;span&gt; =&lt;/span&gt;&lt;span&gt; 'data:image/png;base64,iVBORw0KGgo...'&lt;/span&gt;&lt;span&gt; // replace with your base64 string&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;const&lt;/span&gt;&lt;span&gt; qrBuffer&lt;/span&gt;&lt;span&gt; =&lt;/span&gt;&lt;span&gt; Buffer.&lt;/span&gt;&lt;span&gt;from&lt;/span&gt;&lt;span&gt;(base64.&lt;/span&gt;&lt;span&gt;replace&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;/&lt;/span&gt;&lt;span&gt;^&lt;/span&gt;&lt;span&gt;data:image&lt;/span&gt;&lt;span&gt;\/&lt;/span&gt;&lt;span&gt;[a-z]&lt;/span&gt;&lt;span&gt;+&lt;/span&gt;&lt;span&gt;;base64,/&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;''&lt;/span&gt;&lt;span&gt;), &lt;/span&gt;&lt;span&gt;'base64'&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;const&lt;/span&gt;&lt;span&gt; image&lt;/span&gt;&lt;span&gt; =&lt;/span&gt;&lt;span&gt; await&lt;/span&gt;&lt;span&gt; Jimp.&lt;/span&gt;&lt;span&gt;read&lt;/span&gt;&lt;span&gt;(qrBuffer);&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;h3 id=&quot;testing-the-code&quot;&gt;Testing the Code&lt;/h3&gt;
&lt;p&gt;To test the solution, you can build and start the function, which will retrieve the data from the &lt;code&gt;src/qr.png&lt;/code&gt; image file.&lt;/p&gt;
&lt;div class=&quot;code-block&quot;&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light-default github-dark-default&quot; data-language=&quot;zsh&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;npm&lt;/span&gt;&lt;span&gt; build&lt;/span&gt;&lt;span&gt; (or &lt;/span&gt;&lt;span&gt;tsc&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;npm&lt;/span&gt;&lt;span&gt; start&lt;/span&gt;&lt;span&gt; (or &lt;/span&gt;&lt;span&gt;node&lt;/span&gt;&lt;span&gt; src/app.ts&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&gt;&lt;/span&gt;&lt;span&gt; qrcode-decoder-nodejs@1.0.0 start&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&gt;&lt;/span&gt;&lt;span&gt; node src/app.js&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Sample&lt;/span&gt;&lt;span&gt; QR&lt;/span&gt;&lt;span&gt; code&lt;/span&gt;&lt;span&gt; data&lt;/span&gt;&lt;span&gt; for&lt;/span&gt;&lt;span&gt; testing.&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;As you can see, we decoded the data and received &lt;code&gt;&quot;Sample QR code data for testing.&quot;&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;To recap, we implemented a QR code reader in Node.js using &lt;a href=&quot;https://www.npmjs.com/package/jimp&quot;&gt;jimp&lt;/a&gt; and &lt;a href=&quot;https://www.npmjs.com/package/jsqr&quot;&gt;jsqr&lt;/a&gt;. We also tested the &lt;code&gt;decodeQR()&lt;/code&gt; function, which decoded the sample QR image. Also, here’s the &lt;a href=&quot;https://github.com/jdg2896/qrcode-decoder-nodejs&quot;&gt;sample repository&lt;/a&gt; with the code shown in this guide if you’ve missed it.&lt;/p&gt;
&lt;p&gt;I hope this helped you with implementing a QR code reader in Node.js. Thank you for reading, and feel free to connect with me on &lt;a href=&quot;https://x.com/jdg2896&quot;&gt;X&lt;/a&gt; and &lt;a href=&quot;https://www.linkedin.com/in/jaspergabriel/&quot;&gt;LinkedIn&lt;/a&gt;.&lt;/p&gt;</content>
  </entry>
  <entry>
    <title>My First Open Source Contribution: How I Did It</title>
    <link href="https://jaspergabriel.dev/blog/my-first-open-source-contribution/" rel="alternate" type="text/html"/>
    <id>https://jaspergabriel.dev/blog/my-first-open-source-contribution/</id>
    <published>2023-08-12T00:00:00.000Z</published>
    <updated>2023-08-12T00:00:00.000Z</updated>
    <summary>A walkthrough of making your first open source contribution — finding the right project, following guidelines, and navigating PRs.</summary>
    <category term="tech"/>
    <category term="open-source"/>
    <content type="html">&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Contributing to open source can seem intimidating, especially to those who’ve never done open source before. I know I felt intimidated, thinking that open source is only for talented and senior developers.&lt;/p&gt;
&lt;p&gt;While that may be true for those who’ve made packages and tooling used by thousands (or even millions) of devs, it’s not true if you want to contribute to an existing open source project. I’ve realized that and I’m here to share how I made my first open source contribution.&lt;/p&gt;
&lt;p&gt;If that sounds interesting, then let’s continue!&lt;/p&gt;
&lt;h2 id=&quot;finding-an-open-source-project-to-contribute-to&quot;&gt;Finding an Open Source Project to Contribute to&lt;/h2&gt;
&lt;p&gt;There are a lot of open source projects out there, but where do you start?&lt;/p&gt;
&lt;p&gt;I narrowed it down using these three helpful prompts:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What specific area of tech am I interested in?&lt;/li&gt;
&lt;li&gt;What are my current skills, or skills I want to improve?&lt;/li&gt;
&lt;li&gt;What’s the tech stack of the open source project?&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;what-specific-area-of-tech-am-i-interested-in&quot;&gt;What specific area of tech am I interested in?&lt;/h3&gt;
&lt;p&gt;Looking for projects that fit your interests would help you get started. Your interests can be anywhere from frontend templates, developer tools, AI, smart contracts, cybersecurity, etc.&lt;/p&gt;
&lt;p&gt;I’m passionate in &lt;a href=&quot;https://ethereum.org/en/web3/&quot;&gt;Web3&lt;/a&gt;, so I tried to find Web3 projects that are open source. Web3 also encourages open source so it wasn’t hard looking for one.&lt;/p&gt;
&lt;h3 id=&quot;what-are-my-current-skills-or-skills-i-want-to-improve&quot;&gt;What are my current skills, or skills I want to improve?&lt;/h3&gt;
&lt;p&gt;As for skills, what are you currently good at? or want to gain more experience at?&lt;/p&gt;
&lt;p&gt;For me, I’m a backend developer that specializes in &lt;a href=&quot;https://nodejs.org/en&quot;&gt;Node.js&lt;/a&gt; and &lt;a href=&quot;https://www.typescriptlang.org/&quot;&gt;TypeScript&lt;/a&gt;. I’ve integrated Web3 libraries to Node.js apps, and I’ve also written technical documentations for previous projects.&lt;/p&gt;
&lt;p&gt;With that, I’d look for Node.js and TypeScript projects, where I’m already good at. I won’t look for a &lt;a href=&quot;https://go.dev/&quot;&gt;Go&lt;/a&gt; or &lt;a href=&quot;https://www.rust-lang.org/&quot;&gt;Rust&lt;/a&gt; project where I don’t have the necessary skills to contribute.&lt;/p&gt;
&lt;h3 id=&quot;whats-the-tech-stack-of-the-open-source-project&quot;&gt;What’s the tech stack of the open source project?&lt;/h3&gt;
&lt;p&gt;Combining my interests and skills, I’ve looked at a few open source projects and their tech stacks.&lt;/p&gt;
&lt;p&gt;Ethereum scaling solutions and &lt;strong&gt;zero knowledge (ZK)&lt;/strong&gt; are two areas I’m interested in Web3. I’ve read &lt;a href=&quot;https://en.wikipedia.org/wiki/Vitalik_Buterin&quot;&gt;Vitalik’s&lt;/a&gt; article on &lt;a href=&quot;https://vitalik.ca/general/2022/08/04/zkevm.html&quot;&gt;the different types of ZK-EVMs&lt;/a&gt;. I saw &lt;a href=&quot;https://taiko.xyz/&quot;&gt;Taiko&lt;/a&gt; as one of the current Type 1 ZK-EVMs in development.&lt;/p&gt;
&lt;p&gt;Reviewing Taiko’s &lt;a href=&quot;https://github.com/taikoxyz/taiko-mono&quot;&gt;monorepo&lt;/a&gt; tech stack, I saw that they use TypeScript. Their documentations use &lt;a href=&quot;https://mdxjs.com/&quot;&gt;MDX&lt;/a&gt;, which is an improved version of &lt;a href=&quot;https://www.markdownguide.org/&quot;&gt;markdown&lt;/a&gt;. I’ve used markdown before so contributing to their docs in MDX is doable.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Tech stack&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;327&quot; height=&quot;166&quot; src=&quot;https://jaspergabriel.dev/_astro/tech-stack.BXQcWZwU_Z1LYbfR.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/tech-stack.BXQcWZwU_Z1LYbfR.webp 327w&quot;&gt;&lt;/p&gt;
&lt;p&gt;With that, I started preparing to make my first open source contribution with Taiko.&lt;/p&gt;
&lt;h2 id=&quot;contributing-to-taiko&quot;&gt;Contributing to Taiko&lt;/h2&gt;
&lt;h3 id=&quot;reviewing-contributing-guidelines&quot;&gt;Reviewing contributing guidelines&lt;/h3&gt;
&lt;p&gt;Before anything else, I first looked at Taiko’s &lt;a href=&quot;https://github.com/taikoxyz/taiko-mono/blob/main/CONTRIBUTING.md&quot;&gt;CONTRIBUTING.md&lt;/a&gt; file to orient myself on their contributing guidelines:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;how to contribute&lt;/li&gt;
&lt;li&gt;coding standards&lt;/li&gt;
&lt;li&gt;documentation standards&lt;/li&gt;
&lt;li&gt;helpful tips&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=&quot;Contributing manual&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1636&quot; height=&quot;472&quot; src=&quot;https://jaspergabriel.dev/_astro/contributing-manual.DR-fO5xa_ZcrFPR.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/contributing-manual.DR-fO5xa_12RiRo.webp 680w, https://jaspergabriel.dev/_astro/contributing-manual.DR-fO5xa_Z1fXLMv.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;p&gt;Then I saw two ways to contribute in the &lt;strong&gt;Make a contribution&lt;/strong&gt; section:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Opening a new issue&lt;/li&gt;
&lt;li&gt;Working on an existing issue&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I’ve chosen to work on an existing issue.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Make a contribution&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1614&quot; height=&quot;420&quot; src=&quot;https://jaspergabriel.dev/_astro/make-a-contribution.B0CUtIb9_1KeF5P.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/make-a-contribution.B0CUtIb9_1ihloQ.webp 680w, https://jaspergabriel.dev/_astro/make-a-contribution.B0CUtIb9_2vkL1V.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;p&gt;For coding standards, I looked at the standards and conventions used in the project. I saw that they are using &lt;a href=&quot;https://www.conventionalcommits.org/en/v1.0.0/&quot;&gt;conventional commits&lt;/a&gt; for pull request titles and commits.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Coding standards&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;2064&quot; height=&quot;616&quot; src=&quot;https://jaspergabriel.dev/_astro/coding-standards.qIPTkxIq_1miu79.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/coding-standards.qIPTkxIq_LdNaQ.webp 680w, https://jaspergabriel.dev/_astro/coding-standards.qIPTkxIq_lyyqH.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;p&gt;Then for branch naming, I saw that there was no particular convention, so a short branch name describing what it is for should be enough.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Branches&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;2484&quot; height=&quot;1482&quot; src=&quot;https://jaspergabriel.dev/_astro/branches.LruGFFUE_Z2eUi5A.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/branches.LruGFFUE_ZhBc6u.webp 680w, https://jaspergabriel.dev/_astro/branches.LruGFFUE_fgvQi.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;h3 id=&quot;finding-an-existing-issue-to-work-on&quot;&gt;Finding an existing issue to work on&lt;/h3&gt;
&lt;p&gt;I’ve tried to look at some &lt;strong&gt;good first issues&lt;/strong&gt;, since these are usually not difficult issues, and are meant to help onboard first time contributors.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Good first issues&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1790&quot; height=&quot;1268&quot; src=&quot;https://jaspergabriel.dev/_astro/good-first-issues.D-Rejz9s_ZL2XeY.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/good-first-issues.D-Rejz9s_1WNwo8.webp 680w, https://jaspergabriel.dev/_astro/good-first-issues.D-Rejz9s_26cQ7V.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;p&gt;I ended up choosing the issue to &lt;strong&gt;improve their “Node running guide for setting RPC endpoints”&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Then I reviewed the issue, and looked at the description and comments. I also reviewed the &lt;a href=&quot;https://taiko.xyz/docs&quot;&gt;website&lt;/a&gt; where the docs are located.&lt;/p&gt;
&lt;p&gt;I made sure I understood what was needed.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Issue&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1890&quot; height=&quot;1134&quot; src=&quot;https://jaspergabriel.dev/_astro/issue.BLMbJ5G8_fI7je.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/issue.BLMbJ5G8_29CkRG.webp 680w, https://jaspergabriel.dev/_astro/issue.BLMbJ5G8_ZUKljB.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;h3 id=&quot;forking-cloning-and-working-on-the-changes&quot;&gt;Forking, cloning, and working on the changes&lt;/h3&gt;
&lt;p&gt;After reviewing the issue, I forked and cloned Taiko’s &lt;a href=&quot;https://github.com/taikoxyz/taiko-mono/tree/main&quot;&gt;monorepo&lt;/a&gt;. Then I started working on a proof of concept.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Fork&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;472&quot; height=&quot;150&quot; src=&quot;https://jaspergabriel.dev/_astro/fork.Dmy_N_bg_Z1GyKfo.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/fork.Dmy_N_bg_Z1GyKfo.webp 472w&quot;&gt;&lt;/p&gt;
&lt;p&gt;Locating the code that needs improvement was pretty straight-forward, since the project is structured as a monorepo. The &lt;strong&gt;website&lt;/strong&gt; package contains Taiko’s guides, so I worked on that.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Monorepo packages&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;562&quot; height=&quot;838&quot; src=&quot;https://jaspergabriel.dev/_astro/monorepo-packages.4CqrtMGg_Z5ik77.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/monorepo-packages.4CqrtMGg_Z5ik77.webp 562w&quot;&gt;&lt;/p&gt;
&lt;p&gt;After I was able to run my local setup and test the changes, I made some comments on the &lt;a href=&quot;https://github.com/taikoxyz/taiko-mono/issues/13986&quot;&gt;issue&lt;/a&gt; and asked for a review to verify if the changes would solve the issue.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Issue comment 1&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1820&quot; height=&quot;1240&quot; src=&quot;https://jaspergabriel.dev/_astro/issue-comment-1.CU4eyQau_BrGFm.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/issue-comment-1.CU4eyQau_Zz2scf.webp 680w, https://jaspergabriel.dev/_astro/issue-comment-1.CU4eyQau_1YHWkb.webp 1360w&quot;&gt;
&lt;img alt=&quot;Issue comment 2&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1822&quot; height=&quot;1318&quot; src=&quot;https://jaspergabriel.dev/_astro/issue-comment-2.6WqunRqH_ZbbNPd.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/issue-comment-2.6WqunRqH_ZsigDN.webp 680w, https://jaspergabriel.dev/_astro/issue-comment-2.6WqunRqH_Z1vvFSE.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;p&gt;After getting approval from Dave (d1onys1us), I proceeded to open a &lt;a href=&quot;https://github.com/taikoxyz/taiko-mono/pull/14029&quot;&gt;pull request&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Issue comment 3&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1826&quot; height=&quot;554&quot; src=&quot;https://jaspergabriel.dev/_astro/issue-comment-3.BL15sGAZ_11aNiC.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/issue-comment-3.BL15sGAZ_mKnpy.webp 680w, https://jaspergabriel.dev/_astro/issue-comment-3.BL15sGAZ_Z2lHDAL.webp 1360w&quot;&gt;
&lt;img alt=&quot;PR&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;2494&quot; height=&quot;856&quot; src=&quot;https://jaspergabriel.dev/_astro/pr.a8QZ4DPs_ZbOxwq.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/pr.a8QZ4DPs_eTKSb.webp 680w, https://jaspergabriel.dev/_astro/pr.a8QZ4DPs_1f2Neu.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;h3 id=&quot;going-through-the-pull-request-review-process&quot;&gt;Going through the pull request review process&lt;/h3&gt;
&lt;p&gt;The review process was interesting. While waiting for reviews, I’ve noticed that there were changes on the main branch that was merged to my feature branch.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Merged main&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1768&quot; height=&quot;120&quot; src=&quot;https://jaspergabriel.dev/_astro/merged-main.CXa9MA_X_Z1DxCuK.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/merged-main.CXa9MA_X_ZULHGK.webp 680w, https://jaspergabriel.dev/_astro/merged-main.CXa9MA_X_ZVUWvH.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;p&gt;Then I reviewed the changes, and it affected my changes, which didn’t make sense when combined with the changes from the main branch. So I decided to take the initiative to improve the section and propose the changes on my ongoing pull request review.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;PR comment&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1834&quot; height=&quot;1308&quot; src=&quot;https://jaspergabriel.dev/_astro/pr-comment.Gxtf9RDa_ZadStG.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/pr-comment.Gxtf9RDa_n2nIP.webp 680w, https://jaspergabriel.dev/_astro/pr-comment.Gxtf9RDa_Z2cYzkn.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;p&gt;The team liked the change, so I proceeded to commit the changes.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Reviewer comment 1&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1720&quot; height=&quot;200&quot; src=&quot;https://jaspergabriel.dev/_astro/reviewer-comment-1.OGCB46ii_1LFVSR.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/reviewer-comment-1.OGCB46ii_8rPgp.webp 680w, https://jaspergabriel.dev/_astro/reviewer-comment-1.OGCB46ii_Z3vWn6.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;p&gt;Then another reviewer commented that I had API keys exposed on the guide images, so I quickly fixed these to resolve the review comment.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Reviewer comment 2&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1838&quot; height=&quot;718&quot; src=&quot;https://jaspergabriel.dev/_astro/reviewer-comment-2.Q4sFWnrZ_Z2dub06.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/reviewer-comment-2.Q4sFWnrZ_2lQ9dJ.webp 680w, https://jaspergabriel.dev/_astro/reviewer-comment-2.Q4sFWnrZ_2b9GDE.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;p&gt;After all of that, my pull request was finally approved and merged!&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;PR approved 1&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1858&quot; height=&quot;236&quot; src=&quot;https://jaspergabriel.dev/_astro/pr-approved-1.CRSk36a3_1k4PzQ.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/pr-approved-1.CRSk36a3_Z18wBlp.webp 680w, https://jaspergabriel.dev/_astro/pr-approved-1.CRSk36a3_ZiqcUz.webp 1360w&quot;&gt;
&lt;img alt=&quot;PR approved 2 and merged&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1844&quot; height=&quot;400&quot; src=&quot;https://jaspergabriel.dev/_astro/pr-approved-2-merged.BAqj0dMo_ZeCE9k.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/pr-approved-2-merged.BAqj0dMo_2bhOlO.webp 680w, https://jaspergabriel.dev/_astro/pr-approved-2-merged.BAqj0dMo_ZveSJa.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;p&gt;Finally, I can say that I’ve contributed to open source! Got a cool &lt;a href=&quot;https://www.gitpoap.io/&quot;&gt;GitPOAP&lt;/a&gt; to prove it too! 🙂&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Git POAP&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1820&quot; height=&quot;968&quot; src=&quot;https://jaspergabriel.dev/_astro/git-poap.Ctt_Yl9I_1dMAqn.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/git-poap.Ctt_Yl9I_ZXUz9D.webp 680w, https://jaspergabriel.dev/_astro/git-poap.Ctt_Yl9I_2lvipa.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;h2 id=&quot;my-takeaways-conclusion&quot;&gt;My Takeaways (Conclusion)&lt;/h2&gt;
&lt;p&gt;Making my first open source contribution helped me realize what open source meant. The value of open source is in its contributors and their contributions, no matter how big or how small.&lt;/p&gt;
&lt;p&gt;Being an open source contributor can also be compared to a boy or girl scout, where the scouts leave the campsite cleaner than when they’ve found it. When a contributor encounters a bug in a feature or a typo in the documentation of an open source project, they can create an issue along with the fix, leaving the code cleaner than when they’ve first encountered it.&lt;/p&gt;
&lt;p&gt;I also want to thank the team at &lt;a href=&quot;https://taiko.xyz/&quot;&gt;Taiko&lt;/a&gt; for being welcoming, supportive, and making my first open source contribution a fun experience. Do check out the project if you’re interested!&lt;/p&gt;
&lt;p&gt;If you’ve missed it, here’s the &lt;a href=&quot;https://github.com/taikoxyz/taiko-mono/issues/13986&quot;&gt;issue&lt;/a&gt; that I’ve worked on at Taiko and the &lt;a href=&quot;https://github.com/taikoxyz/taiko-mono/pull/14029&quot;&gt;pull request&lt;/a&gt; that solves the issue.&lt;/p&gt;
&lt;p&gt;And here’s a summary of what I did:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Found an open source project:&lt;/li&gt;
&lt;/ol&gt;
&lt;ul&gt;
&lt;li&gt;What specific area of tech am I interested in?&lt;/li&gt;
&lt;li&gt;What are my current skills, or skills I want to improve?&lt;/li&gt;
&lt;li&gt;What’s the tech stack of the open source project?&lt;/li&gt;
&lt;/ul&gt;
&lt;ol start=&quot;2&quot;&gt;
&lt;li&gt;Reviewed contributing guidelines (CONTRIBUTING.md)&lt;/li&gt;
&lt;li&gt;Looked at good first issues&lt;/li&gt;
&lt;li&gt;Chose an existing issue, then reviewed the description and comments (if any)&lt;/li&gt;
&lt;li&gt;Forked and cloned the repo&lt;/li&gt;
&lt;li&gt;Set up my local environment&lt;/li&gt;
&lt;li&gt;Worked on and tested the changes&lt;/li&gt;
&lt;li&gt;Opened a pull request&lt;/li&gt;
&lt;li&gt;Went through the review process and resolved comments (if any)&lt;/li&gt;
&lt;li&gt;Pull request got merged!&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I won’t stop there. I’m excited on the journey ahead and looking forward to be a more consistent open source contributor. One contribution at a time.&lt;/p&gt;
&lt;p&gt;Thank you for reading and as always, I’m open to suggestions, feedback, and comments. Also feel free to contact me at my email (&lt;a href=&quot;mailto:jasper.d.gabriel@gmail.com&quot;&gt;jasper.d.gabriel@gmail.com&lt;/a&gt;), and I’m available on &lt;a href=&quot;https://x.com/jdg2896&quot;&gt;X&lt;/a&gt;, &lt;a href=&quot;https://www.linkedin.com/in/jaspergabriel/&quot;&gt;LinkedIn&lt;/a&gt;, and &lt;a href=&quot;https://github.com/jdg2896&quot;&gt;GitHub&lt;/a&gt;.&lt;/p&gt;</content>
  </entry>
  <entry>
    <title>6 Takeaways from Hashnode Bootcamp 2023 as a Beginner Writer</title>
    <link href="https://jaspergabriel.dev/blog/hashnode-bootcamp-2023-takeaways/" rel="alternate" type="text/html"/>
    <id>https://jaspergabriel.dev/blog/hashnode-bootcamp-2023-takeaways/</id>
    <published>2023-05-06T00:00:00.000Z</published>
    <updated>2023-05-06T00:00:00.000Z</updated>
    <summary>Key lessons on consistency, cross-platform posting, and building writing habits from Hashnode's 2023 technical writing bootcamp.</summary>
    <category term="personal"/>
    <category term="writing"/>
    <content type="html">&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Hashnode’s 2023 Bootcamp, &lt;strong&gt;“Master the Art of Technical Writing”&lt;/strong&gt; has recently concluded. I was fortunate enough that it happened shortly after writing my first article. Even though I was only able to attend the first day, the sessions from &lt;a href=&quot;https://theankurtyagi.com/&quot;&gt;Ankur Tyagi&lt;/a&gt; and &lt;a href=&quot;https://hashnode.com/@swapnakpanda&quot;&gt;Swapna Kumar Panda&lt;/a&gt; were more than enough to help me keep on writing.&lt;/p&gt;
&lt;p&gt;To give my background, my main motivations for starting to write are to build a personal brand and to improve my technical writing skills. By working in both of these aspects, I aim to improve as a software engineer, since whether we like it or not, writing is part of the job.&lt;/p&gt;
&lt;p&gt;So with that out of the way, here are my 6 takeaways!&lt;/p&gt;
&lt;h2 id=&quot;dont-force-yourself-to-write&quot;&gt;Don’t FORCE yourself to write&lt;/h2&gt;
&lt;p&gt;You might think that this is counterproductive to building writing habits, but the reality is, there are times when you don’t feel like doing something. The opposite is also true, where you have that sudden spark of motivation and ideas, and no one can seem to stop you from writing.&lt;/p&gt;
&lt;p&gt;With acknowledging that there are days when you feel more motivated to write and days when you don’t want to do anything, it makes sense to not force yourself to write.&lt;/p&gt;
&lt;p&gt;Whenever you do feel like writing though, take advantage of that moment and write as much as you can, and as long as you still feel like it. &lt;strong&gt;Be in the zone&lt;/strong&gt;, while it’s there!&lt;/p&gt;
&lt;h2 id=&quot;consistency-is-a-good-thing&quot;&gt;Consistency is a good thing!&lt;/h2&gt;
&lt;p&gt;Now, now, I just outlined earlier that you shouldn’t force yourself to write, but now you say that we need to be consistent?&lt;/p&gt;
&lt;p&gt;Hear me out first. While there are days of motivation and days of procrastination, being consistent in what you do helps.&lt;/p&gt;
&lt;p&gt;I’ve been reading &lt;a href=&quot;https://jamesclear.com/atomic-habits&quot;&gt;Atomic Habits&lt;/a&gt;, and it says there that if you want to build habits, consistency is the key. By consistency, I mean doing the habit even when you don’t feel like it. To achieve this, we make the &lt;strong&gt;habit as easy as possible&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;For example, just write a &lt;strong&gt;minimum of 1 sentence&lt;/strong&gt; for your article per day. So even if you don’t feel like writing that day, you can just write 1 sentence and call it a day. Maybe you feel like adding a few more sentences, that’s also fine.&lt;/p&gt;
&lt;p&gt;If you just want to build the habit of writing, you can also try &lt;strong&gt;journaling&lt;/strong&gt;. Just write about your day, what you’re thankful for, or any other thoughts that come to mind. Journal entries are meant only for your eyes, so making grammatical mistakes don’t matter. Just let your thoughts flow and translate that into writing.&lt;/p&gt;
&lt;p&gt;The point is that for each day that you decide to write (even a single sentence), you’re &lt;strong&gt;reinforcing your identity as a writer&lt;/strong&gt;. So when you feel more motivated, you can write to your heart’s content!&lt;/p&gt;
&lt;h2 id=&quot;dont-be-afraid-of-duplicating-ideas&quot;&gt;Don’t be afraid of duplicating ideas&lt;/h2&gt;
&lt;p&gt;Here I am, about to write a blog about Hashnode Bootcamp 2023, but when I searched with those keywords on Hashnode, there are already TONS of articles about it.&lt;/p&gt;
&lt;p&gt;So should I just write about something else? &lt;strong&gt;NO&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;The reality is, for most of the topics that you will think of, there’s already an article out there that someone else covered. But that shouldn’t stop you from writing on your chosen topic.&lt;/p&gt;
&lt;p&gt;Everyone has their own experiences, perspectives and opinions. Don’t be afraid to put your take to the article you’re gonna write. Sprinkle it with your own flavor and uniqueness. And remember why you’re writing that article in the first place.&lt;/p&gt;
&lt;p&gt;It’s also okay to get ideas from existing articles, then decide to write your version of that topic if you’re having a hard time finding ideas on what to write.&lt;/p&gt;
&lt;h2 id=&quot;there-are-no-shortcuts&quot;&gt;There are no shortcuts&lt;/h2&gt;
&lt;p&gt;As much as you want to be the next speaker for Hashnode 2024 and beyond, unfortunately, there are no secrets and shortcuts to get to where we want to be.&lt;/p&gt;
&lt;p&gt;You just have to keep on being consistent. You’re also probably gonna need to sacrifice something to make time for writing. Instead of binging a Netflix show every week, you can use that time for writing an article on how to stop binging Netflix every week.&lt;/p&gt;
&lt;p&gt;You get the point.&lt;/p&gt;
&lt;h2 id=&quot;leverage-different-platforms-by-cross-posting&quot;&gt;Leverage different platforms by cross-posting&lt;/h2&gt;
&lt;p&gt;Being someone who just started writing, no one would care or probably even know that I have published an article.&lt;/p&gt;
&lt;p&gt;It’s normal that you won’t have any readers at the start. You’d be lucky enough if someone read your article.&lt;/p&gt;
&lt;p&gt;So for beginner writers like myself, its helpful to leverage existing blogging platforms and do cross-posting, which basically means that you post your articles on different platforms.&lt;/p&gt;
&lt;p&gt;Here are some platforms where you can cross-post your Hashnode article:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://dev.to/&quot;&gt;Dev.to&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://medium.com/&quot;&gt;Medium&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And here’s a helpful &lt;a href=&quot;https://github.com/shahednasser/cross-post&quot;&gt;repo&lt;/a&gt; for cross-posting to those platforms using your terminal.&lt;/p&gt;
&lt;h2 id=&quot;create-documentation-for-applications&quot;&gt;Create documentation for applications&lt;/h2&gt;
&lt;p&gt;This part is more related to software engineering itself, but nonetheless a good reminder to document applications so that you can learn from mistakes and learn from it. It’s also a useful reference for whenever you’re onboarding a new developer or just want to figure out why a specific decision was made.&lt;/p&gt;
&lt;p&gt;For the types of technical documentation that software engineers usually write, here’s a rough list:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Guides/Manuals&lt;/li&gt;
&lt;li&gt;Architecture documents&lt;/li&gt;
&lt;li&gt;API/SDK documentation&lt;/li&gt;
&lt;li&gt;RCA documents&lt;/li&gt;
&lt;li&gt;Training materials&lt;/li&gt;
&lt;li&gt;White papers&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;To summarize, here are the 6 takeaways:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Don’t FORCE yourself to write&lt;/li&gt;
&lt;li&gt;Consistency is a good thing!&lt;/li&gt;
&lt;li&gt;Don’t be afraid of duplicating ideas&lt;/li&gt;
&lt;li&gt;There are no shortcuts&lt;/li&gt;
&lt;li&gt;Leverage different platforms by cross-posting&lt;/li&gt;
&lt;li&gt;Create documentation for applications&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you’ve actually read this and have made it this far, I hope you also had some takeaways here that can help in your technical writing journey. I mainly made this for myself so I can reflect on the bootcamp and on my writing in general.&lt;/p&gt;
&lt;p&gt;If you have any feedback or suggestions, I’d love to hear them.&lt;/p&gt;</content>
  </entry>
  <entry>
    <title>Step-by-Step Guide: Setting Up CI/CD for AWS SAM Applications with GitHub Actions</title>
    <link href="https://jaspergabriel.dev/blog/ci-cd-aws-sam-github-actions/" rel="alternate" type="text/html"/>
    <id>https://jaspergabriel.dev/blog/ci-cd-aws-sam-github-actions/</id>
    <published>2023-04-28T00:00:00.000Z</published>
    <updated>2023-04-28T00:00:00.000Z</updated>
    <summary>How to set up GitHub Actions CI/CD for AWS SAM serverless apps with IAM roles and automated multi-environment deployments.</summary>
    <category term="tech"/>
    <category term="aws"/>
    <category term="devops"/>
    <content type="html">&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Over the years, the adoption of serverless applications has increased significantly. This has enabled startups to iterate more quickly by deploying proof of concepts and code without having to handle much of the cloud infrastructure. Additionally, serverless applications can help reduce costs because you only pay for the resources you use, rather than paying a fixed cost for running cloud resources 24/7.&lt;/p&gt;
&lt;p&gt;While serverless applications have enabled startups to move fast, in order to implement new features and changes with confidence, another essential component is &lt;a href=&quot;https://www.redhat.com/en/topics/devops/what-is-ci-cd&quot;&gt;CI/CD&lt;/a&gt; (continuous integration/continuous delivery). This enables development teams to automate certain parts of the deployment process and implement safeguards such as mandating that changes pass unit tests before they can be deployed to the cloud.&lt;/p&gt;
&lt;h2 id=&quot;before-we-start&quot;&gt;Before We Start…&lt;/h2&gt;
&lt;p&gt;In this tutorial, we’ll be using &lt;a href=&quot;https://aws.amazon.com/serverless/sam/&quot;&gt;AWS SAM&lt;/a&gt;, which is AWS’s open-source framework for building serverless applications for our sample application.&lt;/p&gt;
&lt;p&gt;For the CI/CD tool, we’ll be using &lt;a href=&quot;https://github.com/features/actions&quot;&gt;GitHub Actions&lt;/a&gt;, which makes setting up our CI/CD pipeline simpler especially if we’re already using GitHub to host our repositories.&lt;/p&gt;
&lt;p&gt;This tutorial will also use my sample AWS SAM application using Node.js and TypeScript which I’ll share. It uses git submodules as Lambda layers, and is configured to deploy to 3 environments (develop, staging, production).&lt;/p&gt;
&lt;p&gt;So without further ado, let’s get right on it!&lt;/p&gt;
&lt;h2 id=&quot;setting-up-our-aws-sam-application&quot;&gt;Setting up our AWS SAM Application.&lt;/h2&gt;
&lt;p&gt;Here’s the sample &lt;a href=&quot;https://github.com/jdg2896/aws-sam-template-node-ts&quot;&gt;AWS SAM Application&lt;/a&gt; using Node.js and TypeScript for the purposes of demonstration.&lt;/p&gt;
&lt;p&gt;Feel free to clone/fork the repo and set it up for yourself. Setup instructions are in the README file.&lt;/p&gt;
&lt;p&gt;Otherwise you can also review the source code, which also contains the GitHub Actions workflow YAML file.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; If you already have your own AWS SAM application written in JavaScript/TypeScript, or you’re using another language such as Python, feel free to skip this part and proceed to the GitHub Actions setup.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id=&quot;setting-up-github-actions-for-aws-sam&quot;&gt;Setting up GitHub Actions for AWS SAM&lt;/h2&gt;
&lt;h3 id=&quot;step-1-configuring-aws-iam-role-for-github-actions&quot;&gt;Step 1: Configuring AWS IAM Role for GitHub Actions&lt;/h3&gt;
&lt;p&gt;Before we can configure GitHub Actions to our repo, first we will need an AWS IAM Role to provide the necessary permissions needed for GitHub Actions to successfully deploy our AWS SAM application.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; Although we can also use an IAM User for this, Oleksii Bebych from Automat-IT has a really nice &lt;a href=&quot;https://www.automat-it.com/post/using-github-actions-with-aws-iam-roles&quot;&gt;article about using GitHub Actions with AWS IAM roles&lt;/a&gt; suggesting that we should use IAM roles for applications and services as outlined in AWS’s security best practices in IAM.&lt;/p&gt;
&lt;p&gt;While making this blog post, I also saw a recent &lt;a href=&quot;https://aws.amazon.com/blogs/security/use-iam-roles-to-connect-github-actions-to-actions-in-aws/&quot;&gt;article on using IAM roles for GitHub Actions&lt;/a&gt; made by David Rowe from AWS.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4 id=&quot;add-aws-iam-identity-provider&quot;&gt;Add AWS IAM Identity Provider&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;First in the AWS console, go to &lt;strong&gt;IAM&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;AWS console IAM&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;942&quot; height=&quot;541&quot; src=&quot;https://jaspergabriel.dev/_astro/aws-console-iam.CsHQcHmG_Z2uIbIB.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/aws-console-iam.CsHQcHmG_ZTOKPk.webp 680w, https://jaspergabriel.dev/_astro/aws-console-iam.CsHQcHmG_Z2uIbIB.webp 942w&quot;&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Next, go to &lt;strong&gt;Identity providers&lt;/strong&gt;, then click &lt;strong&gt;Add provider&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;AWS console IAM add identity provider&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1435&quot; height=&quot;327&quot; src=&quot;https://jaspergabriel.dev/_astro/aws-console-iam-add-identity-provider.hlVff5Ir_160m1L.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/aws-console-iam-add-identity-provider.hlVff5Ir_rJlU4.webp 680w, https://jaspergabriel.dev/_astro/aws-console-iam-add-identity-provider.hlVff5Ir_CPHao.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Then let’s configure the identity provider. Use the following configs below.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;For the &lt;strong&gt;Provider type&lt;/strong&gt;, choose &lt;strong&gt;OpenID Connect&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Then for the &lt;strong&gt;Provider URL&lt;/strong&gt;, use &lt;strong&gt;&lt;a href=&quot;https://token.actions.githubusercontent.com/&quot;&gt;https://token.actions.githubusercontent.com&lt;/a&gt;&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Lastly, for the &lt;strong&gt;Audience&lt;/strong&gt;, use &lt;strong&gt;&lt;a href=&quot;http://sts.amazonaws.com/&quot;&gt;sts.amazonaws.com&lt;/a&gt;&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=&quot;AWS console IAM configure identity provider&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;788&quot; height=&quot;567&quot; src=&quot;https://jaspergabriel.dev/_astro/aws-console-iam-configure-identity-provider.C4IYas8X_ZToJOh.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/aws-console-iam-configure-identity-provider.C4IYas8X_6SabY.webp 680w, https://jaspergabriel.dev/_astro/aws-console-iam-configure-identity-provider.C4IYas8X_ZToJOh.webp 788w&quot;&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Optionally, we can also click &lt;strong&gt;Get Thumbprint&lt;/strong&gt; besides the &lt;strong&gt;Provider URL&lt;/strong&gt; field to verify the certificate of the OIDC provider.&lt;/p&gt;
&lt;p&gt;Then once you’re done reviewing, click &lt;strong&gt;Add provider&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;AWS console IAM save identity provider&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;667&quot; height=&quot;620&quot; src=&quot;https://jaspergabriel.dev/_astro/aws-console-iam-save-identity-provider.DMJcruH9_ZOpLTu.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/aws-console-iam-save-identity-provider.DMJcruH9_ZOpLTu.webp 667w&quot;&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&quot;add-aws-iam-role-for-github-actions&quot;&gt;Add AWS IAM Role for GitHub Actions&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Go to &lt;strong&gt;Roles&lt;/strong&gt; while still in the IAM page in AWS console, then click &lt;strong&gt;Create role&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;AWS console IAM create role&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1427&quot; height=&quot;331&quot; src=&quot;https://jaspergabriel.dev/_astro/aws-console-iam-create-role.Cx5LCf7V_ZLkWxO.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/aws-console-iam-create-role.Cx5LCf7V_1sMUzb.webp 680w, https://jaspergabriel.dev/_astro/aws-console-iam-create-role.Cx5LCf7V_1vFdia.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Then, choose &lt;strong&gt;Web Identity&lt;/strong&gt; for the &lt;strong&gt;Trusted entity type&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Choose the &lt;strong&gt;Identity provider&lt;/strong&gt; and &lt;strong&gt;Audience&lt;/strong&gt; we created earlier, which is &lt;strong&gt;&lt;a href=&quot;http://token.actions.githubusercontent.com/&quot;&gt;token.actions.githubusercontent.com&lt;/a&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;a href=&quot;http://sts.amazonaws.com/&quot;&gt;sts.amazonaws.com&lt;/a&gt;&lt;/strong&gt; respectively.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;AWS console IAM role select trusted entity type&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1396&quot; height=&quot;518&quot; src=&quot;https://jaspergabriel.dev/_astro/aws-console-iam-role-select-trusted-entity-type.Db-7_KcQ_Z1r0ysz.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/aws-console-iam-role-select-trusted-entity-type.Db-7_KcQ_ZPnVSQ.webp 680w, https://jaspergabriel.dev/_astro/aws-console-iam-role-select-trusted-entity-type.Db-7_KcQ_2rPOHx.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Then, let’s choose the permissions needed to deploy our AWS SAM application with GitHub Actions.&lt;/p&gt;
&lt;p&gt;If you’re using my AWS SAM sample project, then these are the permissions needed.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;AWSCloudFormationFullAccess&lt;/li&gt;
&lt;li&gt;IAMFullAccess&lt;/li&gt;
&lt;li&gt;AmazonS3FullAccess&lt;/li&gt;
&lt;li&gt;AWSLambda_FullAccess&lt;/li&gt;
&lt;li&gt;AmazonAPIGatewayAdministrator&lt;/li&gt;
&lt;li&gt;AmazonDynamoDBFullAccess&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; Your permissions may vary depending on the resources your AWS SAM application uses. For example if you’re also using SQS and SNS, then you’ll need to add permissions for those, vice versa.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Then click &lt;strong&gt;Next&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;AWS console IAM add role permissions&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1407&quot; height=&quot;467&quot; src=&quot;https://jaspergabriel.dev/_astro/aws-console-iam-add-role-permissions.C7kBC_jl_dQEyY.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/aws-console-iam-add-role-permissions.C7kBC_jl_2CgaA.webp 680w, https://jaspergabriel.dev/_astro/aws-console-iam-add-role-permissions.C7kBC_jl_1TWq84.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Then add a &lt;strong&gt;Role name&lt;/strong&gt; and &lt;strong&gt;Description&lt;/strong&gt;. The changes should look similar below.&lt;/p&gt;
&lt;p&gt;Once you’re done reviewing the changes, click &lt;strong&gt;Create role&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;AWS console IAM role details&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1386&quot; height=&quot;611&quot; src=&quot;https://jaspergabriel.dev/_astro/aws-console-iam-role-details.BIOwU0ff_2ptio4.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/aws-console-iam-role-details.BIOwU0ff_W6FdX.webp 680w, https://jaspergabriel.dev/_astro/aws-console-iam-role-details.BIOwU0ff_JBPAV.webp 1360w&quot;&gt;&lt;img alt=&quot;AWS console IAM role review permissions&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1184&quot; height=&quot;640&quot; src=&quot;https://jaspergabriel.dev/_astro/aws-console-iam-role-review-permissions.BD5bhiZ5_Z2opfdd.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/aws-console-iam-role-review-permissions.BD5bhiZ5_KrlQN.webp 680w, https://jaspergabriel.dev/_astro/aws-console-iam-role-review-permissions.BD5bhiZ5_Z2opfdd.webp 1184w&quot;&gt;&lt;/p&gt;
&lt;p&gt;Now we’ve created our IAM role for GitHub actions, but we’re not quite done yet. We’ll also need to configure the trust policy in our newly created IAM role.&lt;/p&gt;
&lt;p&gt;We will be updating our policy to restrict our IAM role so that it will only allow deployments triggered from our own GitHub repository and branches.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&quot;configure-aws-iam-role-trust-policy&quot;&gt;Configure AWS IAM Role Trust Policy&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;First, go to &lt;strong&gt;Roles&lt;/strong&gt;, then select our newly created IAM role &lt;strong&gt;GitHubActionsRole&lt;/strong&gt; (or whatever role name you chose).&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;AWS console IAM role select&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1416&quot; height=&quot;324&quot; src=&quot;https://jaspergabriel.dev/_astro/aws-console-iam-role-select.66FvV_RV_ZdHA8D.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/aws-console-iam-role-select.66FvV_RV_2frYL9.webp 680w, https://jaspergabriel.dev/_astro/aws-console-iam-role-select.66FvV_RV_Z1uPMOJ.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Next, go to &lt;strong&gt;Trust relationships&lt;/strong&gt;, then click &lt;strong&gt;Edit trust policy&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;AWS console IAM role edit trust policy&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;2058&quot; height=&quot;802&quot; src=&quot;https://jaspergabriel.dev/_astro/aws-console-iam-role-edit-trust-policy.CtcVsH2v_1TnTK3.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/aws-console-iam-role-edit-trust-policy.CtcVsH2v_1YrLDB.webp 680w, https://jaspergabriel.dev/_astro/aws-console-iam-role-edit-trust-policy.CtcVsH2v_2h3G4G.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Now your trust policy should look something like this.&lt;/p&gt;
&lt;div class=&quot;code-block&quot;&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light-default github-dark-default&quot; data-language=&quot;json&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  &quot;Version&quot;&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;&quot;2012-10-17&quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  &quot;Statement&quot;&lt;/span&gt;&lt;span&gt;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      &quot;Effect&quot;&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;&quot;Allow&quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      &quot;Action&quot;&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;&quot;sts:AssumeRoleWithWebIdentity&quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      &quot;Principal&quot;&lt;/span&gt;&lt;span&gt;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;        &quot;Federated&quot;&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;&quot;arn:aws:iam::499202726088:oidc-provider/token.actions.githubusercontent.com&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      &quot;Condition&quot;&lt;/span&gt;&lt;span&gt;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;        &quot;StringEquals&quot;&lt;/span&gt;&lt;span&gt;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;          &quot;token.actions.githubusercontent.com:aud&quot;&lt;/span&gt;&lt;span&gt;: [&lt;/span&gt;&lt;span&gt;&quot;sts.amazonaws.com&quot;&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;        }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Let’s update the trust policy with the following. Use &lt;strong&gt;your own&lt;/strong&gt; IAM role ARN and GitHub repository/branches.&lt;/p&gt;
&lt;div class=&quot;code-block&quot;&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light-default github-dark-default&quot; data-language=&quot;json&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  &quot;Version&quot;&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;&quot;2012-10-17&quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  &quot;Statement&quot;&lt;/span&gt;&lt;span&gt;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      &quot;Effect&quot;&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;&quot;Allow&quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      &quot;Principal&quot;&lt;/span&gt;&lt;span&gt;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;        &quot;Federated&quot;&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;&quot;arn:aws:iam::499202726088:oidc-provider/token.actions.githubusercontent.com&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      &quot;Action&quot;&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;&quot;sts:AssumeRoleWithWebIdentity&quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      &quot;Condition&quot;&lt;/span&gt;&lt;span&gt;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;        &quot;StringEquals&quot;&lt;/span&gt;&lt;span&gt;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;          &quot;token.actions.githubusercontent.com:aud&quot;&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;&quot;sts.amazonaws.com&quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;          &quot;token.actions.githubusercontent.com:sub&quot;&lt;/span&gt;&lt;span&gt;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;            &quot;repo:jdg2896/aws-sam-template-node-ts:ref:refs/heads/develop&quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;            &quot;repo:jdg2896/aws-sam-template-node-ts:ref:refs/heads/staging&quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;            &quot;repo:jdg2896/aws-sam-template-node-ts:ref:refs/heads/production&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;          ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;        }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;After making the changes, click &lt;strong&gt;Update policy&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;AWS console IAM role update trust policy&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;938&quot; height=&quot;626&quot; src=&quot;https://jaspergabriel.dev/_astro/aws-console-iam-role-update-trust-policy.QbAN6izm_Z2klqYi.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/aws-console-iam-role-update-trust-policy.QbAN6izm_1WQIs7.webp 680w, https://jaspergabriel.dev/_astro/aws-console-iam-role-update-trust-policy.QbAN6izm_Z2klqYi.webp 938w&quot;&gt;&lt;/p&gt;
&lt;p&gt;This policy change ensures that our IAM role can only be triggered from repositories and branches that we specify.&lt;/p&gt;
&lt;p&gt;Now we’ve configured our IAM role’s trust policy, we will now need the IAM role ARN for configuring GitHub actions next, so let’s copy it now.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Copy GitHub Actions IAM role ARN&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;908&quot; height=&quot;300&quot; src=&quot;https://jaspergabriel.dev/_astro/copy-github-actions-iam-role-arn.Bl00ppts_ZE4D5i.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/copy-github-actions-iam-role-arn.Bl00ppts_ZAP37C.webp 680w, https://jaspergabriel.dev/_astro/copy-github-actions-iam-role-arn.Bl00ppts_ZE4D5i.webp 908w&quot;&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;step-2-adding-a-github-workflow-yaml-file&quot;&gt;Step 2: Adding a GitHub Workflow YAML file&lt;/h3&gt;
&lt;p&gt;In order to configure GitHub Actions in our repository, first we will need to create a &lt;a href=&quot;https://docs.github.com/en/actions/using-workflows/about-workflows&quot;&gt;workflow&lt;/a&gt; by adding a YAML file in our source code.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;In your GitHub repository, click &lt;strong&gt;Actions&lt;/strong&gt;, then click &lt;strong&gt;setup a workflow yourself&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;GitHub Actions setup workflow&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1212&quot; height=&quot;612&quot; src=&quot;https://jaspergabriel.dev/_astro/github-actions-setup-workflow.DfG_RM-V_1fmz3Y.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/github-actions-setup-workflow.DfG_RM-V_2rJoPY.webp 680w, https://jaspergabriel.dev/_astro/github-actions-setup-workflow.DfG_RM-V_1fmz3Y.webp 1212w&quot;&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Copy the GitHub Actions workflow YAML file contents, like in the example below. Then update with the IAM role ARN we copied earlier.&lt;/p&gt;
&lt;div class=&quot;code-block&quot;&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light-default github-dark-default&quot; data-language=&quot;yaml&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;on&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  push&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    branches&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      - &lt;/span&gt;&lt;span&gt;develop&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      - &lt;/span&gt;&lt;span&gt;staging&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      - &lt;/span&gt;&lt;span&gt;production&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;env&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  BRANCH_NAME&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;${{ github.head_ref || github.ref_name }}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  AWS_REGION&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;ap-southeast-1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;permissions&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  id-token&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;write&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  contents&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;read&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;jobs&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  build-deploy&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    runs-on&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;ubuntu-latest&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    steps&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      # Checkout with submodules&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      - &lt;/span&gt;&lt;span&gt;uses&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;actions/checkout@v3&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;        with&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;          submodules&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;recursive&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      # Setup Node.js, feel free to modify with your specific language&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      - &lt;/span&gt;&lt;span&gt;uses&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;actions/setup-node@v3&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      # Configure AWS SAM CLI and AWS Credentials&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      - &lt;/span&gt;&lt;span&gt;uses&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;aws-actions/setup-sam@v2&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      - &lt;/span&gt;&lt;span&gt;uses&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;aws-actions/configure-aws-credentials@v2&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;        with&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;          role-to-assume&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;arn:aws:iam::499202726088:role/GitHubActionsRole&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;          role-session-name&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;aws-sam-template-node-ts-github-actions&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;          aws-region&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;${{ env.AWS_REGION }}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      # sam build&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      - &lt;/span&gt;&lt;span&gt;run&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;sam build&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      # Run unit tests&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      - &lt;/span&gt;&lt;span&gt;name&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;Install npm modules&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;        run&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;npm install&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      - &lt;/span&gt;&lt;span&gt;name&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;Run tests&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;        run&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;yarn test&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      # sam deploy&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      - &lt;/span&gt;&lt;span&gt;run&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;sam deploy --no-fail-on-empty-changeset --stack-name stack-name-${{ env.BRANCH_NAME }} --config-env ${{ env.BRANCH_NAME }} --parameter-overrides Environment=${{ env.BRANCH_NAME }}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; In this example file, I’ve configured GitHub actions to trigger on 3 specific branches emulating a &lt;a href=&quot;https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow&quot;&gt;Gitflow workflow&lt;/a&gt;:&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class=&quot;code-block&quot;&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light-default github-dark-default&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;   - develop&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;   - staging&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;   - production&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;blockquote&gt;
&lt;p&gt;Feel free to update the following to fit your use case:&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class=&quot;code-block&quot;&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light-default github-dark-default&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    - Branches that can trigger GitHub actions&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    - Whether you're using git submodules or not&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    - Unit test commands&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    - SAM CLI commands (`sam deploy`, etc.)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;blockquote&gt;
&lt;/blockquote&gt;
&lt;p&gt;Then click &lt;strong&gt;Start commit&lt;/strong&gt; and commit the changes.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;GitHub Actions commit workflow YAML file&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1477&quot; height=&quot;626&quot; src=&quot;https://jaspergabriel.dev/_astro/github-actions-commit-workflow-yaml-file.DqI958qu_290CYO.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/github-actions-commit-workflow-yaml-file.DqI958qu_Z26P1Ew.webp 680w, https://jaspergabriel.dev/_astro/github-actions-commit-workflow-yaml-file.DqI958qu_9BmEW.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;testing-github-actions&quot;&gt;Testing GitHub Actions&lt;/h3&gt;
&lt;p&gt;Now that we’ve finally configured GitHub Actions to deploy to AWS every time we push changes, we can test it out by pushing any changes to the repository and branch we configured earlier.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Test GitHub Actions&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 712px) 680px, calc(100vw - 32px)&quot; width=&quot;1642&quot; height=&quot;561&quot; src=&quot;https://jaspergabriel.dev/_astro/test-github-actions.C6dBU4_3_ZAIsOB.webp&quot; srcset=&quot;https://jaspergabriel.dev/_astro/test-github-actions.C6dBU4_3_Z1LxREL.webp 680w, https://jaspergabriel.dev/_astro/test-github-actions.C6dBU4_3_2wXmAM.webp 1360w&quot;&gt;&lt;/p&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;To summarize what we did to setup GitHub Actions for our AWS SAM application, we created and configured the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;IAM Identity Provider for GitHub Actions&lt;/li&gt;
&lt;li&gt;IAM role for GitHub Actions&lt;/li&gt;
&lt;li&gt;IAM role trust policy allow specific repo/branch&lt;/li&gt;
&lt;li&gt;GitHub Actions Workflow file&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you’ve made it this far, hopefully you were able to follow along and have now learned to setup GitHub Actions as our CI/CD tool for our AWS SAM applications.&lt;/p&gt;
&lt;p&gt;There are also other options for other CI/CD tools, most notably AWS CodePipeline + CodeBuild. Paul Swail made a really nice article on &lt;a href=&quot;https://serverlessfirst.com/switch-codepipeline-to-github-actions/&quot;&gt;why he switched from AWS CodePipeline to GitHub Actions&lt;/a&gt;, that’s why I leaned towards learning GitHub Actions first.&lt;/p&gt;
&lt;p&gt;As this is my first time writing a blog post, there’s probably some rough edges here and there. If you have any feedback, I’d love to hear it.&lt;/p&gt;
&lt;p&gt;Thank you for reading and cheers!&lt;/p&gt;
&lt;h2 id=&quot;references&quot;&gt;References&lt;/h2&gt;
&lt;p&gt;If you want to learn more, here are some resources that helped me in learning and setting up GitHub Actions for AWS SAM applications.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/blogs/compute/using-github-actions-to-deploy-serverless-applications/&quot;&gt;Using GitHub Actions to deploy serverless applications&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.automat-it.com/post/using-github-actions-with-aws-iam-roles&quot;&gt;Using GitHub Actions with AWS IAM roles&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/blogs/security/use-iam-roles-to-connect-github-actions-to-actions-in-aws/&quot;&gt;Use IAM roles to connect GitHub Actions to actions in AWS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/actions&quot;&gt;GitHub Actions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/actions&quot;&gt;GitHub Actions Repositories&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/aws-actions&quot;&gt;AWS for GitHub Actions Repositories&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry>
</feed>
