Blog / Build with AI /

What a web app is made of, explained simply

A web app is a website that does something with your input. A plain website shows you a page. A web app lets you log in, save a note, calculate a price, upload a photo or place an order, and remembers it afterwards.

If you want to build one with AI help, the first obstacle isn’t the code. It’s the vocabulary. “Front end”, “back end”, “API”, “database”, “deploy”: when ChatGPT uses these words, you nod, and then you can’t tell whether the answer it gave you makes sense.

So here’s the map. Think of a restaurant, because it’s the analogy that holds up best.

The restaurant version

  • The dining room is what the customer sees: tables, menus, lighting. That’s the front end.
  • The kitchen is where the work happens, out of sight. That’s the back end.
  • The pantry and fridge is where ingredients are stored. That’s the database.
  • The waiters carry orders from the room to the kitchen and plates back. That’s the API (or just requests and responses).
  • The building and the address is where it all lives and how people find it. That’s hosting and the domain.

Every web app has all five, even tiny ones. Some of them can be very small, or handled by someone else’s service, but they’re still there.

1. The front end: what people see and touch

The front end is everything that runs in the visitor’s browser. It’s built from three layers:

  • HTML is the structure: headings, paragraphs, buttons, forms.
  • CSS is the look: colours, spacing, fonts, layout.
  • JavaScript is the behaviour: what happens when you click, type or scroll.

A simple tool such as a word counter or a colour picker can live entirely in the front end. Someone pastes text, JavaScript counts the words, the page shows the number. Nothing needs to be sent anywhere. That’s why “a tool in one HTML file” is such a good first project with AI: there’s no kitchen to build.

2. The back end: the work you can’t see

The back end runs on a server, not in the visitor’s browser. It’s needed when the app has to do something that shouldn’t happen on the visitor’s side:

  • Check a password.
  • Save data permanently.
  • Send an email.
  • Talk to another service using a secret key.
  • Decide who’s allowed to see what.

The reason is trust. Anything in the front end can be read and changed by the person using it; they can open their browser’s developer tools and look. So anything that needs to be secret or reliable belongs on the back end. That’s also why API keys should never sit in front-end code: the back end is where the keys live.

Back ends are written in languages like PHP, Python, JavaScript (via Node), Ruby and others. WordPress, for example, is a back end written in PHP.

3. The database: memory

Without a database, your app forgets everything the moment the page closes. A database is organised storage: users, orders, notes, settings.

Most are built like spreadsheets: tables with rows and columns. A “users” table might have a column for name, another for email. MySQL, PostgreSQL and SQLite are common ones. There are also hosted options that hide most of the setup.

For a small personal tool you may not need one at all. Browsers can store small amounts of data on the visitor’s device (localStorage), which is enough for something like a to-do list that only needs to remember things on one device. The trade-off: clear the browser data or switch devices and it’s gone.

4. The API: the waiters

When the front end needs the back end to do something, it sends a request, and the back end sends back a response, usually in a format called JSON. The set of requests the back end understands is its API (Application Programming Interface).

So “log in” is: the browser sends the email and password, the back end checks them against the database, and replies “yes, here’s your session” or “no”.

You’ll also use other people’s APIs. A weather app doesn’t measure the weather; it asks a weather service. A payment button doesn’t handle your card; it hands off to a payment provider. Much of modern app building is connecting services together.

5. Hosting and the domain

The files and the server have to live somewhere that’s switched on all the time. That’s hosting. Options range from a shared plan with a few clicks, to a static host for front-end-only projects, to servers you manage yourself.

The domain is the address people type. A DNS record connects that address to wherever the app is hosted. If DNS is new to you, I explained it in DNS explained for people who just want their site to work.

What this means when you ask AI to build something

Knowing the parts changes how you prompt. Compare:

Make me an app for tracking orders.

with:

Build a single-page front end in HTML, CSS and JavaScript where I can add an order (customer name, item, status) and see a list. Store the data in the browser’s localStorage for now. No back end, no login.

The second one picks a small slice, names the parts, and says what to leave out. That’s the difference between getting a working page and a pile of half-connected files. I wrote about that approach in building a tiny tool with AI, from idea to working page in an afternoon.

A rough ladder for beginners:

  1. Front end only. Calculators, generators, checkers.
  2. Front end plus someone else’s service. A form that sends to an email service, a page that shows live data.
  3. A real back end and database. Logins, saved user data, payments.

Each step adds security responsibilities. Step three is where you should ask someone experienced to look over what you’ve built.

Common myths

  • “A web app and a website are totally different.” Not really. It’s a spectrum. A WordPress site with a booking form is already partly an app.
  • “You need a framework.” Not for small tools. Plain HTML and JavaScript are fine until the project outgrows them.
  • “The AI will pick the right setup.” It’ll pick a setup. If you don’t say how big the project is, it might pick something far too heavy for it.

Key takeaways

  • A web app has a front end, a back end, a database, an API and hosting.
  • Anything secret or trusted belongs on the back end.
  • Start with front-end-only projects and add parts as you need them.
  • Name the parts in your prompts.

FAQ

Do I need all five parts for a small tool?

No. A browser-only tool needs just the front end and somewhere to host the file.

Is WordPress a web app?

In a sense, yes. It has a back end (PHP), a database (MySQL), and a front end (your theme). Plugins extend it.

Which part do you find hardest to picture: the kitchen, or the pantry? Tell me and I’ll cover it next.