Web applications
Overview
A web application is software accessed through a browser (or webview) that often provides interactive, stateful experiences: accounts, dashboards, forms with validation, real-time updates, and integrations with APIs. Unlike a mostly static marketing site, web apps emphasize application logic, data, and auth.
Key concepts
- Client vs server — UI in the browser; business rules and secrets on the server.
- SPAs & MPAs — Single-page apps (e.g. React router) vs multi-page server-rendered flows.
- APIs — REST, GraphQL, or RPC between client and backend services.
- Authentication & sessions — Cookies, JWTs, OAuth, and secure storage patterns.
- State & caching — Client stores, service workers, CDN and HTTP caching.
Request flow (simplified)
Sample: fetch JSON from an API
async function loadProfile(userId) {
const res = await fetch(`/api/users/${userId}`, {
headers: { Accept: 'application/json' },
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
return res.json();
}