This chapter is about the Survey Project Challenge, an optional complete solution to a common set of problems that will give you a real-world set of projects to build.
This chapter will cover the following topics:
A lot!
In this book, you have learned about many of the most important and popular technologies for building apps and services with .NET, as shown in Figure 20.1:
Figure 20.1: Technologies for building apps and services with .NET
The technologies can be divided into layers:
There are also features that can be implemented at multiple layers, like caching and queuing, to improve scalability, reliability, and overall performance.
Important decisions about which technology would best solve a specific development problem are tricky because they do not just involve the technology itself, like .NET MAUI, but also the technologies relating to it, like the transport protocol used to communicate with other layers of the solution and the format of data documents that are exchanged between layers.
Before I explain the survey project challenge, let’s talk about the best way to learn any new skill or technology.
The best way to learn how to build apps and services with .NET is to work on real projects that you would use yourself or that at least spark an interest in you.
If you are a student, or a professional developer who has no choice over the projects or technologies that you implement, how can you work on a real project that needs the technologies you are interested in learning about?
In this chapter, I will introduce my idea for how to achieve that goal.
To help us learn all the different technologies that .NET developers need to know these days, we need a project that:
A PRD contains a listing of the features for a product to allow someone to understand what it should do. It does not say how it should do it. That would be defined in a functional specification that is more detailed.
When you’re struggling with a bug, you need to stay motivated. The best way to stay motivated is to work on a project that you will use yourself. Eat your own dog food, as they say.
A common suggestion for this type of project is to build your own content management system (CMS). This is a thriving market with everything from the “big boys” like Optimizely and Adobe, to SaaS solutions like SquareSpace, via open-source solutions like Piranha and Umbraco.
You can learn more about CMS solutions at the following link: https://github.com/markjprice/apps-services-net7/blob/main/docs/cms/README.md.
Personally, I have used survey and polling software to gain insight into my students and readers. For example, the most popular survey product is probably SurveyMonkey, although there are dozens of alternatives, as shown in the following list:
Most survey tools have a free tier so you can try them out. For example, SurveyMonkey has a Basic plan that is free. Their best value paid plan, Advantage Annual, is £384/US$453 per year for an individual, or £99 per month if you want to stop paying at any time. That gets expensive fast!
Their free Basic plan has the following limitations:
So, I am motivated to create my own survey solution and I have the skills to do it!
There are dozens of question types, from multiple choice to scale selection via matrix and freeform text, as shown in Figure 20.2:
Figure 20.2: Types of survey questions in SurveyMonkey
Some of these question types should be easy enough to implement, like the plain text response or selecting one option from many. Others are likely to be harder to implement once you think about all the potential possibilities.
Survey tools have similar features to other tools like live polling and quiz builders. They all need some way to build the survey, poll, and quiz, and some way to take it, and finally ways to analyze the results.
I often deliver live training sessions and webinars. It is useful to ask the audience a bit about themselves, like where in the world they are, what their current experience is, and what they expect to get out of the session. The main difference between a survey and a live poll is the duration that question items are available to answer. The main difference with a quiz is the concept of a correct answer and scoring at the end.
Quizzes also share a lot of similarities. The main difference is the breadth of question item types. You can imagine that a quiz builder for learning mathematics or physics could have some quite elaborate components with complex implementations.
Another major feature of survey tools is the ability to analyze the results using everything from basic charts to complex machine learning artificial intelligence algorithms to spot unusual patterns.
A product requirements document is the result of analyzing a business problem. It defines a set of suggested features that solve the problems that the software is supposed to address.
A minimal viable product for a survey tool would include:
To take a survey, the solution should provide a website. This is to make the surveys as accessible to as many people as possible. Every device has a web browser so a website will have the broadest reach. We can also easily share surveys using hyperlinks.
The website should respond to a request to take a survey identified by a unique value, as shown in the following link:
The website should allow anonymous visitors, present the question items to them, and record their responses. To keep it simple, there could be no restrictions on taking the survey multiple times. There would be no registering or authentication checks.
The website should support the following question types:
Each item type should allow a plain text question.
An interactive survey design tool would be a lot of work. For the MVP, we will limit it to a basic JSON editor. The structure of the JSON document will be defined for the minimal question item types, but a plain text editor with templates for each item type is the only option for creating and editing them.
How should a survey and their responses be stored? It needs to be simple yet flexible. A document-based data storage solution would be best. A relational database would require normalization and therefore unnecessary complexity and potential performance issues.
Analyzing the results would benefit from duplicating some information from the individual responses, for example, so we could show a chart of how many respondents selected each radio button in a multiple choice item.
The analysis app should show a list of all surveys and their status, for example, if they are active, if they are complete, how many have taken them, the details of their answers, and summaries of the results. Numeric results should appear as tabular data as well as charts, as shown in Figure 20.3:
Figure 20.3: A chart of survey responses
One of my favorite aspects of a survey tool is that there are many areas where you can choose to extend the minimal product:
A visitor should be able to register with the website and store basic profile information, like a contact email address, demographic details, and a list of the surveys that they have taken. This information should follow good practice in allowing the visitor to update and delete their data at any time.
The website could support the following additional question types:
Each item type should allow a rich text question for each item and allow arbitrary rich text and images throughout a survey.
SurveyMonkey keeps the cool item types for the paid tiers, as shown in Figure 20.4:
Figure 20.4: Upgrade SurveyMonkey to unlock most item types
The minimal product stores the surveys and their question items but does not provide an easy way to create or edit them. We could provide a website or an app to enable someone to register an account and manage their own surveys and question items.
This will require authentication and authorization checks. The create and edit functionality could get quite complex because showing a question item is easier than providing an editing experience for one.
Either a website or app should provide a friendly survey creation and editing experience that closely matches what the survey taker would experience. In other words, a what-you-see-is-what-you-get editing experience.
For a survey tool that will be sold commercially, the organizations will want to brand their surveys with logos, images, colors, and so on.
Even with a minimal product, the data storage requirements need to be flexible enough to store multiple different item types, a flexible number of items per survey, and the responses when someone takes a survey.
The main extended addition might be storing pre-created analysis data to improve performance, especially in a NoSQL cloud data storage example where each survey response is stored as a separate document.
If you have data science skills, then you could integrate the ML.NET libraries to add machine learning algorithms to process survey results to reveal interesting insights that humans might overlook.
You can learn more about ML.NET at the following link: https://dotnet.microsoft.com/en-us/apps/machinelearning-ai/ml-dotnet.
Pick one of the parts of the survey project to implement.
If you are more visually creative, then design and build a question item or a graphical analytics component. Even if you cannot build it yourself, you could sketch out your idea, and someone else might be inspired to implement it.
If you are more engineering-oriented, then perhaps optimizing the plumbing appeals to you more. You could define service requirements and then implement them using multiple technologies. Then create tests to compare the performance of each.
You can share ideas, discuss potential solutions, and get help from fellow readers and even me on the Discord channel for this book, found at the following link:
https://packt.link/apps_and_services_dotnet7
Publish your work in a public GitHub repository to share your achievement with the world. The best work will be promoted in the second edition of this book planned to be published in November 2023. I will link to your GitHub repository or your website so readers can learn more about your work. I am excited to see what my readers produce!
I plan to have a go myself during the first half of 2023 and I will share my projects in separate GitHub repositories. I will link to them from the GitHub repository for this book, so if you’re interested, then keep an eye out for links to them here:
https://github.com/markjprice/apps-services-net7
In this chapter, you learned about the survey project challenge. Hopefully you were inspired to have a go at implementing one or more of its components, if not a full solution, and to share your hard work with the world.
In the Epilogue, you will learn how to continue your learning journey with apps and services for .NET.
Join the book’s Discord workspace for Ask me Anything sessions with the author.