expressjs/express architecture diagram
How expressjs/express is built, drawn from its code at 43fca52 on 2026-11-08 by Plotix's agent.
Structure
How the express package is split: the factory, the Application prototype, Request and Response, View, and the parts it depends on.
Open the picture for full size (SVG).
Parts
- App factory
Builds the app function · Mixes in EventEmitter and proto · Exports middleware helpers - Application
use / route / param · handle() dispatch · listen / render / engine - Request
Extends IncomingMessage · accepts / is / range · ip / protocol / query - Response
Extends ServerResponse · send / json / render · cookie / redirect / sendFile - View
Resolves the view file · Picks engine by extension - Utils
ETag and query parser · Trust proxy compile - Router
- Body parser
- Static files
- Final handler
- Node http server
- Template engines
How they connect
- Node http server → Application request handler
- App factory → Application
- App factory → Body parser
- App factory → Static files
- Application → Router router.handle()
- Application → Request
- Application → Response
- Application → View app.render()
- View → Template engines engine(path, opts)
- Application → Final handler no route matched
- Request → Utils
- Response → Utils
Request flow
What happens to one HTTP request, from the Node server through the app router to a response or the final handler.
Open the picture for full size (SVG).
Parts
- HTTP client
- Node http server
- Express app
- Router
- Middleware stack
- Response
- Final handler
How they connect
- HTTP client → Node http server GET /users/1
- Node http server → Express app handle(req, res)
- Express app → Router router.handle()
- Router → Middleware stack match route, run stack
- Middleware stack → Response res.json(user)
- Response → HTTP client 200 JSON
- Middleware stack → Final handler next(err) or no match
- Final handler → HTTP client 404 or 500 response
Core objects
The main objects a user touches and how they relate to Node's http classes and the router package.
Open the picture for full size (SVG).
Parts
- Application
- Request
- Response
- View
- Router
- Route
- IncomingMessage
- ServerResponse
How they connect
- Request → IncomingMessage
- Response → ServerResponse
- Application → Router
- Router → Route
- Application → View
- Application → Request
- Application → Response
Draw your own repo
Plotix's agent reads your code and draws its architecture, and the diagram warns you when the code moves on.
Try Plotix