Trace Id is missing
February 12, 2021

Startup chooses Blazor and Xamarin for full-stack development using C#

The Postage is a startup that helps people plan for end-of-life, so that they can live fully now. Through the company’s use of .NET, including Blazor and Xamarin, its technical team was able to do full-stack development across the web, back-end services, and mobile applications—all using C#. In turn, this has resulted in rapid time to market, a rich user experience, and the ability to continue moving quickly as the company continues to grow.

The Postage

“I knew we wanted to use .NET, and Azure is the best cloud for .NET. What’s more, with .NET, we would get access to Blazor and Xamarin, which let us use C# across the entire application stack, from front end to back end to mobile—an approach that has proven to be very effective in terms of both speed and cost.”

Ken Myers, Chief Technology Officer, The Postage

Blazor: full-stack, end-to-end web development using C#

Situation

Emily Cisek, Chief Executive Officer of The Postage, founded the company after witnessing how difficult it was to wrap up the details of a loved one’s life. Her idea, while novel, was also straightforward. Cisek wanted to provide a clear and easy way for people to organize their affairs and plan for end-of-life, with greater intention and more personal control, so that they can live fully now and help those they will eventually leave behind to best handle their affairs.

The journey began in 2019, with Cisek envisioning an interactive, full-service platform that would help people plan for their passing and guide them through the difficult conversations they’ll need to have with family and friends. It would let them assemble all of their critical information in one place, including wills, pensions, financial accounts, social media accounts, online passwords, locations of safety deposit box keys, and so on—and keep this information current over time.

“Most people don’t think about all the complexities that others will face in settling their affairs,” says Cisek. “On average, it takes three months of full-time work to sort through and handle all the details, which is time that could be better spent celebrating that person’s life.”

Cisek enlisted the aid of Ken Myers—today the company’s Chief Technology Officer—to help bring her vision to life. The goal, as with most startups, was to move quickly with a small team, delivering a solution that was both highly interactive and highly secure.

“To get funding and move forward, we needed a working demo as quickly as possible,” recalls Myers. “At the same time, we knew we would be storing important details about people’s lives, such as passwords to investment accounts and a lot of other information that would need to remain for-their-eyes-only until they passed on. Of course, there were also the usual table stakes, such as scalability, high availability, ease of administration, and so on.”

Solution

Development began in December 2019, with Myers’s first task being platform selection. He chose Microsoft Azure, with past experience telling him it could provide everything needed to deliver on the company’s customer promise. “I knew we wanted to use .NET, and Azure is the best cloud for .NET,” he explains. “What’s more, with .NET, we would get access to Blazor and Xamarin, which let us use C# across the entire application stack, from front end to back end to mobile—an approach that has proven to be very effective in terms of both speed and cost.”

Myers explains the problem he wanted to avoid. “Up until now, development teams who wanted to write back-end services in C# had to use an entirely different language—namely JavaScript—to power the front ends of their web apps,” he says. “This often required two sets of developers with different skills—and all the associated overhead required to keep those two teams in sync.”

With Blazor, a framework designed for use with ASP.NET Core, Myers’s team was able to do full-stack development in C# (or any .NET language), eliminating the need to use JavaScript to deliver an interactive web UI. “Using Blazor gave our small development team a huge advantage, enabling the same people to build both the front end and the back end of our solution,” says Myers. “We were intimately familiar with the back-end services we had built, so we were able to use them on the front end much faster. I’d estimate that it cut our development time in half.”

More specifically, Myers knew that he wanted to use .NET, a single-page application (SPA) architecture, and a model-view-controller (MVC) model—all of which Blazor dovetailed into nicely. “In my opinion, up until Blazor came along, Angular was the best SPA architecture—but it required JavaScript,” he explains. “Blazor was perfect because it let us share MVC models implemented in C# across the entire application, making them a lot easier to generate and use—including the ability to skip the entire API layer within those models.”

According to Myers, the application started out heavily MVC, with a few Blazor components sprinkled in. Over time, as developers implemented additional functionality, they added more Blazor components. “At this point, the UI is about 80 percent Blazor,” he says. “We’re still using controllers for things they do well, like handling dynamic permissions and then passing actions into Blazor components for rendering. A good example is how, upon the owner of an account passing on, we delegate permissions to view their data to the people they’ve specified.”

Blazor gave Myers’s team two hosting model options: Blazor WebAssembly and Blazor Server. With Blazor WebAssembly, the Blazor app, its dependencies, and the .NET runtime are downloaded to the browser, and the app is executed directly on the browser UI thread. With Blazor Server, the app is executed on the server from within the ASP.NET Core app—with UI updates, event handling, and JavaScript calls handled over a SignalR connection.

Of those options, Myers chose Blazor Server, which offered some key advantages. “With Blazor Server, we could take advantage of things like sessions, which are strictly server-side,” explains Myers. “In addition, the app loads much faster due to a smaller initial download. MVC and Blazor Server actually work really well together, making it easy to add little bits of interactivity to a traditional ASP.NET MVC design and architecture.”

Back-end architecture

The overall architecture of The Postage is, as Myers puts it, “.NET end to end.” In building the solution, the technical team started with the user experience, using wireframes to capture what it wanted to accomplish. Developers then began implementing a back-end services layer on Azure, using Azure DevOps for pipelines and releases.

