# biomejs/biome architecture

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

- Interactive diagram: https://gitdiagram.com/biomejs/biome
- Repository: https://github.com/biomejs/biome

## Overview

Biome is a web-language toolchain for formatting, linting, and editor-integrated code health. The main workflow starts with a CLI or editor client, processes project configuration and file discovery, parses source, then formats or analyzes it and returns diagnostics, fixes, or formatted text. The graph also preserves the documented editor/LSP, project scanning, and Grit search capabilities. Internal links are limited to relationships shown in the README or SOURCE INDEX; unsampled implementation details are not inferred.

Main entry points: [`crates/biome_service/src/workspace/server.rs`](https://github.com/biomejs/biome/blob/main/crates/biome_service/src/workspace/server.rs) (Workspace Server), [`crates/biome_cli/src/commands/mod.rs`](https://github.com/biomejs/biome/blob/main/crates/biome_cli/src/commands/mod.rs) (CLI Commands), [`crates/biome_service/src/scanner.rs`](https://github.com/biomejs/biome/blob/main/crates/biome_service/src/scanner.rs) (File Scanner), [`crates/biome_service/src/file_handlers`](https://github.com/biomejs/biome/tree/main/crates/biome_service/src/file_handlers) (Language Dispatch)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Client Entry Points"]
  node_cli["CLI Commands<br/>[mod.rs]"]
  node_lsp["Language Server<br/>[server.rs]"]
end

subgraph group_workspace["Workspace Services"]
  node_workspace_api["Workspace API<br/>[workspace.rs]"]
  node_workspace_server["Workspace Server<br/>[server.rs]"]
  node_project_config["Project Configuration<br/>[configuration.rs]"]
  node_settings["Effective Settings<br/>[settings.rs]"]
  node_projects["Project Management<br/>[projects.rs]"]
  node_scanner["File Scanner<br/>[scanner.rs]"]
  node_workspace_db[("Workspace State<br/>[mod.rs]")]
end

subgraph group_language["Language Processing"]
  node_file_handlers["Language Dispatch"]
  node_js_parser["JavaScript Parser<br/>[program.rs]"]
  node_js_parser_expr["Expression Parser<br/>[expr.rs]"]
  node_js_parser_stmt["Statement Parser<br/>[stmt.rs]"]
  node_css_parser["CSS Parser<br/>[parser.rs]"]
  node_formatter["Language Formatters<br/>[prelude.rs]"]
end

subgraph group_analysis["Analysis and Results"]
  node_analyzer_core["Analyzer Engine<br/>[registry.rs]"]
  node_js_analyzer["JavaScript Rules<br/>[components.rs]"]
  node_diagnostics["Diagnostics<br/>[diagnostics.rs]"]
end

subgraph group_extensions["Search and Migration"]
  node_grit["Grit Queries<br/>[grit_query.rs]"]
  node_migrations["Tool Migrations<br/>[migrate.rs]"]
end

node_developer(("Developer"))
node_editor(("Editor Client"))

node_developer -->|"runs commands"| node_cli
node_editor -->|"sends requests"| node_lsp
node_cli -.->|"requests processing"| node_workspace_api
node_lsp -->|"uses workspace"| node_workspace_api
node_workspace_api -->|"delegates requests"| node_workspace_server
node_workspace_server -->|"loads configuration"| node_project_config
node_workspace_server -->|"reads and updates"| node_workspace_db
node_workspace_server -->|"selects settings"| node_settings
node_workspace_server -->|"selects project"| node_projects
node_workspace_server -->|"invokes scans"| node_scanner
node_scanner -->|"publishes index"| node_workspace_db
node_scanner -->|"reads project data"| node_projects
node_workspace_server -->|"dispatches files"| node_file_handlers
node_file_handlers -.->|"parses JavaScript"| node_js_parser
node_file_handlers -.->|"parses CSS"| node_css_parser
node_js_parser -->|"parses expressions"| node_js_parser_expr
node_js_parser -->|"parses statements"| node_js_parser_stmt
node_workspace_server -.->|"formats documents"| node_formatter
node_workspace_server -.->|"runs analysis"| node_analyzer_core
node_analyzer_core -.->|"dispatches rules"| node_js_analyzer
node_workspace_server -->|"produces diagnostics"| node_diagnostics
node_cli -.->|"offers search"| node_grit
node_cli -.->|"runs migrations"| node_migrations

click node_cli "https://github.com/biomejs/biome/blob/main/crates/biome_cli/src/commands/mod.rs"
click node_lsp "https://github.com/biomejs/biome/blob/main/crates/biome_lsp/src/server.rs"
click node_workspace_api "https://github.com/biomejs/biome/blob/main/crates/biome_service/src/workspace.rs"
click node_workspace_server "https://github.com/biomejs/biome/blob/main/crates/biome_service/src/workspace/server.rs"
click node_project_config "https://github.com/biomejs/biome/blob/main/crates/biome_service/src/configuration.rs"
click node_settings "https://github.com/biomejs/biome/blob/main/crates/biome_service/src/settings.rs"
click node_projects "https://github.com/biomejs/biome/blob/main/crates/biome_service/src/projects.rs"
click node_scanner "https://github.com/biomejs/biome/blob/main/crates/biome_service/src/scanner.rs"
click node_workspace_db "https://github.com/biomejs/biome/blob/main/crates/biome_service/src/db/mod.rs"
click node_file_handlers "https://github.com/biomejs/biome/tree/main/crates/biome_service/src/file_handlers"
click node_js_parser "https://github.com/biomejs/biome/blob/main/crates/biome_js_parser/src/syntax/program.rs"
click node_js_parser_expr "https://github.com/biomejs/biome/blob/main/crates/biome_js_parser/src/syntax/expr.rs"
click node_js_parser_stmt "https://github.com/biomejs/biome/blob/main/crates/biome_js_parser/src/syntax/stmt.rs"
click node_css_parser "https://github.com/biomejs/biome/blob/main/crates/biome_css_parser/src/parser.rs"
click node_formatter "https://github.com/biomejs/biome/blob/main/crates/biome_css_formatter/src/prelude.rs"
click node_analyzer_core "https://github.com/biomejs/biome/blob/main/crates/biome_analyze/src/registry.rs"
click node_js_analyzer "https://github.com/biomejs/biome/blob/main/crates/biome_js_analyze/src/react/components.rs"
click node_diagnostics "https://github.com/biomejs/biome/blob/main/crates/biome_service/src/diagnostics.rs"
click node_grit "https://github.com/biomejs/biome/blob/main/crates/biome_grit_patterns/src/grit_query.rs"
click node_migrations "https://github.com/biomejs/biome/blob/main/crates/biome_cli/src/execute/migrate.rs"

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_cli,node_lsp,node_editor toneBlue
class node_workspace_api,node_workspace_server,node_project_config,node_settings,node_projects,node_scanner,node_workspace_db toneAmber
class node_file_handlers,node_js_parser,node_js_parser_expr,node_js_parser_stmt,node_css_parser,node_formatter toneMint
class node_analyzer_core,node_js_analyzer,node_diagnostics toneRose
class node_grit,node_migrations,node_developer toneIndigo
```

## Components

### Client Entry Points

- [CLI Commands](https://github.com/biomejs/biome/blob/main/crates/biome_cli/src/commands/mod.rs): `crates/biome_cli/src/commands/mod.rs`
- [Language Server](https://github.com/biomejs/biome/blob/main/crates/biome_lsp/src/server.rs): `crates/biome_lsp/src/server.rs`

### Workspace Services

- [Workspace API](https://github.com/biomejs/biome/blob/main/crates/biome_service/src/workspace.rs): `crates/biome_service/src/workspace.rs`
- [Workspace Server](https://github.com/biomejs/biome/blob/main/crates/biome_service/src/workspace/server.rs): `crates/biome_service/src/workspace/server.rs`
- [Project Configuration](https://github.com/biomejs/biome/blob/main/crates/biome_service/src/configuration.rs): `crates/biome_service/src/configuration.rs`
- [Effective Settings](https://github.com/biomejs/biome/blob/main/crates/biome_service/src/settings.rs): `crates/biome_service/src/settings.rs`
- [Project Management](https://github.com/biomejs/biome/blob/main/crates/biome_service/src/projects.rs): `crates/biome_service/src/projects.rs`
- [File Scanner](https://github.com/biomejs/biome/blob/main/crates/biome_service/src/scanner.rs): `crates/biome_service/src/scanner.rs`
- [Workspace State](https://github.com/biomejs/biome/blob/main/crates/biome_service/src/db/mod.rs): `crates/biome_service/src/db/mod.rs`

### Language Processing

- [Language Dispatch](https://github.com/biomejs/biome/tree/main/crates/biome_service/src/file_handlers): `crates/biome_service/src/file_handlers`
- [JavaScript Parser](https://github.com/biomejs/biome/blob/main/crates/biome_js_parser/src/syntax/program.rs): `crates/biome_js_parser/src/syntax/program.rs`
- [Expression Parser](https://github.com/biomejs/biome/blob/main/crates/biome_js_parser/src/syntax/expr.rs): `crates/biome_js_parser/src/syntax/expr.rs`
- [Statement Parser](https://github.com/biomejs/biome/blob/main/crates/biome_js_parser/src/syntax/stmt.rs): `crates/biome_js_parser/src/syntax/stmt.rs`
- [CSS Parser](https://github.com/biomejs/biome/blob/main/crates/biome_css_parser/src/parser.rs): `crates/biome_css_parser/src/parser.rs`
- [Language Formatters](https://github.com/biomejs/biome/blob/main/crates/biome_css_formatter/src/prelude.rs): `crates/biome_css_formatter/src/prelude.rs`

### Analysis and Results

- [Analyzer Engine](https://github.com/biomejs/biome/blob/main/crates/biome_analyze/src/registry.rs): `crates/biome_analyze/src/registry.rs`
- [JavaScript Rules](https://github.com/biomejs/biome/blob/main/crates/biome_js_analyze/src/react/components.rs): `crates/biome_js_analyze/src/react/components.rs`
- [Diagnostics](https://github.com/biomejs/biome/blob/main/crates/biome_service/src/diagnostics.rs): `crates/biome_service/src/diagnostics.rs`

### Search and Migration

- [Grit Queries](https://github.com/biomejs/biome/blob/main/crates/biome_grit_patterns/src/grit_query.rs): `crates/biome_grit_patterns/src/grit_query.rs`
- [Tool Migrations](https://github.com/biomejs/biome/blob/main/crates/biome_cli/src/execute/migrate.rs): `crates/biome_cli/src/execute/migrate.rs`

### Other components

- **Developer**
- **Editor Client**

## Connections

- Developer → CLI Commands: runs commands (evidence: `README.md`)
- Editor Client → Language Server: sends requests (evidence: `README.md`)
- CLI Commands → Workspace API: requests processing
- Language Server → Workspace API: uses workspace (evidence: `crates/biome_lsp/src/server.rs`)
- Workspace API → Workspace Server: delegates requests (evidence: `crates/biome_service/src/workspace.rs`)
- Workspace Server → Project Configuration: loads configuration (evidence: `crates/biome_service/src/workspace/server.rs`)
- Workspace Server → Workspace State: reads and updates (evidence: `crates/biome_service/src/workspace/server.rs`)
- Workspace Server → Effective Settings: selects settings (evidence: `crates/biome_service/src/workspace/server.rs`)
- Workspace Server → Project Management: selects project (evidence: `crates/biome_service/src/workspace/server.rs`)
- Workspace Server → File Scanner: invokes scans (evidence: `crates/biome_service/src/workspace/server.rs`)
- File Scanner → Workspace State: publishes index (evidence: `crates/biome_service/src/scanner.rs`)
- File Scanner → Project Management: reads project data (evidence: `crates/biome_service/src/scanner.rs`)
- Workspace Server → Language Dispatch: dispatches files (evidence: `crates/biome_service/src/workspace/server.rs`)
- Language Dispatch → JavaScript Parser: parses JavaScript
- Language Dispatch → CSS Parser: parses CSS
- JavaScript Parser → Expression Parser: parses expressions (evidence: `crates/biome_js_parser/src/syntax/program.rs`)
- JavaScript Parser → Statement Parser: parses statements (evidence: `crates/biome_js_parser/src/syntax/program.rs`)
- Workspace Server → Language Formatters: formats documents
- Workspace Server → Analyzer Engine: runs analysis
- Analyzer Engine → JavaScript Rules: dispatches rules
- Workspace Server → Diagnostics: produces diagnostics (evidence: `crates/biome_service/src/workspace/server.rs`)
- CLI Commands → Grit Queries: offers search
- CLI Commands → Tool Migrations: runs migrations
