Front End, Back End and Full Stack
See what runs in the browser, what runs on the server, and what full-stack work really covers.
Key takeaways
- Front-end code runs in the browser or app and is visible to whoever uses it.
- Back-end code runs on servers and is where data, permissions and business rules belong.
- The two usually talk over HTTP, often exchanging JSON through an API.
- Never trust checks made only in the front end; the server must repeat them.
- Full stack describes breadth, and most people are still stronger on one side.
The front end is the part of a website or app that runs on your device: what you see, tap and type into. The back end is the part that runs on servers: it stores data, applies the rules and answers requests. Full-stack work means being able to build across both.
The terms describe where code runs and what it's responsible for. Knowing the split helps you plan a project, read a job description or work out where a bug lives.
One request, both sides
Say you open an online shop and search for a lamp. The page you type into is front end. When you press Enter, the browser sends a request across the network. A server receives it, asks a database for matching products, and sends results back. The browser displays them.
This client and server arrangement underlies nearly everything on the web; clients and servers covers the model.
The front end
In a browser, the front end rests on three languages. HTML describes content and structure: headings, paragraphs, forms, links. CSS controls appearance and layout. JavaScript adds behavior. HTML, CSS and JavaScript looks at each.
When the browser loads a page, it turns that code into a live tree of objects called the DOM, which scripts can read and change.
Front-end work includes more than looks:
- Layouts that adapt to phones, tablets and wide screens.
- Accessibility, so keyboard and screen reader users can do everything others can.
- Speed, since large scripts and images slow pages, especially on modest devices.
- Handling loading, empty and error states, so a slow network doesn't leave a blank screen.
- Support for different browsers.
Many teams use a framework or library to organize interface code. These change over time; the underlying web platform changes far more slowly, which makes it the better thing to learn first.
Everything sent to the browser can be read by the user. Minifying code makes it harder to read, not secret. API keys that must stay private don't belong there.
The back end
Back-end code can be written in many languages, including JavaScript, Python, PHP, Java, C#, Go and Ruby. It typically handles:
- Routing: deciding which code answers each address.
- Authentication and authorization: who you are, and what you're allowed to do.
- Business rules: prices, limits, workflows.
- Data storage: reading and writing SQL or NoSQL databases, files and caches.
- Integration: payment processors, email services and other systems.
- Background work: scheduled jobs and queues for slow tasks.
It also covers operating concerns such as logs, backups, monitoring and security updates. A feature isn't finished when it works once on a developer's laptop.
How the two communicate
The front end and back end agree on a contract, usually an API over HTTP. The browser sends a method and an address, sometimes with a body, and the server returns a status code and data, commonly JSON. REST and GraphQL are two popular styles.
In the browser, JavaScript makes these calls without reloading the page, as shown in fetch and asynchronous requests. Some applications also keep a connection open so the server can push updates.
A clear contract lets two people or teams work independently: one can build the screen against sample responses while the other builds the real endpoint.
Where the HTML gets built
There are several approaches, and many sites mix them.
- Server rendering: the server builds complete HTML for each request. It shows content quickly and works well for search engines and weak devices.
- Static generation: pages are built ahead of time and served as files. Fast and simple to host; see static site generators.
- Client rendering: the server sends a light page and JavaScript builds the interface in the browser. It suits highly interactive tools but depends on scripts loading and running.
Choose by what the site does. A blog rarely needs an elaborate client application. A drawing tool does.
Never trust the client
This rule protects most applications. A user, or anyone imitating one, can edit the page, disable scripts or send requests directly with a tool such as curl. So a greyed-out button, a hidden field or a JavaScript check is a convenience, not a control.
The server must validate every input and check permission on every request. If your page hides the "delete" button from ordinary users, the delete endpoint still has to refuse them. Databases should be queried with parameters rather than strings glued together, and output must be escaped, topics covered in injection and scripting flaws.
Accounts and sessions: a shared job
Signing in shows how closely the two sides cooperate. The front end presents the form, sends the credentials over HTTPS and shows helpful messages. The back end checks them against a stored password hash, never a plain-text password, and starts a session. Usually it sends back a cookie that the browser returns with later requests.
From then on, the server decides on each request who is asking and what they may do. The front end may remember a display name so it can greet the user, but that memory grants nothing. If the session expires, the server refuses the request and the interface should offer to sign in again without losing what the person typed.
Security choices are split in the same way. Cookie settings such as HttpOnly, Secure and SameSite are set by the server and enforced by the browser. How cookies work explains each. Many projects hand sign-in to an established library or identity service instead of writing it from scratch, which is generally the safer path.
Performance has two halves
A page can feel slow for reasons on either side. A back end can take too long to produce a response, perhaps because of an inefficient database query or a slow outside service. A front end can receive its data quickly and then spend seconds downloading and running scripts, or laying out huge images.
Measure before assigning blame. The network panel in developer tools shows how long the server took to send the first byte and how long everything after that took. Caching, compression and a content delivery network sit between the two halves and often give large gains for little code. Why websites load slowly covers the common causes.
What full stack means
A full-stack developer can take a feature from interface to database: design the form, write the endpoint, create the table and deploy it. That's valuable in small teams and personal projects, where one person has to see the whole picture.
It doesn't mean mastery of everything. The field is wide, and most people go deep in one area while staying competent in others. Related roles, such as design, database administration, operations and security, often sit alongside.
Where to start
Along the way, learn version control with Git early. Finish small projects instead of collecting tutorials; a working to-do list that survives a page reload teaches the whole loop. When you're ready to publish, deploying a website walks through the move.
Finding where a bug lives
Open the browser's developer tools. If the request is never sent, or the data arrives correctly but displays wrongly, look at the front end. If the request goes out properly and the response has a 500 status or wrong data, look at the back end and its logs. If the status mentions permissions or a blocked cross-origin request, the cause is usually in server configuration, even though the message appears in the browser.
Hosted services and serverless options
The line between the two sides has become more flexible. Hosted platforms offer ready-made databases, sign-in and file storage that a front end can use with only small pieces of custom server code. "Serverless" functions run your back-end code on demand without you managing a machine.
The responsibilities don't vanish. Someone still has to write access rules, protect secrets, validate input, watch costs and plan for what happens if the service changes. A permission rule configured in a dashboard is back-end logic, and a mistake there exposes data just as surely as a bug in code.
Common questions
Is a mobile app front end?
Yes. The app on your phone is a client, and it normally talks to a back end much as a web page does.
Which side is harder?
They are hard in different ways. Front-end work has to cope with many screens, browsers and users. Back-end work has to keep data correct, private and available. Try a small piece of each before choosing.
Do I need a back end at all?
Not for a site whose pages are the same for everyone. Once you need accounts, shared data or private keys, something has to run on a server, whether you manage it or rent it as a service.