# vaadin/flow architecture

> Architecture diagram of the GitHub repository vaadin/flow, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vaadin/flow
- Repository: https://github.com/vaadin/flow

## Overview

Vaadin Flow is a Java framework for building web applications. A request enters through the servlet integration and service layer; the framework provides UI/component and routing abstractions, while a browser-side client supports application interaction. The tree also shows frontend dependency scanning and build-tool capabilities. The excerpts confirm servlet-to-service creation and UI-backed browser storage operations; most links between runtime subsystems are not shown, so those connections are omitted rather than inferred.

Main entry points: [`flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java`](https://github.com/vaadin/flow/blob/main/flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java) (Flow Service), [`flow-client/src/main/frontend/FlowClient.js`](https://github.com/vaadin/flow/blob/main/flow-client/src/main/frontend/FlowClient.js) (Client Runtime), [`flow-server/src/main/java/com/vaadin/flow/server/VaadinServlet.java`](https://github.com/vaadin/flow/blob/main/flow-server/src/main/java/com/vaadin/flow/server/VaadinServlet.java) (Servlet Entry), [`flow-server/src/main/java/com/vaadin/flow/server/VaadinServletService.java`](https://github.com/vaadin/flow/blob/main/flow-server/src/main/java/com/vaadin/flow/server/VaadinServletService.java) (Servlet Service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_server["Server Runtime"]
  node_servlet["Servlet Entry<br/>[VaadinServlet.java]"]
  node_service["Flow Service<br/>[VaadinService.java]"]
  node_servlet_service["Servlet Service"]
  node_configuration["Deployment Config"]
  node_instantiator["Instance Creation<br/>[Instantiator.java]"]
end

subgraph group_ui["UI and Routing"]
  node_component["Components<br/>[Component.java]"]
  node_ui_state["UI State<br/>[UI.java]"]
  node_router["Server Routing<br/>[Router.java]"]
  node_web_storage["Web Storage API<br/>[WebStorage.java]"]
end

subgraph group_client["Browser Runtime"]
  node_client_entry["Client Bootstrap<br/>[FlowBootstrap.js]"]
  node_client_runtime["Client Runtime<br/>[FlowClient.js]"]
  node_client_connection["Server Communication<br/>[ServerConnector.ts]"]
  node_state_tree["Client State Tree<br/>[StateTree.ts]"]
end

subgraph group_frontend["Frontend Tooling"]
  node_dependency_scanner["Frontend Scanner"]
  node_frontend_tasks["Frontend Tasks"]
  node_node_install["Node Installation<br/>[NodeInstaller.java]"]
end

node_developer(("Application Developer"))
node_browser(("Browser User"))

node_servlet -->|"creates service"| node_servlet_service
node_servlet_service -->|"accepts config"| node_configuration
node_service -->|"uses routing"| node_router
node_service -->|"uses UI"| node_ui_state
node_service -->|"uses instantiator"| node_instantiator
node_instantiator -->|"creates components"| node_component
node_web_storage -->|"executes JavaScript"| node_ui_state
node_developer -.->|"configures app"| node_servlet
node_browser -.->|"opens app"| node_client_entry
node_client_entry -.->|"starts client"| node_client_runtime
node_client_runtime -.->|"uses connection"| node_client_connection
node_client_runtime -.->|"updates state"| node_state_tree
node_developer -.->|"provides app"| node_dependency_scanner
node_dependency_scanner -.->|"informs generation"| node_frontend_tasks
node_frontend_tasks -.->|"requires Node"| node_node_install

click node_servlet "https://github.com/vaadin/flow/blob/main/flow-server/src/main/java/com/vaadin/flow/server/VaadinServlet.java"
click node_service "https://github.com/vaadin/flow/blob/main/flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java"
click node_servlet_service "https://github.com/vaadin/flow/blob/main/flow-server/src/main/java/com/vaadin/flow/server/VaadinServletService.java"
click node_configuration "https://github.com/vaadin/flow/blob/main/flow-server/src/main/java/com/vaadin/flow/function/DeploymentConfiguration.java"
click node_instantiator "https://github.com/vaadin/flow/blob/main/flow-server/src/main/java/com/vaadin/flow/di/Instantiator.java"
click node_component "https://github.com/vaadin/flow/blob/main/flow-server/src/main/java/com/vaadin/flow/component/Component.java"
click node_ui_state "https://github.com/vaadin/flow/blob/main/flow-server/src/main/java/com/vaadin/flow/component/UI.java"
click node_router "https://github.com/vaadin/flow/blob/main/flow-server/src/main/java/com/vaadin/flow/router/Router.java"
click node_web_storage "https://github.com/vaadin/flow/blob/main/flow-server/src/main/java/com/vaadin/flow/component/page/WebStorage.java"
click node_client_entry "https://github.com/vaadin/flow/blob/main/flow-client/src/main/frontend/FlowBootstrap.js"
click node_client_runtime "https://github.com/vaadin/flow/blob/main/flow-client/src/main/frontend/FlowClient.js"
click node_client_connection "https://github.com/vaadin/flow/blob/main/flow-client/src/main/frontend/internal/client/communication/ServerConnector.ts"
click node_state_tree "https://github.com/vaadin/flow/blob/main/flow-client/src/main/frontend/internal/client/flow/StateTree.ts"
click node_dependency_scanner "https://github.com/vaadin/flow/blob/main/flow-build-tools/src/main/java/com/vaadin/flow/server/frontend/scanner/FrontendDependenciesScanner.java"
click node_frontend_tasks "https://github.com/vaadin/flow/blob/main/flow-build-tools/src/main/java/com/vaadin/flow/server/frontend/TaskGenerateBootstrap.java"
click node_node_install "https://github.com/vaadin/flow/blob/main/flow-build-tools/src/main/java/com/vaadin/flow/server/frontend/installer/NodeInstaller.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_servlet,node_service,node_servlet_service,node_configuration,node_instantiator,node_browser toneBlue
class node_component,node_ui_state,node_router,node_web_storage toneAmber
class node_client_entry,node_client_runtime,node_client_connection,node_state_tree toneMint
class node_dependency_scanner,node_frontend_tasks,node_node_install toneRose
class node_developer toneIndigo
```

## Components

### Server Runtime

- [Servlet Entry](https://github.com/vaadin/flow/blob/main/flow-server/src/main/java/com/vaadin/flow/server/VaadinServlet.java): `flow-server/src/main/java/com/vaadin/flow/server/VaadinServlet.java`
- [Flow Service](https://github.com/vaadin/flow/blob/main/flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java): `flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java`
- [Servlet Service](https://github.com/vaadin/flow/blob/main/flow-server/src/main/java/com/vaadin/flow/server/VaadinServletService.java): `flow-server/src/main/java/com/vaadin/flow/server/VaadinServletService.java`
- [Deployment Config](https://github.com/vaadin/flow/blob/main/flow-server/src/main/java/com/vaadin/flow/function/DeploymentConfiguration.java): `flow-server/src/main/java/com/vaadin/flow/function/DeploymentConfiguration.java`
- [Instance Creation](https://github.com/vaadin/flow/blob/main/flow-server/src/main/java/com/vaadin/flow/di/Instantiator.java): `flow-server/src/main/java/com/vaadin/flow/di/Instantiator.java`

### UI and Routing

- [Components](https://github.com/vaadin/flow/blob/main/flow-server/src/main/java/com/vaadin/flow/component/Component.java): `flow-server/src/main/java/com/vaadin/flow/component/Component.java`
- [UI State](https://github.com/vaadin/flow/blob/main/flow-server/src/main/java/com/vaadin/flow/component/UI.java): `flow-server/src/main/java/com/vaadin/flow/component/UI.java`
- [Server Routing](https://github.com/vaadin/flow/blob/main/flow-server/src/main/java/com/vaadin/flow/router/Router.java): `flow-server/src/main/java/com/vaadin/flow/router/Router.java`
- [Web Storage API](https://github.com/vaadin/flow/blob/main/flow-server/src/main/java/com/vaadin/flow/component/page/WebStorage.java): `flow-server/src/main/java/com/vaadin/flow/component/page/WebStorage.java`

### Browser Runtime

- [Client Bootstrap](https://github.com/vaadin/flow/blob/main/flow-client/src/main/frontend/FlowBootstrap.js): `flow-client/src/main/frontend/FlowBootstrap.js`
- [Client Runtime](https://github.com/vaadin/flow/blob/main/flow-client/src/main/frontend/FlowClient.js): `flow-client/src/main/frontend/FlowClient.js`
- [Server Communication](https://github.com/vaadin/flow/blob/main/flow-client/src/main/frontend/internal/client/communication/ServerConnector.ts): `flow-client/src/main/frontend/internal/client/communication/ServerConnector.ts`
- [Client State Tree](https://github.com/vaadin/flow/blob/main/flow-client/src/main/frontend/internal/client/flow/StateTree.ts): `flow-client/src/main/frontend/internal/client/flow/StateTree.ts`

### Frontend Tooling

- [Frontend Scanner](https://github.com/vaadin/flow/blob/main/flow-build-tools/src/main/java/com/vaadin/flow/server/frontend/scanner/FrontendDependenciesScanner.java): `flow-build-tools/src/main/java/com/vaadin/flow/server/frontend/scanner/FrontendDependenciesScanner.java`
- [Frontend Tasks](https://github.com/vaadin/flow/blob/main/flow-build-tools/src/main/java/com/vaadin/flow/server/frontend/TaskGenerateBootstrap.java): `flow-build-tools/src/main/java/com/vaadin/flow/server/frontend/TaskGenerateBootstrap.java`
- [Node Installation](https://github.com/vaadin/flow/blob/main/flow-build-tools/src/main/java/com/vaadin/flow/server/frontend/installer/NodeInstaller.java): `flow-build-tools/src/main/java/com/vaadin/flow/server/frontend/installer/NodeInstaller.java`

### Other components

- **Application Developer**
- **Browser User**

## Connections

- Servlet Entry → Servlet Service: creates service (evidence: `flow-server/src/main/java/com/vaadin/flow/server/VaadinServlet.java`)
- Servlet Service → Deployment Config: accepts config (evidence: `flow-server/src/main/java/com/vaadin/flow/server/VaadinServlet.java`)
- Flow Service → Server Routing: uses routing (evidence: `flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java`)
- Flow Service → UI State: uses UI (evidence: `flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java`)
- Flow Service → Instance Creation: uses instantiator (evidence: `flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java`)
- Instance Creation → Components: creates components (evidence: `flow-server/src/main/java/com/vaadin/flow/di/Instantiator.java`)
- Web Storage API → UI State: executes JavaScript (evidence: `flow-server/src/main/java/com/vaadin/flow/component/page/WebStorage.java`)
- Application Developer → Servlet Entry: configures app
- Browser User → Client Bootstrap: opens app
- Client Bootstrap → Client Runtime: starts client
- Client Runtime → Server Communication: uses connection
- Client Runtime → Client State Tree: updates state
- Application Developer → Frontend Scanner: provides app
- Frontend Scanner → Frontend Tasks: informs generation
- Frontend Tasks → Node Installation: requires Node
