In this post, we want to guide you through our complete setup for our custom video platform.
Our CloudWatch Book's Video Section
This starts from the purchase to actually accessing our custom build video-access platform.
Overview about our CloudWatch Book Landing Page & Video Platform Architecture
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:
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.
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.
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.
Purchase Flow
β
This function will take care of storing the necessary information both on ConvertKit side, as well as in our own DynamoDB table.
Storing Customer Data received from LemonSqueezy
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.
Sending out the Links to access our Platform
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.
Actually accessing our Platform
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! π
AWS FOR THE REAL WORLD β±οΈ Reading time: 8 minutes π― Main Learning: 5 practical techniques to cut Lambda costs (memory, timeouts, ARM, batching, caching) π Blog Post π¬ Watch on YouTube Hey Reader ππ½ Lambda bills can sneak up on you. One function is often not expensive. But then you scale it up and π₯ it costs you $5,000. Sounds familiar? We had this exact problem with our Shopify fraud detection app. Orders coming in via EventBridge, each triggering its own Lambda.And the bill was $150/month...
AWS FOR THE REAL WORLD β±οΈ Reading time: 8 minutes π― Main Learning: Generate AWS architecture diagrams using AI with Kiro and MCP servers - skip the hours of dragging boxes in Lucidchart. π Blog Post π¬ Watch on YouTube Hey Reader ππ½ Big news: We launched our YouTube channel! π¬ We've published 7 videos so far and are almost at 800 subscribers. Our goal is to keep a weekly rhythm, so expect fresh content every week. If you haven't subscribed yet, here's the link. No exciting AWS news this week....
AWS FOR THE REAL WORLD β±οΈ Reading time: 10 minutes π― Main Learning: Building and testing Lambda@Edge functions with CloudFront is complicated, as deployments can take up to 10 minutes. With LocalStack, you can build, test, and debug your Lambda@Edge functions locally! π Blog Post π» GitHub Repository π¬ Watch on YouTube Hey Reader ππ½ Happy new year! We hope you had a great time with your families and loved ones π We took some time off. Sandro is bridging the cold winter in Thailand (say hi if...