What is a Single Page Application (SPA)?
An SPA is a web app that loads one page once and then rewrites it in place with JavaScript, instead of fetching a new HTML page from the server for every screen.
In a traditional site, every navigation triggers a full server round-trip and a fresh HTML page. An SPA flips this: the browser loads a single shell page plus the JavaScript application, and from then on the app itself handles everything client-side, only calling the server for raw data. Gmail, Google Maps, and Trello work this way — clicking around never reloads the whole page.
Aspects that make up an SPA:
- One HTML page — no traditional full-page reloads.
- Client-side routing — JavaScript decides what to show when the URL changes.
- Template rendering — views are assembled in the browser.
- Remote data access — data is fetched asynchronously from the server (typically JSON).
- Modularization — code is split into reusable components.
The work splits cleanly between two sides: the server provides the initial app bundle (HTML/CSS/JS) and data services (JSON/XML), while the client runs the application, navigation, view rendering, and data access in JavaScript.
Frameworks: React, Vue.js, Angular. Trade-off: very fluid once loaded, but the initial download is heavier and plain SPAs can be harder for search engines to index.
Go deeper:
Single-page application (Wikipedia) — the client-side routing, history-API and SEO trade-offs in more depth.