What a web framework actually is, the main families of frameworks, real "Hello, world" code in six of them, the vocabulary everyone assumes you already know, and a glossary you can come back to.
A web framework is a collection of pre-written code and rules that handles the boring, repetitive parts of building a website or web API — so you can write only the parts that are unique to your project.
Almost every web app has to do the same things:
A framework gives you all of that out of the box. You fill in the blanks.
| Library | Framework | |
|---|---|---|
| Who's in charge? | Your code calls the library. | The framework calls your code. |
| You decide… | When and whether to use it. | Where your code plugs in; the framework decides the flow. |
| Examples | Lodash, Axios, date-fns, jQuery | Express, Django, Rails, Next.js, Spring Boot |
Every web request is a conversation between two computers. Frameworks exist on both sides, and knowing which side you're on clears up a lot of confusion.
| Client side (front-end) | Server side (back-end) | |
|---|---|---|
| Runs on | The user's browser / phone | A machine you control |
| Language | JavaScript / TypeScript (basically always) | Anything: Python, JS, Java, Ruby, Go, PHP, C#, Rust… |
| Job | Draw the interface, react to clicks, talk to the server | Store data, enforce rules, authenticate users, serve responses |
| Frameworks | React, Vue, Svelte, Angular | Express, Django, Rails, Laravel, Spring Boot, ASP.NET Core |
| Can the user see the code? | Yes — always. Never put secrets here. | No. |
Some frameworks deliberately blur the line — Next.js, Nuxt, SvelteKit and Remix let you write front-end and back-end code in the same project. These are often called meta-frameworks or full-stack frameworks.
"Web framework" is an umbrella term. These are the buckets beginners actually encounter.
| Family | What it does | Notable examples | Language |
|---|---|---|---|
| Micro / minimal server | A thin HTTP layer: routes + middleware. You assemble the rest. | Express, Fastify, Koa, Flask, Sinatra, Echo | JS, Python, Ruby, Go |
| Full-stack / "batteries included" | Routing, ORM, auth, admin panel, migrations — all built in. | Django, Ruby on Rails, Laravel, Spring Boot, ASP.NET Core | Python, Ruby, PHP, Java, C# |
| Front-end component frameworks | Build interactive UIs from reusable components in the browser. | React, Vue, Svelte, Angular, Solid | JS / TS |
| Meta-frameworks | Wrap a front-end framework and add routing, server rendering, APIs. | Next.js, Nuxt, SvelteKit, Remix, Angular Universal | JS / TS |
| Static site generators | Pre-build every page to HTML at build time. No server needed. | Astro, Eleventy, Hugo, Jekyll, Gatsby | Many |
| API-first / RPC | Serve data, not pages. Often used for mobile apps. | FastAPI, NestJS, gRPC, GraphQL servers | Python, JS, Go |
The same trivial app — respond to GET / with "Hello, world!" —
in six popular frameworks. Notice how much is framework convention
versus your code.
const express = require('express');
const app = express();
app.get('/', (req, res) => {
res.send('Hello, world!');
});
app.listen(3000, () => console.log('http://localhost:3000'));
from flask import Flask
app = Flask(__name__)
@app.route("/")
def home():
return "Hello, world!"
if __name__ == "__main__":
app.run(debug=True)
Django splits this across files by convention. You write the view and register the URL.
views.pyfrom django.http import HttpResponse
def home(request):
return HttpResponse("Hello, world!")
urls.py
from django.urls import path
from . import views
urlpatterns = [
path("", views.home, name="home"),
]
Rails.application.routes.draw do
get "/", to: "home#index"
end
app/controllers/home_controller.rb
class HomeController < ApplicationController
def index
render plain: "Hello, world!"
end
end
Rails infers file locations from names. That's the whole idea behind convention over configuration.
React doesn't have "routes" or a server. It renders components. This one uses state — data the component remembers between renders.
Hello.jsximport { useState } from 'react';
function Hello() {
const [name, setName] = useState('world');
return (
<div>
<h1>Hello, {name}!</h1>
<button onClick={() => setName('friend')}>
Greet
</button>
</div>
);
}
export default Hello;
Here the file path is the route. Creating
app/page.tsx automatically creates the page at /.
export default function Page() {
return <h1>Hello, world!</h1>;
}
import org.springframework.web.bind.annotation.*;
@RestController
public class HelloController {
@GetMapping("/")
public String home() {
return "Hello, world!";
}
}
These ideas appear in nearly every framework, sometimes under different names. Learn them once and you can read any framework's documentation.
Mapping a URL + HTTP method to a function. This is the heart of every server framework.
app.get('/users/:id', handler) // Express: GET /users/42
@app.route("/users/<int:id>") # Flask
path("users/<int:id>/", view) # Django
A function that sits in front of your handlers and can inspect, modify, allow, or reject a request before it reaches them. Logging, auth, CORS, compression, and parsing request bodies are all typically middleware. Think of it as an assembly line.
app.use((req, res, next) => {
console.log(req.method, req.url); // log it
next(); // pass it along
});
app.use(express.json()); // parse JSON bodies
The classic way to split a server app into three responsibilities:
Rails, Laravel, Django (which calls it MVT — Model, View, Template) and Spring MVC all follow this pattern.
Lets you work with database rows as ordinary objects in your language, instead of writing SQL by hand.
# Raw SQL
cursor.execute("SELECT * FROM users WHERE age > 18")
# With an ORM (Django)
User.objects.filter(age__gt=18)
# With an ORM (Prisma / TypeScript)
prisma.user.findMany({ where: { age: { gt: 18 } } })
Related terms: ODM (same idea for document databases like MongoDB), migration (a versioned, scripted change to your database schema), seed (sample data for development).
Generating HTML on the server by filling placeholders with data.
<!-- Jinja2 (Flask/Django-style) -->
<h1>Hello, {{ user.name }}</h1>
<ul>
{% for item in items %}
<li>{{ item.title }}</li>
{% endfor %}
</ul>
Front-end framework vocabulary:
useState, useEffect) that gives a component access to framework features.
The framework assumes sensible defaults based on naming, so you write less
setup code. In Rails, a model named User is assumed to map to
a users table with a UserController — no config
file required. The trade-off: you must learn the conventions, and breaking
them costs you.
rails generate scaffold Post title:string creates a model, controller, views, routes, and migration in one shot).ng, create-react-app, django-admin, artisan).| Strategy | Where HTML is built | Good for |
|---|---|---|
| CSR — Client-Side Rendering | In the browser, after JS loads | App-like dashboards; simple hosting |
| SSR — Server-Side Rendering | On the server, per request | SEO, fast first paint, personalised pages |
| SSG — Static Site Generation | At build time, once | Blogs, docs, marketing pages |
| ISR — Incremental Static Regeneration | At build time, then refreshed in the background | Large content sites that change often |
Instead of a class creating the things it needs, they're handed to it from outside. Common in Angular, Spring, NestJS and ASP.NET Core. It makes code easier to test, because you can pass in a fake in tests.
Don't optimise for the "best" framework. Optimise for these, in order:
package.json, requirements.txt, Gemfile).GET /api/users.GET, PUT and DELETE should be idempotent; POST usually isn't.| Acronym | Stands for | In one line |
|---|---|---|
| AJAX | Asynchronous JavaScript And XML | Fetching data in the background without reloading the page. Now usually just called fetch. |
| API | Application Programming Interface | A contract for software to talk to software. |
| BFF | Backend For Frontend | A server tailored to one client app. |
| CDN | Content Delivery Network | Caches assets close to users. |
| CI/CD | Continuous Integration / Continuous Delivery | Automatically test and deploy on every push. |
| CLI | Command-Line Interface | The terminal tool a framework ships with. |
| CORS | Cross-Origin Resource Sharing | Browser rule about cross-domain requests. |
| CRUD | Create, Read, Update, Delete | The four basic data operations. |
| CSR | Client-Side Rendering | HTML built in the browser. |
| CSS | Cascading Style Sheets | How things look. |
| DI | Dependency Injection | Dependencies passed in from outside. |
| DOM | Document Object Model | The browser's live tree of the page. |
| DTO | Data Transfer Object | A plain object shaped for sending over the wire. |
| HTML | HyperText Markup Language | The structure of a page. |
| HTTP / HTTPS | HyperText Transfer Protocol (Secure) | The request/response protocol of the web. HTTPS is the encrypted version. |
| IoC | Inversion of Control | "Don't call us, we'll call you." |
| ISR | Incremental Static Regeneration | Static pages that refresh in the background. |
| JS / TS | JavaScript / TypeScript | TypeScript is JavaScript plus static types. |
| JSON | JavaScript Object Notation | The default data format for web APIs. |
| JSX / TSX | JavaScript XML / TypeScript XML | HTML-like syntax inside JS/TS. Used by React. |
| JWT | JSON Web Token | A signed token used to prove who a user is. |
| MPA | Multi-Page Application | Classic site: each link loads a new page. |
| MVC / MVT | Model–View–Controller / Model–View–Template | Ways to split an app by responsibility. |
| MVVM | Model–View–ViewModel | MVC variant popular with Angular and Vue. |
| npm | Node Package Manager | The JS ecosystem's package manager and registry. |
| ODM | Object-Document Mapper | Like an ORM, but for document databases (MongoDB). |
| ORM | Object-Relational Mapper | Objects instead of SQL. |
| PWA | Progressive Web App | A website that can install and work offline like an app. |
| REST | REpresentational State Transfer | A convention for designing APIs around URLs and HTTP verbs. |
| RPC | Remote Procedure Call | Calling a function on another machine as if it were local. gRPC is a modern form. |
| RSC | React Server Components | React components that run only on the server. |
| SDK | Software Development Kit | A bundle of tools and libraries for a platform. |
| SEO | Search Engine Optimisation | Making pages rank well in search. The main reason SSR exists. |
| SPA | Single-Page Application | One page, JavaScript swaps the content. |
| SQL | Structured Query Language | The language of relational databases. |
| SSG | Static Site Generation | Pages built once at build time. |
| SSR | Server-Side Rendering | HTML built on the server per request. |
| UI / UX | User Interface / User Experience | What it looks like / how it feels to use. |
| URL | Uniform Resource Locator | A web address. |
| XML | eXtensible Markup Language | An older, verbose data format. Mostly replaced by JSON. |
| YAML | YAML Ain't Markup Language | A human-friendly config format. Watch your indentation. |