Real examples are pulled from this TypeLyrics codebase.
The core idea in one sentence
Server-side means code runs on a computer you own/rent before the user sees anything. Client-side means code runs inside the user's browser after they receive the page.
1. Where does code actually run?
YOUR SERVER USER'S BROWSER
(Vercel / Node.js) (Chrome / Safari / Firefox)
───────────────────── ─────────────────────────────
Has access to: Has access to:
• Your database • The DOM (buttons, inputs)
• Secret API keys • localStorage / cookies
• File system • window, document
• Other servers • User's mouse / keyboard
• Full Node.js runtime • User's device hardware
Cannot access: Cannot access:
• User's browser • Your database directly
• User's localStorage • Secret API keys
• User's device • Other users' data2. The journey of a page load
When someone visits typelyrics.de/train this is what happens step by step: