How We've Built Our CloudWatch Book Video Platform ๐ŸŽฅ


โ€‹

Hey Reader ๐Ÿ‘‹๐Ÿฝ

In this post, we want to guide you through our complete setup for our custom video platform.

This starts from the purchase to actually accessing our custom build video-access platform.

We'll explain why we decided against a third-party solution for our video section and built something on our own with SST, Next.js, Lambda, and Vimeo.

Preface

We launched our first educational book about AWS, AWS Fundamentals ๐Ÿ“™, at the start of 2023. While it includes many visuals, it neither comes with deployable code nor hands-on video tutorials.

For our second book, The CloudWatch Book ๐Ÿ“•, we aimed higher. The book comes with hands-on application that can be deployed on AWS. Along this, there are videos where we explore CloudWatch features ๐ŸŽฅ.

For delivering videos, we looked for the most convenient way for us and the users.

Why Custom & Serverless?

We opted for a custom solution to avoid restrictions and maintain full control, integrating seamlessly with ๐Ÿ“จ ConvertKit and LemonSqueezy. A Serverless approach was ideal for us - we know the services very well and Lambda comes with basically zero operations and low-to-zero costs (in our case).

Overview of Technologies

We utilized a modern tech stack:

  • SST: A framework for building serverless applications on AWS, simplifying deployments and management immensely. Deploying a Lambda function with an API Gateway? Not more than a few lines of code. SST will take care of the heavy lifting.
  • Next.js: A React framework for fast, user-friendly web applications, natively supported by SST. Also enables you to run code on the server side. This means you can access AWS resources without creating APIs. Next.js will take care of this and SST will deploy the server-side code to Lambda@Edge functions.

Architecture Overview

Our architecture includes:

  1. Customer Purchase Flow: Users buy the package on cloudwatchbook.com. A successful payment triggers a webhook-based Lambda function to generate a personalized access token stored in DynamoDB and ConvertKit.
  2. Personalized Video Access Link Notification: The token links to the userโ€™s purchase, allowing unique access to video content. An automated email is sent with the access link.
  3. Video Platform Access and Content Delivery: Users access the platform with a validated token, loading embedded Vimeo links.

Weโ€™ve managed to keep AWS costs close to zero, only paying for Vimeo. ๐Ÿ™ƒ

Building the Platform

Let's dive into these three main components that made up everything from purchasing the book to accessing our videos.

Customer Purchase Flow

After the payment completes in LemonSqueezy, we'll receive an order_created webhook to our Lambda function.

โ€‹

This function will take care of storing the necessary information both on ConvertKit side, as well as in our own DynamoDB table.

We'll generate an access token which can be later used to access the video section.

Personalized Video Access Link Notification

We send an email with the personalized link using ConvertKitโ€™s Visual Automation based on custom fields and a uniquely assigned tag in the previous step.

The subscriber will automatically join the flow and receive the email with the link that contains the personalized access token.

Video Platform Access and Content Delivery

Users access the platform with their link and we'll validate their token via a Lambda function and the data in our DynamoDB table, which will finally retrieve the video links from Vimeo.

What we'll also do: we track views and follow up with users who havenโ€™t accessed content within 30 days. This way, we can get feedback if there's an issue with the platform or if the content is not as expected.

Where to Go from Here

Weโ€™re thrilled with our custom platform, which allows for future enhancements like:

  • Motivational animations for video completions.
  • Custom โ€œcompletion badgesโ€ for users.
  • Feedback forms for user issues.

... and much more.

Conclusion

That's already it! ๐ŸŽ‰

We shared how we built a serverless video platform for our CloudWatch Book using SST, Next.js, ConvertKit, LemonSqueezy, and Vimeo. This custom solution provides control, flexibility, and cost-effectiveness.

We encourage you to explore building your own serverless platform.

Even though we still reside in a "buy before build" mindset, many custom setups do make sense to connect the dots between multiple platforms!

P.S.: We're on the AWS Community Days in Romania! ๐Ÿ‡ท๐Ÿ‡ด
Sandro will be on stage to give a talk about Hashnode's journey with GraphQL ๐Ÿ—ฃ๏ธ
If you're also there in person, please come and talk to us! ๐Ÿ’›

โ€‹

โ€‹

โ€‹Tobias Schmidt & Sandro Volpicella from AWS Fundamentalsโ€‹
โ€‹
Cloud Engineers โ€ข Fullstack Developers โ€ข Educators

You're receiving this email because you're part of our awesome community!

If you'd prefer not to receive updates, you can easily unsubscribe anytime by clicking here: Unsubscribe

โ€‹

Our address: Dr.-Otto-BรถรŸner-Weg 7a, Ottobrunn, Bavaria 85521

AWS for the Real World

Join our community of over 8,800 readers delving into AWS. We highlight real-world best practices through easy-to-understand visualizations and one-pagers. Expect a fresh newsletter edition every two weeks.

Read more from AWS for the Real World

โŒ› Reading time: 13 minutes ๐ŸŽ“ Main Learning: How to Run Apps on Fargate via ECS ๐Ÿ‘พ GitHub Repository โœ๏ธ Read the Full Post Online ๐Ÿ”— Hey Reader ๐Ÿ‘‹๐Ÿฝ When building applications on AWS, we need to run our code somewhere: a computation service. There are a lot of well-known and mature computation services on AWS. Youโ€™ll often find Lambda as the primary choice, as itโ€™s where you donโ€™t need to manage any infrastructure. You only need to bring your code - itโ€™s Serverless โšก๏ธ. However, more options can be...

โŒ› Reading time: 10 minutes ๐ŸŽ“ Main Learning: Running Postgres on Aurora DSQL with Drizzle ๐Ÿ‘พ GitHub Repository โœ๏ธ Read the Full Post Online ๐Ÿ”— Hey Reader ๐Ÿ‘‹๐Ÿฝ With re:Invent 2024, AWS finally came up with an answer to what many people (including us) asked for years: "What if there were something like DynamoDB but for SQL?" With Amazon Aurora DSQL, this is finally possible. Itโ€™s not just a โ€œscales-to-zeroโ€ solution like Aurora Serverless V2. It is a true distributed, serverless, pay-per-use...

โŒ› Reading time: 12 minutes ๐ŸŽ“ Main Learning: CloudWatch Launches re:invent 2024 โœ๏ธ Read the Full Post Online ๐Ÿ”— Hey Reader ๐Ÿ‘‹๐Ÿฝ re:invent happened already two weeks ago and there were some amazing launches ๐Ÿ‘€ CloudWatch got a lot of love at that re:invent. This is why we are showing you our top CloudWatch launches for this year. We've worked through all of them, tried to get them working with our example application of the CloudWatch Book, and are now busy updating the book โœ๐Ÿฝ. Let's dive into...