SPA: Single-Page Application

A Single-Page Application loads a basic document once, then uses JavaScript to change views and fetch data without reloading the whole page.

What you will learn

How a SPA works

  1. The browser loads the application shell.
  2. JavaScript starts and renders the first view.
  3. The app requests data from an API.
  4. Navigation changes the view and URL while the document stays loaded.

Common building blocks

JavaScript framework or library
React, Vue, Angular, or a smaller custom solution.
API communication
REST or GraphQL endpoints that provide data.
Routing
A system that maps a URL to a view and supports the browser's history.

Strengths and trade-offs