The web and mobile clients connect to those back-end services via Azure App Service, with Azure API Management used to help secure key APIs. Relational data resides in Azure SQL Database, with Entity Framework Core used to access the database via .NET objects. Unstructured data (including users’ wills and other estate documents) is stored in Azure Storage, as are the individual security keys for each user. Logging is captured in Azure Cosmos DB, which developers implemented by overriding all loggers and driving that data into the database as semi-structured JSON documents.

In storing user data, to ensure the utmost security, the solution has each user’s data reside on its own drive within Azure Storage. In turn, each user’s drive is divided into four parts: system data (security keys and system-generated documents), personal data (such as images), user passwords (including those for other websites, home security systems, and mobile device PINs), and other information. “We’re using standard Azure constructs,” explains Myers. “We’ve just distributed the data for additional security.”

The solution also makes use of a few ancillary hosted services, including Bing Maps for address validation, SendGrid, and Coravel Pro for task scheduling.

Mobile apps with Xamarin

Following completion and release of the website, the same developers turned their attention to the mobile apps the company would need. With Xamarin.Forms, once again they were able to use C# to build what they needed. “Xamarin is my favorite mobile development platform because we can use it to build an app once for multiple mobile platforms,” says Myers. “We use the same back-end services for our Blazor application and our Xamarin application, which, again, gives us one common language all developers on the team can use.”

Myers chose to go with Xamarin.Forms 5, the latest version, because it promised to minimize the work to deliver a highly customized UI. “In the past, with earlier versions of Xamarin, a custom UI often required custom renderers,” he explains. “We used Xamarin.Forms 5 to deliver a really rich, custom UI with far less custom code, the little ‘plus’ button we layered onto our toolbar being a good example. The XAML Hot Reload in Xamarin.Forms 5 is also great.”

Developers recently finished the Android version of the company’s mobile app and are wrapping up the iOS version. Myers expects the remaining work to be minimal thanks to high code reuse—again due to the use of Xamarin.Forms 5. “In the past, before Xamarin.Forms 5, I’d estimate we could have achieved about 70 percent code reuse across our Android and iOS apps,” he says. “With Xamarin.Forms 5, I’d say we can hit 90 percent reuse.”

All components of the company’s technology stack—web, mobile, and back end—reside within the same Visual Studio 2019 solution, in the same code base. “This helps ensure that one person making a change won’t affect others,” explains Myers. “We plan to use some NuGet packages where it makes sense, which will help speed build times.”

Results

Through its choice of technology, the development team at The Postage was able to move quickly and deliver on all success criteria. Development began in December 2019, with Myers working part-time and one other developer in South Africa working full-time. By February 2020, the company had obtained initial funding from investors. Cisek went full-time in April, Myers joined full-time in May, and The Postage went live and into beta in June—with almost all features implemented.

“Our beta release was a lot richer than just a place to store passwords and important documents,” says Cisek. “By that time, we had added the ability to capture users’ desires for after their passing—called My Plans—and a way to send messages to loved ones after they passed on. It’s hard to believe we did it all in just six months.”

About three months later, in September 2020, The Postage formally launched. “We’re seeing strong growth in terms of site traffic, account subscriptions, and general interest in the overall platform,” says Cisek. “And those people who do subscribe are actively uploading documents, adding their accounts and passwords, and saving messages for loved ones. It’s all coming together like we had hoped—we’re hearing stories about how it’s helping people change how they plan for the future, which is exactly what we set out to achieve.”

Cisek is just as excited for the future. “While I know we’ve come a long way in a short period of time, I’m still always thinking about how we can enhance the user experience—including any new, innovative, ‘crazy’ ideas we can explore to truly make an impact on the lives of our customers and their families,” she says. “With the support of an amazing technology team and the technology stack we’ve built on Azure, I can continue to dream big and tirelessly pursue our mission to change the way people plan for the future.”

Myers shares Cisek’s feelings about how smooth the journey has been and where it will lead next, albeit from a technical perspective. “With C#, Blazor, and Xamarin, we were able to implement our entire technology stack—from web to back end to mobile—without room for misinterpretation,” he states. “There’s nothing better than the exact same code.”

So what’s next for The Postage? With the employee count now up to seven, most people at the company are still wearing many hats. Aside from leading the team, Cisek is focused on continually improving the user experience, increasing digital conversion rates, developing new partnerships, and marketing. Myers is handling all system administration and DevOps tooling, which, thanks to Azure, only takes him about four hours per week. He’s spending the rest of his time helping push the company’s iOS application across the finish line, working on an integration layer for strategic partners, and gearing up for a move from .NET Core 3.1 to .NET 5.

“It shouldn’t be too hard,” he says. “I’m eager to see the performance gains and explore all the features, like XAML Hot Reload. Best of all, with the technical path we’ve chosen, at least for the foreseeable future, I’ll be able to stay hands-on with everything end to end. Watching the team grow and introducing new team members to the latest technologies we’re using has also been a lot of fun. The things we can do today with .NET and Azure are amazing; wherever Emily decides to steer the company next, I have no doubt that we’ll be able to deliver.”

“Using Blazor gave our small development team a huge advantage, enabling the same people to build both the front end and the back end of our solution. We were intimately familiar with the back-end services we had built, so we were able to use them on the front end much faster. I’d estimate that it cut our development time in half.”

Ken Myers, Chief Technology Officer, The Postage

Take the next step

Fuel innovation with Microsoft

Talk to an expert about custom solutions

Let us help you create customized solutions and achieve your unique business goals.

Drive results with proven solutions

Achieve more with the products and solutions that helped our customers reach their goals.

Follow Microsoft