This stop on my roadmap took the longest to click, because it is the part you never see. The front end is everything in your browser. The back end is a separate computer, somewhere else, running code you cannot open, view, or edit from the page. For a while I could not see why you would even need it. Then it landed: the front end can be trusted with nothing, and the back end is where the trusting happens.
The front end is a menu, the kitchen is elsewhere
Picture a restaurant. The menu, the table, the person taking your order, that is the front end. You can read it, point at it, even scribble on it. But the kitchen is out back. You do not walk in and cook. You do not get to decide the bill. The kitchen takes your order, checks it against its own rules, and sends food out.
A web app works the same way, and for the same reason: anything in the browser can be changed by whoever is using it. A price shown on the page, a “you are an admin” flag, a hidden field, all of it can be edited by anyone who opens the browser’s developer tools. So the real rules cannot live there. They live on a server the user cannot touch.
- The back end is a server, a computer that is always on, running your code away from the user.
- It holds the real rules, talks to the database, and decides what each request is actually allowed to do.
What the server actually does with a request
When your front end sends a request, the server runs through a short, always-the-same routine before it answers.
flowchart LR R[Request comes in] --> V[Check it is allowed and valid] V --> L[Run the business logic] L --> D[(Read or write the database)] D --> A[Send an answer back]
The middle step, the business logic, is just the rules of your app written as code: work out the total, check the item is in stock, refuse the order if the card fails. To organise this, most people use a small framework. In JavaScript that is Express, which runs on Node.js (the thing that lets JavaScript run on a server instead of only in a browser). You do not have to use JavaScript, Python and Java are just as common on the back end.
The server exposes its abilities as a set of addresses called endpoints, the server side of the REST API from the last stop. Each one is a door for a specific job:
app.get("/products", (req, res) => { // someone asks for the product list
const products = db.getProducts() // read from the database
res.json(products) // send it back as JSON
})
app.post("/orders", (req, res) => { // someone tries to place an order
if (!req.body.itemId) return res.status(400).json({ error: "no item" })
const order = createOrder(req.body) // the business logic runs here
res.json(order)
})
IMPORTANT
Notice the highlighted line: the server checks the request before trusting it. This is the whole reason the back end exists. Validating on the front end is a nicety for the user. Validating on the back end is the only validation that actually counts, because the front end can be bypassed.
How a login keeps a password safe
Authentication, proving who you are, is the clearest example of why the back end matters, and it hides one rule that beginners get wrong in a way that is genuinely dangerous.
Here is the login flow. You send your email and password. The server checks them, and if they match, it hands back a token or sets a session (a record that says “this browser is now logged in as this user”). Your browser sends that back on every future request, so you do not log in again on every click.
flowchart LR U[You send email + password] --> S[Server checks them] S -->|match| T[Server issues a session or token] T --> B[Browser sends it on every request]
The dangerous part is what the server stores. It must never save your actual password. Instead it saves a hash, the output of a one-way function that scrambles the password into something you cannot reverse. When you log in, it hashes what you typed and compares the two hashes. If the database ever leaks, the attacker gets scrambled hashes, not passwords.
CAUTION
Storing passwords as plain text is the single most damaging beginner mistake on the back end. If you can read a user’s password in your own database, you have already failed. Always hash, with a purpose-built tool like bcrypt or Argon2, never a plain “encrypt” you rolled yourself.
Two more words you will meet, kept simple:
| Term | Question it answers | Example |
|---|---|---|
| Authentication | Who are you? | Logging in with email and password |
| Authorization | What are you allowed to do? | A normal user cannot open the admin page |
| Session | A server record of a logged-in browser | Deleted the moment you log out |
| JWT (token) | A signed pass the server can check without a lookup | Common for APIs and mobile apps |
Passing one does not pass the other. You can be authenticated (logged in) and still not authorized (allowed) to do a particular thing, and the server checks both, every time.
The tools you actually reach for
All free and open-source. Pick one language and stick with it while learning.
| Job | Popular tools | Note |
|---|---|---|
| Server framework | Express (Node), FastAPI/Django (Python), Spring (Java) | All free/OSS |
| Password hashing | bcrypt, Argon2 | Never store plain passwords |
| Full auth setup | Passport, Lucia, or a hosted one like Auth0/Clerk | Hosted saves time, costs money at scale |
The half that has to assume the worst
The lasting idea from this stop is a shift in trust. The front end is built to please the user. The back end is built assuming the user might be an attacker, and that difference is not paranoia, it is the job. Every rule that matters, every check that protects data, and every password lives back here precisely because the front end can be rewritten by anyone looking at it.
Build the front end for the honest user, and the back end for the dishonest one.
Sources
- dev.to: how to structure a production-grade Node.js + Express backend for the request, validate, business-logic, database flow
- nucamp: Node.js and Express in 2026 for what Node and Express are and why they are used
- coderoasis: how authentication actually works for the login flow, hashing, and sessions vs tokens
- Medium: authentication vs authorization explained for the identity versus permission distinction