2 Your first Blazor app

 

This chapter covers

  • Choosing the right project template for your application
  • Building and running your application
  • Understanding the key parts of your application
  • Writing your first components

After reading chapter 1, you should have a good idea of what Blazor is and how it works. You should also now understand the concept of hosting models and have some compelling reasons why you might want to choose Blazor for your next project. But so far, we’ve only talked in theory. We still need to get our hands dirty building something with Blazor, and that’s going to happen in this chapter.

We’re going to create the application that we’ll be building throughout the rest of the book—Blazing Trails! The app will allow walkers to discover new routes to explore, as well as add and update routes of their own. As we build this app, you will learn about the key features of Blazor, things such as routing, forms and validation, and authentication.

2.1 Setting up the application

2.1.1 Blazor WebAssembly template configurations

2.1.2 Creating the application

2.2 Building and running the application

2.3 Key components of a Blazor application

2.3.1 Index.html

2.3.2 Program.cs

2.3.3 App.razor

2.3.4 wwwroot folder and _Imports.razor

2.4 Writing your first components

2.4.1 Organizing files using feature folders

2.4.2 Setting up styling

2.4.3 Defining the layout

2.4.4 The Blazing Trails home page

Summary