A full-stack developer's shift to serverless paradigm
Mentor Gashi
It's been a while since I truly grasped the concept of serverless computing. However, transitioning from managing servers to embracing serverless practices demands more than just understanding its definition. It's about challenging yourself to approach tasks in entirely new and unconventional ways.
Consider this scenario: You, as a full-stack developer, decide to build a prototype for a TODO application. Initially, you conduct research and draw from your experience to outline the technology stack you'll use. You then proceed to set up this stack on your local machine, running basic tests to ensure everything works smoothly. Once satisfied, you initialize the project using Git.
After investing considerable time in setting up and fine-tuning the details, you finally begin to develop basic components within the codebase. Now, picture someone swooping in and removing the burden of server management entirely from your shoulders. Suddenly, your focus shifts solely to developing new features, optimizing existing ones, and continuously innovating your product.
Now, imagine placing this same full-stack developer in a cycle of new challenges, regularly presenting them with fresh projects. In this scenario, their primary focus shifts from researching and setting up environments for each project to innovating and enhancing existing solutions.
Effectively, they marry their solutions to the platform, continuously refining ways to interact with users and other entities. This approach empowers a single developer to achieve what would typically require the efforts of hundreds.
Since recognizing this paradigm shift, I've delved into researching various platforms, seeking those with key attributes such as ease of use, reliability, affordability, flexibility, and proactive support. It was during this exploration that I stumbled upon Firebase. I first learned about it through a designer I followed closely, shortly after discovering and utilizing the most cutting-edge CSS buttons library available at that time.
When Google acquired Firebase, the debate over whether to abandon server management in favor of utilizing platforms became even more pressing. Subsequently, numerous major companies began offering similar services. Fast forward to today, where CloudFlare, a company not typically associated with such offerings, has entered the fray with significant engineering investments in this direction, as evidenced by their developer platform initiatives.
To illustrate this paradigm shift, I've developed a demo project with a simple yet illustrative purpose: to clarify the concept. Imagine we require a service that acts as a bridge for sharing information securely. In this scenario, accessing the secret information would necessitate both a Public key and a Private key. Providing this key pair would unlock the content that someone wishes to share with you.
Opting for flexibility, I chose Vue with Vite as the framework for UI, complemented by the recently emerged concrete.style for styling. The objective was to keep the project as minimal as possible to ensure it could be easily followed by any audience. The final result, which you can explore as a demo, is accessible at https://secret-share.pages.dev/. It's worth noting that no commercial domain was utilized; instead, I relied on the domain provided for free by CloudFlare. However, since this tool may be taken down at any time, I advise against relying on it for anything other than demo purposes.
From a technical perspective, the project consists of three routes and their corresponding components. One of these components acts redundantly for reading data. Overall, there are two backend functions, both classified as serverless functions. The majority of the project comprises unedited boilerplate code, generated during the setup process of the CloudFlare CLI tool, known as wrangler. This boilerplate is largely a byproduct of the chosen stack and tooling. Through this description, I aim to highlight the minimal effort required to develop such a full-stack project.
In the upcoming days, I'll be crafting another blog post detailing the creation process of the project as a follow-up to this one. Meanwhile, feel free to explore the source code available at: https://github.com/simultsop/secret-share.