Frontend vs Backend
Follow one request from a club sign-up form to the server, and prove that hiding a button keeps no one out.
Content date: October 15, 2026.
Plain English
The frontend runs in the visitor's browser: it shows pages and collects input. The backend runs on a server you control: it decides who may do what and holds private data. Anyone can open their browser's developer tools, read your frontend code, and resend altered requests. So a hidden button is a design choice, not a lock. Browser checks make a form friendlier, but the server must still check everything it receives.
Use this when
Do this before you add private records, admin actions, secrets, or paid access. A page that only shows information, like a club's meeting schedule, may not need a backend.
If you are just starting
Draw the path of one action, such as a student pressing Sign up: form, request, server check, saved record, response. Keep display choices in the browser and permission decisions on the server. Keep API keys (codes that let software use a service) out of anything the browser downloads. Practice with made-up students.
When your project grows
On every protected request, the server checks who is asking, taken from a verified login session and never from an ID the browser sends, and whether that person may act on this record. Test by calling the endpoint directly as another user and with no login, then read the responses for details they reveal.
Worked example
A robotics club lets each student edit their own sign-up note. The page shows Edit only on a student's own row. The tester also sends the edit request directly for another student's row, and the server compares that row's owner with the logged-in session and answers 403 (forbidden). Editing the role label stored in the browser changes nothing, because the server reads the role from its own session.
Practice
Challenge the boundary
- Pick one protected read or edit in a throwaway project, or use the downloadable booking-cancellation files, and create two made-up users.
- Draw the path: browser request, identity source, permission check, storage step.
- Run the action as the owner, then as the other user and with no login. The last two should be refused.
- Check the responses and downloaded browser files for private fields or secret keys, and note what you find without copying any secret.
Deliverable: A one-page request map and the allowed and refused results for one protected action.
Common mistakes to watch for
- The Delete roster button is hidden from students, but the endpoint answers anyone, and one curious student wipes the list.
- The email service's API key sits in the frontend settings, where anyone viewing the page source can copy it.
- The edit request carries studentId=14, so changing it to 15 edits another student's sign-up.
- The roster response includes phone numbers the screen hides but the browser's network tab shows.
Prompting
A weak prompt
Hide the admin button so regular users cannot delete records.
A better prompt
Trace one action in this app, [for example, a student editing their club sign-up], from browser to server to storage. Label the untrusted input, where login is verified, where permission is checked, and which fields come back. Keep secret keys on the server. With made-up students, show an allowed request, one from the wrong user, and one with no login, and say which check stopped each.
Hiding a button only stops people who use your screen. This test shows whether the server itself refuses everyone else.
Check before you move on
- The server takes identity from a verified session, not from the request.
- The server checks permission on the specific record.
- A direct request from the wrong user was tested and refused.
- The files the browser downloads hold no secret keys.
You are done when
- The owner's request works, and direct requests from another user or with no login are refused.
- You can explain why editing the page in your browser grants no access.
Questions to think about
The Delete button is hidden from students. What test do you still need?
Send the delete request directly as a student and confirm the server refuses it. Anyone can skip your screen.
A request contains userId=owner. Does that prove the sender is the owner?
No. The server should identify the user from a verified login, then check that this user may change the record. Senders can type anything.
A club wants a page listing meeting times and a contact address. Does it need a backend?
Probably not. With no logins and nothing private saved, a static page works. Add a backend when you must store records, keep secrets, or restrict access.