# jashkenas/backbone architecture

> Architecture diagram of the GitHub repository jashkenas/backbone, 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/jashkenas/backbone
- Repository: https://github.com/jashkenas/backbone

## Overview

Backbone is a JavaScript application-structure library. An application uses its models, collections, views, and events; routers and browser history handle URL-based navigation, while model and collection operations can synchronize through a RESTful JSON interface. The graph distinguishes these runtime responsibilities and the optional DOM adapter. The README documents the broad product workflow; sampled source confirms selected internal calls. The minified distribution is shown separately; unsampled implementation details are not inferred.

Main entry points: [`backbone.js`](https://github.com/jashkenas/backbone/blob/master/backbone.js) (Models)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_domain["Application structures"]
  node_models["Models<br/>[backbone.js]"]
  node_collections["Collections<br/>[backbone.js]"]
  node_views["Views<br/>[backbone.js]"]
  node_events["Events<br/>[backbone.js]"]
end

subgraph group_navigation["Navigation"]
  node_router["Router<br/>[backbone.js]"]
  node_history["Browser history<br/>[backbone.js]"]
end

subgraph group_transport["Synchronization"]
  node_sync["REST sync<br/>[backbone.js]"]
  node_server(("REST JSON server"))
end

subgraph group_runtime["Runtime support"]
  node_underscore["Underscore"]
  node_dom["DOM adapter"]
  node_runtimecore["Backbone runtime<br/>[backbone.js]"]
  node_minified["Minified runtime<br/>[backbone-min.js]"]
end

node_developer(("Application developer"))

node_developer -->|"uses"| node_models
node_developer -->|"uses"| node_collections
node_developer -->|"uses"| node_views
node_developer -->|"routes with"| node_router
node_models -->|"emits changes"| node_events
node_collections -->|"manages"| node_models
node_router -->|"registers routes"| node_history
node_models -->|"delegates sync"| node_sync
node_collections -->|"delegates sync"| node_sync
node_sync -->|"exchanges JSON"| node_server
node_views -.->|"delegates events"| node_dom
node_runtimecore -.->|"uses utilities"| node_underscore

click node_models "https://github.com/jashkenas/backbone/blob/master/backbone.js"
click node_collections "https://github.com/jashkenas/backbone/blob/master/backbone.js"
click node_views "https://github.com/jashkenas/backbone/blob/master/backbone.js"
click node_events "https://github.com/jashkenas/backbone/blob/master/backbone.js"
click node_router "https://github.com/jashkenas/backbone/blob/master/backbone.js"
click node_history "https://github.com/jashkenas/backbone/blob/master/backbone.js"
click node_sync "https://github.com/jashkenas/backbone/blob/master/backbone.js"
click node_runtimecore "https://github.com/jashkenas/backbone/blob/master/backbone.js"
click node_minified "https://github.com/jashkenas/backbone/blob/master/backbone-min.js"

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_models,node_collections,node_views,node_events toneBlue
class node_router,node_history toneAmber
class node_sync,node_server toneMint
class node_underscore,node_dom,node_runtimecore,node_minified toneRose
class node_developer toneIndigo
```

## Components

### Application structures

- [Models](https://github.com/jashkenas/backbone/blob/master/backbone.js): `backbone.js`
- [Collections](https://github.com/jashkenas/backbone/blob/master/backbone.js): `backbone.js`
- [Views](https://github.com/jashkenas/backbone/blob/master/backbone.js): `backbone.js`
- [Events](https://github.com/jashkenas/backbone/blob/master/backbone.js): `backbone.js`

### Navigation

- [Router](https://github.com/jashkenas/backbone/blob/master/backbone.js): `backbone.js`
- [Browser history](https://github.com/jashkenas/backbone/blob/master/backbone.js): `backbone.js`

### Synchronization

- [REST sync](https://github.com/jashkenas/backbone/blob/master/backbone.js): `backbone.js`
- **REST JSON server**

### Runtime support

- **Underscore**
- **DOM adapter**
- [Backbone runtime](https://github.com/jashkenas/backbone/blob/master/backbone.js): `backbone.js`
- [Minified runtime](https://github.com/jashkenas/backbone/blob/master/backbone-min.js): `backbone-min.js`

### Other components

- **Application developer**

## Connections

- Application developer → Models: uses (evidence: `README.md`)
- Application developer → Collections: uses (evidence: `README.md`)
- Application developer → Views: uses (evidence: `README.md`)
- Application developer → Router: routes with (evidence: `backbone.js`)
- Models → Events: emits changes (evidence: `backbone.js`)
- Collections → Models: manages (evidence: `backbone.js`)
- Router → Browser history: registers routes (evidence: `backbone.js`)
- Models → REST sync: delegates sync (evidence: `backbone.js`)
- Collections → REST sync: delegates sync (evidence: `backbone.js`)
- REST sync → REST JSON server: exchanges JSON (evidence: `README.md`)
- Views → DOM adapter: delegates events
- Backbone runtime → Underscore: uses utilities
