A single-page application (SPA) loads its client-side application into the browser and updates the interface dynamically instead of requesting complete HTML pages for most interactions. Frameworks such as Angular, React, and Vue commonly use JavaScript to generate the visible HTML. section 5.1
A typical SPA interaction works in two stages:
- The browser initially downloads the JavaScript application, which initializes the SPA. section 5.1
- The initialized application requests data from the server, usually as JSON, then generates the HTML shown to the user. section 5.1
- The server endpoint providing this data may be called an HTTP API, JSON API, or REST API, depending on its design. section 5.1
Blazor WebAssembly provides a C# and Razor alternative to JavaScript-based SPAs by running in the browser through WebAssembly. Blazor Server offers a related experience by rendering on the server and sending events and updates over WebSockets. section 5.1 section 1.2
Figure 5.2 A sample client-side SPA using Blazor WebAssembly. The initial requests load the SPA files into the browser, and subsequent requests fetch data from a web API, formatted as JSON.
Trace the initial download of SPA files and the subsequent JSON requests to a web API. section 5.1




