SPA, SSR and meta-framework architectures
Decide who builds the HTML for Taskboard: the browser, your server, or a build step. Compare SPA, SSR, static output and meta-frameworks by what each moves.
SPA, SSR and meta-framework architectures
The player loads from youtube-nocookie.com when you press play. Nothing reaches YouTube before that.
Not started
What you'll learn
- Every rendering architecture answers one question: who turns data into HTML, and when does that happen.
- A single-page app sends an empty shell and builds the page in the browser, so the server only serves JSON and static files.
- Server rendering builds HTML per request, which helps the first paint and search engines but puts rendering work on your server.
- Static generation builds HTML once at build time, which is the cheapest to serve and fits only content that changes rarely.
- A meta-framework lets you choose per route, but it also means your code runs in two places and the seam between server and client moves inside your codebase.
The question underneath
Every web page ends up as HTML in the browser. The only real question is who writes that HTML and when. The answer shapes your whole project: how many deployables you have, what a deploy looks like, whether search engines see your content, and where bugs show up.
There are three honest answers, and then a fourth that lets you mix them.
1. The browser builds it: a single-page app
In a single-page app (SPA), the server sends a nearly empty page and a bundle of JavaScript. The browser runs the bundle, which fetches data from your API and builds the page. Later navigation doesn’t reload the page; JavaScript swaps the content.
For Taskboard, a React + Vite client is a SPA. The server’s job shrinks to two things: serve the static files, and answer JSON requests.
Browser Static host API
| GET / | |
|----------------------->| |
|<-- index.html + app.js | |
| GET /api/tasks | |
|------------------------------------------>|
|<-- JSON |
| (browser builds the page)
What you gain: two clean halves. The client is a folder of static files you can put on any CDN. The API is a service that any other client could use too. This split is what the rest of this roadmap assumes.
What you pay: the first view needs the bundle and then a data request before anything useful shows. Crawlers that don’t run JavaScript see an empty shell. Both costs are real but not always large; an app behind a login has no use for search crawlers.
2. The server builds it: server-side rendering
With server-side rendering (SSR), your server runs the same component code and sends finished HTML for each request. The browser can paint it immediately, then JavaScript takes over the page in a step called hydration.
What you gain: a fast first paint and content that exists in the HTML. What you pay: a server that renders on every request, which costs CPU and money, and a new class of bugs. The same component now runs in two environments, so code that touches window crashes on the server and code that reads a database must never reach the client.
3. A build step builds it: static generation
With static site generation (SSG), the HTML is built once, at build time, and served as plain files. It is the cheapest and fastest thing to serve. It fits content that is the same for everybody and changes rarely: marketing pages, docs, a blog.
It does not fit “tasks assigned to me”, which differs per person and changes by the minute.
4. Meta-frameworks: choose per route
A meta-framework such as Next.js, Remix or Astro sits on top of a UI library and lets you pick per route. The landing page is static. The board is rendered on the server or in the client. A report page might be regenerated every few minutes. The frontend roadmap covers server-side rendering and static generation, the React roadmap has the concepts for React, and Next.js has its own overview. This lesson is about what the choice does to the rest of the stack.
What the choice changes elsewhere
| Question | SPA + API | Meta-framework |
|---|---|---|
| How many things do you deploy? | Static client and API, separately | Often one server, sometimes plus a standalone API |
| Where does data fetching code run? | In the browser, calling your API | On the server for first load, in the browser afterwards |
| Where do secrets live? | Only in the API | In server-only code inside the same project |
| Can a mobile app reuse it? | Yes, it talks to the same API | Only if you also expose an API |
| What is hard? | CORS, auth across origins | Knowing which code runs where |
The row about secrets is the one that bites. In a framework where components can run on the server, a database password and a button handler can sit a few lines apart. The boundary exists, but it is inside one folder rather than between two, so you rely on convention and framework rules, not on a network gap. We return to that in environment variables and secrets across layers.
What this roadmap assumes
Taskboard is built as a SPA with a standalone API. That is a deliberate teaching choice, not a verdict. It makes the seams visible: the client and server are separate programs, so every hand-off is explicit, and you can see each one. The same seams exist in a meta-framework; they are just closer together and easier to forget. If you later move to one, you are moving the same boundaries into the same repo, not removing them.
A plain rule of thumb for a first project: if the app is mostly behind a login, start with the SPA and API. If much of it is public content that needs to rank in search, a meta-framework earns its complexity.
What the video covers
Web Dev Simplified’s “WTF Do These Even Mean” is a 14-minute video published in November 2023. Its description says there are many acronyms around rendering that sound similar and that it explains what each one means. The title does not name them, and I could not read a transcript or chapters, so I can’t tell you exactly which patterns get time. Expect the usual set: client rendering, server rendering and static generation. Beyond Fireship’s seven-minute “10 Rendering Patterns for Web Apps” is linked as a faster, wider survey that also covers incremental and partial approaches.
Where this fits
Now you know who builds the HTML and what that does to your deploys. The next lesson turns the choice into a decision for a whole project: choosing a full-stack stack.
Check yourself
In a single-page app, what does the server send for the first page load?
A nearly empty HTML shell and JavaScript bundles. The browser runs the JavaScript, fetches data from the API, and builds the page.
Which Taskboard pages suit static generation, and which do not?
A marketing or docs page suits it because it is the same for everyone. A board showing the signed-in user's tasks does not, because the content differs per person and changes often.
What new problem does server rendering add that a pure SPA does not have?
The same component code now runs on the server and in the browser, so you have to handle code that is only valid in one place, and there is a hydration step to keep them in step.
Does choosing a meta-framework remove the need for a separate API?
Not necessarily. Many apps keep a standalone API so mobile apps and other clients can use it, and the framework then only handles rendering.
Go deeper
Notes
Notes are saved to your account.
Everything else on this page works without one — progress and bookmarks keep themselves in this browser and come with you when you sign in. Notes are the one thing worth not trusting to a browser you might clear.
Your notes could not be loaded.