How a Web App Works — Frontend, Backend, and Database

What happens after you click Save? Follow one task from browser to database, learn what code runs at each step, and see how WordPress puts the pieces together.

5 min read
לקריאה בעברית

The frontend is what you use in the browser. The backend checks what you’re allowed to do and carries out the request on a server. The database keeps the result. When you save a task on your laptop and find it on your phone, all three have done their jobs. Knowing the difference helps you trace a broken feature. Did the button send the request? Did the server accept it? Did the data actually get saved?

Follow one click on Save

Say you’re signed in to a task app. You type “Buy coffee” and click Save. The screen shows “Saving…” while the browser asks the app to create your task. The server checks your session, checks that the title is valid, and stores the task under your account. When it confirms the save, the list updates. Your phone can then load the task from the same account.

What happens when you save “Buy coffee”
  1. Browser

    Sends the title and shows “Saving…”

  2. Backend

    Checks your session and validates the title

  3. Database

    Stores the task and its owner

  4. Browser

    Shows the task after the server confirms the save

What is an API request?

An API defines how software can ask for data or request an action. In this example, the browser sends the request over HTTPS. POST /api/tasks asks the server to create a task. GET /api/tasks asks it to return the tasks for the signed-in user.

The browser can send the title in JSON, a text format for structured data. Here is a simplified example of the fields in the request and the data it sends.

POST /api/tasks
Content-Type: application/json

{"title": "Buy coffee"}

The server can reply with 201 Created and the saved task, now with an ID. If the title is invalid, it can reply with 400 Bad Request and a message the browser can show beside the field. HTTP methods and status codes

What the frontend does

The frontend includes the task field, the Save button, and the list. It also handles the moments between clicks. Can you use the form with a keyboard? Does the screen show a pending save on a slow connection? If it fails, can you retry without retyping the task?

Which languages and frameworks run the frontend?
  • HTML gives the page structure and meaning. It defines the form, provides a button that supports keyboard activation, and links a label to the task field.
  • CSS controls the layout and appearance. It makes the form fit the phone screen, gives keyboard focus a clear outline, and styles the pending and error states.
  • JavaScript handles behavior in the browser. It can send the save request and update the list without reloading the page. TypeScript adds checks for the types of values developers work with and is converted to JavaScript for the browser.

You can build this form with plain HTML, CSS, and JavaScript. A dashboard with several screens might use the React library or a framework such as Vue or Svelte. They help you build reusable pieces, such as a task row that appears in both the main list and search results. How the web works · React · Vue · Svelte

How the backend applies the rules

The backend identifies the signed-in account, checks that the request is valid, and decides whether the account can create or read the task. It applies those rules on every relevant request. For example, when you open the list on your phone, the backend returns the tasks your account can access.

Which languages and frameworks run the backend?

Node.js is a runtime that runs JavaScript on a server. Teams can write that code in JavaScript or TypeScript and use a framework such as Express to handle web requests. Other stacks include Python with Django and PHP with Laravel. These frameworks give developers ways to route incoming requests and send responses. Your app still needs to define who can save, read, and share a task. Node.js · Express · Django · Laravel

How the database keeps your data

The database stores information the app can look up later. In a relational database such as PostgreSQL or MySQL, each task could be a row with an ID, a title, a completion status, and the ID of the user who owns it. That last field lets the backend find the tasks for each account.

Where does the database actually run?

During development, the app and database can run on your computer. In production, the database might run on the same host as the backend, on a separate private server, or as a managed cloud service. The backend connects using the database address and credentials configured for it. In this app, the browser calls the API and the backend queries the database. The service that runs the database also needs backups you can restore. PostgreSQL client and server architecture

How this looks in WordPress

Think of publishing a blog post. The editor is an interface in your browser. When you publish, WordPress runs PHP on the server, checks your permission to publish, and writes the post to a MySQL or MariaDB database. When a reader opens the post on a typical WordPress site, the theme turns the stored content into a page the browser can display. WordPress hosting requirements · How WordPress themes work

What do we use at 8SCOPE?

For WordPress projects, we build custom themes for the pages visitors see and PHP plugins for features that are specific to the project. Our work includes custom WooCommerce flows and career portals that load job listings from recruitment platforms. We also use the WordPress REST API for integrations. A separate frontend can use that API to request published posts as JSON. WordPress still provides the editor and stores the content. 8SCOPE WordPress development · 8SCOPE integrations · WordPress posts API

How to test your first feature

Save a task. Refresh the page and check that the task also appears on your phone. Then sign in with a second account and check that it has its own list. That covers the interface, storage, and permissions in one short test. Finally, try saving while offline. Can you tell the save failed? Is the title still in the form when you reconnect?

Share

Have a project like this in mind?

Tell us what you need — we reply within one business day.

Start a conversation