Skip to content

Web Frameworks

This content is for Backend. Switch to the latest version for up-to-date documentation.

A web framework helps you build backend applications faster by giving you common building blocks and a consistent structure.

Even though frameworks look different (Express, Django, Spring, Laravel, ASP.NET), they all solve the same problems.

Routing maps a request to a handler based on:

  • HTTP method (GET/POST/PUT/PATCH/DELETE)
  • URL path (like /users/42)

Example idea (framework-agnostic):

  • GET /users → list users
  • GET /users/:id → get one user

Frameworks provide an abstraction for:

  • the incoming request (headers, params, body)
  • the outgoing response (status code, JSON/HTML)

You always do the same flow:

  1. Read input from the request
  2. Execute business logic
  3. Return a response

Most frameworks have a concept of “code that runs before/after your routes”.

Typical uses:

  • logging
  • authentication
  • rate limiting
  • adding shared data to the request

Naming differs:

  • Express: middleware
  • Spring: filters, interceptors
  • ASP.NET: middleware
  • NestJS: guards, interceptors

A handler (sometimes called a controller action) is the function that runs when a route matches.

Handlers are usually kept small and call services/helpers to do the real work.

Frameworks provide a standard way to:

  • handle “not found” routes
  • return consistent server errors
  • centralize error formatting

Almost every backend needs to read request bodies:

  • JSON (application/json)
  • form data (application/x-www-form-urlencoded)
  • file uploads (multipart/form-data)

Frameworks either include body parsing or plug it in.

Many frameworks can serve static files (images, CSS, downloads) or integrate with a reverse proxy.

Frameworks support:

  • configuration files
  • environment variables
  • dev vs production behavior

Frameworks don’t have to include databases, but most projects add:

  • an ORM/query builder
  • migrations
  • connection pooling

This is the same idea written in different frameworks:

ConceptExpress (Node)Django (Python)Spring (Java)Laravel (PHP)
Routeapp.get('/users', ...)path('users/', ...)@GetMapping("/users")Route::get('/users', ...)
Handlerfunctionview function/classcontroller methodcontroller method
Middlewareapp.use(...)middleware classesfilters/interceptorsmiddleware
JSON responseres.json(...)JsonResponse(...)return objectreturn response()->json(...)

You don’t need to memorize syntax—focus on the concept and then learn the framework’s way of writing it.

  • Minimal frameworks (Express): more freedom, less structure
  • Opinionated frameworks (NestJS, Django, Spring): more structure, more built-in patterns
  • Backend APIs (REST, GraphQL)
  • Server-rendered apps (HTML pages)
  • Internal tools and admin panels

Industry examples:

  • Netflix: large Node.js usage for web services
  • Google: heavy Java/Spring usage across many systems
  • Shopify: Ruby on Rails for large parts of its product
Built with passion by Ngineer Lab