Frontend vs Backend
The frontend is the screen visitors see. The backend is the hidden part that stores and processes data. In a restaurant, they're the dining room and the kitchen.
Frontend
The screens and buttons you see in the browser. The restaurant's dining room.
Backend
The hidden part that handles saving, calculating, and security. The restaurant's kitchen.
At a glance
| Frontend | Backend | |
|---|---|---|
| Where does it run? | The visitor's browser | The server |
| Who can see it? | Anyone (with developer tools) | Only you |
| Main jobs | Screens, buttons, animations | Saving, login, payments, calculations |
| Secret keys | Never put them here | Keep them here |
Use “Frontend” when…
- When you want to change the design, layout, or colors
- When changing what the screen does after a button click
- When fixing the phone layout
🤖 Say it to your AI like this
Only change the frontend. Don't touch the server or database code. Just make the text size and spacing on the product cards bigger.
Use “Backend” when…
- When dealing with logins and member info
- When saving or loading data
- For things that need secret keys, like payments or AI
🤖 Say it to your AI like this
Handle saving orders in the backend (an API route). Use the payment key only on the server and never send it to the browser.
💡 How not to mix them up
Tell the AI the scope, like 'frontend only' or 'backend only'. It's less likely to change things you didn't ask for.