Frontend and backend
Also called frontend vs backend, client and server, or full stack
The two halves of a web app: the frontend runs in the browser and draws what you see, and the backend runs on a server and handles data.
Add a backend endpoint that returns the signed-in user's habits from the database as JSON, and have the frontend fetch it to render the list with a loading state and an error message. Keep the database query and any keys on the server.
Paste into Layerwise or any AI coding tool.
Frontend and backend explained
The frontend is everything in the browser: pages, buttons, forms, and animations, built with HTML, CSS, and JavaScript, often using React. The backend runs on a server. It stores data in a database, checks who is signed in, talks to other services with secret keys, and sends email.
The two talk through requests. When you open a habit list, the frontend asks the backend for your habits, the backend reads them from the database and sends them back as JSON, and the frontend draws the list.
Anything secret or that must be trusted belongs on the backend: API keys, payment logic, and permission checks. Anyone using the site can read and change frontend code. A full-stack app has both, and frameworks such as Next.js keep them in one project.
Related terms
All termsAPI
A set of rules that lets one program ask another for data or actions, usually by sending a request to a URL and getting JSON back.
Database
An organized store for your app's data, such as users, posts, or orders, kept in tables so the app can save, find, and update it.
Deploy
Building your app and publishing it to servers so anyone can use it at a public URL. Each deploy puts a new version live.
Loading state
The view a screen shows while its data is on the way, designed together with the outcomes that follow: loaded, empty, or error.
Build it with Layerwise
Describe your app, watch it run in a live preview, and publish it with a database, storage, and sign-in built in.