In plain words
Your app runs in two places: the client is the visitor's browser, which anyone can inspect and edit, and the server is a machine only you control.
Where you see it
Open your browser's DevTools on your live app and the Sources tab shows the code behind every screen: that is the client. The Next.js route under app/api, or the Supabase Edge Function that charges a card, runs on the server, out of view.
What goes wrong
- Trusting a total the browser sent
Anything the browser sends can be edited in DevTools first. A server that charges whatever total arrives will one day charge 0.01.
const amount = body.total; // straight from the browser - Hiding a button and calling it security
Hiding Delete from non-admins only changes what the browser draws. The server still has to check who is asking before it deletes anything.
- Importing server-only code into a client component
The build stops with an error about next/headers or fs, because the browser can't reach your server's files or read the incoming request. Keep that code in a server file and pass the result down.
What to tell your agent
Quick check
Sign in to earn +10 XP for itQuickBite's checkout sends the cart total from the browser to your server. What should the server do with it?