Mental model

Front End, Back End: What Those Words Mean

Think about a restaurant.

There is the dining room — tables, menus, the person who takes your order. And there is the kitchen — where food is actually made, where the fridge is, where customers do not go.

Software is built the same way:

  • The front end is the dining room. Everything you can see and click: buttons, text, layout, animations. It runs on the visitor's own device.
  • The back end is the kitchen. Where things are stored, where rules are enforced, where secrets are kept. It runs on a computer you control, that visitors never touch directly.

That is the whole distinction. Everything else follows from it.

Why the split exists at all

Because anything on the visitor's device can be read and changed by them. Not by hackers — by anyone, using tools already built into their browser.

So a rule that lives only in the front end is a suggestion. If your page hides the "delete everything" button from normal users, a curious visitor can still un-hide it. The button was never the protection.

Anything that must actually be true has to be checked in the kitchen, where the visitor cannot reach.

The test: which half does this belong in?

Ask "what happens if the visitor lies?"

  • Front end is fine for how things look, what is shown or hidden for convenience, and quick checks that help people fill a form correctly.
  • Back end is required for: anything with a password or secret key, anything about money, anything where one person must not see another person's data, and anything you would be upset to have altered.

Notice that "check the form is filled in correctly" appears on both sides. That is deliberate and not wasted work: the front end checks it to be helpful, the back end checks it to be safe. Real apps do both.

What "the server" actually is

A server is not a special kind of machine. It is just a computer that stays on and answers requests. Your laptop acts as one when you run your app locally — that is what localhost means.

The difference with a real server is only that it is always on, and reachable from the internet.

Does your app even need a back end?

Honestly, many first projects do not. If your app just shows things, calculates things, or saves notes for one person on one device, the front end alone is enough — and it is cheaper, faster and far harder to break.

You need a back end once you need any of these:

  • Accounts — people logging in as themselves.
  • Shared data — what one person does, another person sees.
  • Secret keys — talking to a paid service without exposing the key.
  • Data that must survive a cleared browser or a new phone.

If none of those apply, adding a back end adds cost and things to break for no benefit. "Simplest thing that works" is a real engineering answer, not a cop-out.

Why this makes you better at asking

Once you can name the halves, you can direct the AI properly:

Move the price calculation to the server and have the browser just display the result — I do not want the discount rules editable by the visitor.

That is a sentence you could not have written before this stage, and it is the difference between an app that looks right and one that is right.