How we built Dotnetos Platform using Azure Functions, Cloudflare Workers and Jekyll

This platform does not support…

are the famous last words an engineer can hear before they start to think about implementing it on their own. This was the case, when we thought about releasing our very first online course Async Expert. After considering various options, we agreed to use a set of existing components and gluing them on our own. Having a three engineers on board, that are capable of using C# and serverless approach, the choice for a platform was simple.

What are the things to integrate

You could ask what are the things to integrate anyway. How many moving pieces do you use to provide an online experience to attendees? Actually, there are some.

The first tool, that we use to provide our attendees and subscribers with emails, is ConvertKit. This is the mailing platform that we selected a while ago. With its tag, segments, sequences and automations, it’s a perfect tool to deliver meaningful content using emails. This is the very same tool that we use to send broadcasts, whenever we announce a new opening for our course.

The second part is related to hosting videos and downloads for our attendees. After reviewing multiple options, we selected Thinkific to deliver these materials. Initially, we used the discussion forum in there, but as our samples and discussions between attendees often include pasting formatted code, we changed the approach and moved to a different option for hosting them.

To make the discussions fruitful and easy to follow, we chose the Discourse. It’s an awesome tool, if you want to share code snippets. Additionally, it allows attendees to have a good well-formatted interaction between them and authors/mentors.

The payment gateway that our Platform uses is provided by Stripe. The process is augmented to apply VAT tax properly. This is the part that we spent a lot of time. Dealing with various cases of inverse VAT, EU VAT (that is verified against the EU database) and other cases isn’t that easy! Finally, whenever the payment is done, an invoice is generated and sent to the person who purchased licenses. This, especially for bulk business orders, might be a different person from the attendees.

Where are Azure Functions

All the parts mentioned above are integrated by a single serverless Azure Functions app. To interact with specific components we use API and webhooks. This is done mostly by using the RestSharp and performing specific calls against specific endpoints. We tend to use a limited part of the provided API. Usually it’s sufficient to make a call or two to a specific component.

The whole ordering process is designed to not fail. All the parts that are related to the integration aspects are separated from performing the actual order. After all, it’s ok to accept an order and fix something later on. At the same time it would be a terrible mistake, if the order failed due to a third party service being unavailable at the moment.

It’s worth to mention that the Azure Functions app is run in a consumption plan. The orders are not done every single minute (we wish they were!) so we’re much better with having it started on demand.

Now, you could think that with the consumption plan the ordering process may suffer from the cold start problem. The cold start means that the app is loaded for the very first time and it takes a while to get it ready. We address it by sending a warming up request. It ensures that once the order button is hit, the app is warm and ready.

Cloudflare Workers

There are places where we use Cloudflare Workers, which an edge, a.k.a Region Earth, serverless platform. It provides interesting capabilities. One of them allows you to intercept the incoming traffic and augment the returned html. This is used to inject cross-promotions of our products. You can see it on your vising Dotnetos Goodies page and scroll to the bottom of it. If you visit other courses, like .NET Diagnostics Expert and scroll again, you’ll see a similar section. This is done on the fly by a specific Cloudflare Worker.

Jekyll

The majority of our pages uses Jekyll and is hosted on GitHub Pages. This allows us to use MarkDown (this is how this post is written at the moment). Then, if it’s needed, we can always augment the output with Cloudflare Workers.

One could think about using a bit more enterprisey tool for creating pages, but so far, Jekyll is the one that we were able to leverage in every single this. It’s worth to mention, that the injection made by Cloudflare Workers are also based on the Jekyll-ed output.

Summary

During this year a lot of things happened. There are many more platforms and services that help online creators to support their attendees. There are things that were introduced in the payment gateways that allow to lift off the burden of the tax calculations and many more. At the same time, by augmenting piece by piece our Dotnetos Platform, connecting different dots and addressing pain points that arise, we were able to make it a really good tool to work with.

We wish you frequent usages of it, either by joining our courses or simply visiting pages with all the content that we provide.