# notationlabs/notation architecture

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

- Interactive diagram: https://gitdiagram.com/notationlabs/notation
- Repository: https://github.com/notationlabs/notation

## Overview

Notation is a JavaScript-native serverless deployment toolkit. Developers scaffold an app, define infrastructure and runtime functions, then compile, inspect plans, deploy or destroy resources, and watch development stacks; a dashboard exposes persisted resource state. The graph preserves the compiler, resource/reconciliation lifecycle, AWS API Gateway and event-driven capabilities, runtime handlers, visualization, and starter scaffolding. Several subsystem links are documented or supported by the source index; unsampled internals and provider relationships are not expanded beyond that evidence.

Main entry points: [`packages/cli/src/index.ts`](https://github.com/notationlabs/notation/blob/main/packages/cli/src/index.ts) (Notation CLI), [`packages/cli/src/compile.ts`](https://github.com/notationlabs/notation/blob/main/packages/cli/src/compile.ts) (Infrastructure compiler), [`packages/create-notation/templates/starter/infra/api.ts`](https://github.com/notationlabs/notation/blob/main/packages/create-notation/templates/starter/infra/api.ts) (Infrastructure definition), [`packages/reconciler/src/plan.ts`](https://github.com/notationlabs/notation/blob/main/packages/reconciler/src/plan.ts) (Deployment planning)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_authoring["App authoring"]
  node_starter["Project scaffolder<br/>[scaffold.ts]"]
  node_infra_app["Infrastructure definition<br/>[api.ts]"]
  node_runtime_fn["Function handlers<br/>[todos.fn.ts]"]
end

subgraph group_tooling["CLI and compiler"]
  node_cli["Notation CLI<br/>[index.ts]"]
  node_compiler["Infrastructure compiler<br/>[compile.ts]"]
  node_compile_plugins["Function transforms"]
  node_watcher["Hot replacement<br/>[watch.ts]"]
end

subgraph group_lifecycle["Resource lifecycle"]
  node_resource_model["Resource model<br/>[resource.ts]"]
  node_resource_diff["Resource diff<br/>[diff-params.ts]"]
  node_plan_engine["Deployment planning<br/>[plan.ts]"]
  node_durable_runtime["Durable runtime<br/>[durable-runtime.ts]"]
  node_durable_reconcile["Durable reconciliation<br/>[reconcile.ts]"]
  node_state[("Deployment state<br/>[state.ts]")]
end

subgraph group_providers["Cloud providers"]
  node_aws_api["API Gateway resources<br/>[route.ts]"]
  node_aws_auth["Gateway authorization<br/>[auth.ts]"]
  node_aws_event["EventBridge schedules<br/>[schedule.ts]"]
  node_lambda_runtime["Lambda handlers<br/>[handlers.ts]"]
end

subgraph group_visibility["State and visibility"]
  node_dashboard_server["Dashboard state API<br/>[server.ts]"]
  node_dashboard_ui["Dashboard UI<br/>[app.tsx]"]
  node_visualiser["Resource visualizer<br/>[chart.ts]"]
end

node_developer(("Developer"))

node_developer -->|"creates project"| node_starter
node_developer -->|"runs commands"| node_cli
node_cli -->|"compiles app"| node_compiler
node_compiler -->|"configures transforms"| node_compile_plugins
node_compiler -.->|"compiles entrypoint"| node_infra_app
node_compiler -.->|"compiles functions"| node_runtime_fn
node_cli -->|"starts watch"| node_watcher
node_watcher -->|"recompiles"| node_compiler
node_cli -->|"plans changes"| node_plan_engine
node_plan_engine -->|"plans resources"| node_resource_model
node_plan_engine -->|"reads state"| node_state
node_resource_model -->|"compares params"| node_resource_diff
node_cli -->|"deploys or destroys"| node_durable_runtime
node_durable_runtime -->|"runs reconciliation"| node_durable_reconcile
node_durable_runtime -.->|"persists execution state"| node_state
node_durable_reconcile -.->|"reconciles resources"| node_resource_model
node_infra_app -.->|"defines gateway"| node_aws_api
node_aws_api -->|"configures authorization"| node_aws_auth
node_cli -->|"starts dashboard"| node_dashboard_server
node_dashboard_server -->|"reads snapshots"| node_state
node_dashboard_ui -.->|"receives remote state"| node_dashboard_server
node_cli -->|"visualizes resources"| node_visualiser
node_runtime_fn -.->|"uses runtime handlers"| node_lambda_runtime
node_infra_app -.->|"defines schedules"| node_aws_event

click node_starter "https://github.com/notationlabs/notation/blob/main/packages/create-notation/src/scaffold.ts"
click node_infra_app "https://github.com/notationlabs/notation/blob/main/packages/create-notation/templates/starter/infra/api.ts"
click node_runtime_fn "https://github.com/notationlabs/notation/blob/main/packages/create-notation/templates/starter/runtime/todos.fn.ts"
click node_cli "https://github.com/notationlabs/notation/blob/main/packages/cli/src/index.ts"
click node_compiler "https://github.com/notationlabs/notation/blob/main/packages/cli/src/compile.ts"
click node_compile_plugins "https://github.com/notationlabs/notation/blob/main/packages/esbuild-plugins/src/plugins/function-infra-plugin.ts"
click node_watcher "https://github.com/notationlabs/notation/blob/main/packages/cli/src/watch.ts"
click node_resource_model "https://github.com/notationlabs/notation/blob/main/packages/resource/src/resource.ts"
click node_resource_diff "https://github.com/notationlabs/notation/blob/main/packages/resource/src/diff-params.ts"
click node_plan_engine "https://github.com/notationlabs/notation/blob/main/packages/reconciler/src/plan.ts"
click node_durable_runtime "https://github.com/notationlabs/notation/blob/main/packages/core/src/provisioner/durable-runtime.ts"
click node_durable_reconcile "https://github.com/notationlabs/notation/blob/main/packages/reconciler/src/durable/reconcile.ts"
click node_state "https://github.com/notationlabs/notation/blob/main/packages/state/src/state.ts"
click node_aws_api "https://github.com/notationlabs/notation/blob/main/packages/aws.iac/src/resources/api-gateway/route.ts"
click node_aws_auth "https://github.com/notationlabs/notation/blob/main/packages/aws.iac/src/resources/api-gateway/auth.ts"
click node_aws_event "https://github.com/notationlabs/notation/blob/main/packages/aws/src/event-bridge/schedule.ts"
click node_lambda_runtime "https://github.com/notationlabs/notation/blob/main/packages/aws/src/lambda.fn/handlers.ts"
click node_dashboard_server "https://github.com/notationlabs/notation/blob/main/packages/dashboard/server/server.ts"
click node_dashboard_ui "https://github.com/notationlabs/notation/blob/main/packages/dashboard/src/app.tsx"
click node_visualiser "https://github.com/notationlabs/notation/blob/main/packages/core/src/visualiser/chart.ts"

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_starter,node_infra_app,node_runtime_fn toneBlue
class node_cli,node_compiler,node_compile_plugins,node_watcher toneAmber
class node_resource_model,node_resource_diff,node_plan_engine,node_durable_runtime,node_durable_reconcile,node_state toneMint
class node_aws_api,node_aws_auth,node_aws_event,node_lambda_runtime toneRose
class node_dashboard_server,node_dashboard_ui,node_visualiser,node_developer toneIndigo
```

## Components

### App authoring

- [Project scaffolder](https://github.com/notationlabs/notation/blob/main/packages/create-notation/src/scaffold.ts): `packages/create-notation/src/scaffold.ts`
- [Infrastructure definition](https://github.com/notationlabs/notation/blob/main/packages/create-notation/templates/starter/infra/api.ts): `packages/create-notation/templates/starter/infra/api.ts`
- [Function handlers](https://github.com/notationlabs/notation/blob/main/packages/create-notation/templates/starter/runtime/todos.fn.ts): `packages/create-notation/templates/starter/runtime/todos.fn.ts`

### CLI and compiler

- [Notation CLI](https://github.com/notationlabs/notation/blob/main/packages/cli/src/index.ts): `packages/cli/src/index.ts`
- [Infrastructure compiler](https://github.com/notationlabs/notation/blob/main/packages/cli/src/compile.ts): `packages/cli/src/compile.ts`
- [Function transforms](https://github.com/notationlabs/notation/blob/main/packages/esbuild-plugins/src/plugins/function-infra-plugin.ts): `packages/esbuild-plugins/src/plugins/function-infra-plugin.ts`
- [Hot replacement](https://github.com/notationlabs/notation/blob/main/packages/cli/src/watch.ts): `packages/cli/src/watch.ts`

### Resource lifecycle

- [Resource model](https://github.com/notationlabs/notation/blob/main/packages/resource/src/resource.ts): `packages/resource/src/resource.ts`
- [Resource diff](https://github.com/notationlabs/notation/blob/main/packages/resource/src/diff-params.ts): `packages/resource/src/diff-params.ts`
- [Deployment planning](https://github.com/notationlabs/notation/blob/main/packages/reconciler/src/plan.ts): `packages/reconciler/src/plan.ts`
- [Durable runtime](https://github.com/notationlabs/notation/blob/main/packages/core/src/provisioner/durable-runtime.ts): `packages/core/src/provisioner/durable-runtime.ts`
- [Durable reconciliation](https://github.com/notationlabs/notation/blob/main/packages/reconciler/src/durable/reconcile.ts): `packages/reconciler/src/durable/reconcile.ts`
- [Deployment state](https://github.com/notationlabs/notation/blob/main/packages/state/src/state.ts): `packages/state/src/state.ts`

### Cloud providers

- [API Gateway resources](https://github.com/notationlabs/notation/blob/main/packages/aws.iac/src/resources/api-gateway/route.ts): `packages/aws.iac/src/resources/api-gateway/route.ts`
- [Gateway authorization](https://github.com/notationlabs/notation/blob/main/packages/aws.iac/src/resources/api-gateway/auth.ts): `packages/aws.iac/src/resources/api-gateway/auth.ts`
- [EventBridge schedules](https://github.com/notationlabs/notation/blob/main/packages/aws/src/event-bridge/schedule.ts): `packages/aws/src/event-bridge/schedule.ts`
- [Lambda handlers](https://github.com/notationlabs/notation/blob/main/packages/aws/src/lambda.fn/handlers.ts): `packages/aws/src/lambda.fn/handlers.ts`

### State and visibility

- [Dashboard state API](https://github.com/notationlabs/notation/blob/main/packages/dashboard/server/server.ts): `packages/dashboard/server/server.ts`
- [Dashboard UI](https://github.com/notationlabs/notation/blob/main/packages/dashboard/src/app.tsx): `packages/dashboard/src/app.tsx`
- [Resource visualizer](https://github.com/notationlabs/notation/blob/main/packages/core/src/visualiser/chart.ts): `packages/core/src/visualiser/chart.ts`

### Other components

- **Developer**

## Connections

- Developer → Project scaffolder: creates project
- Developer → Notation CLI: runs commands (evidence: `packages/cli/src/index.ts`)
- Notation CLI → Infrastructure compiler: compiles app (evidence: `packages/cli/src/index.ts`)
- Infrastructure compiler → Function transforms: configures transforms (evidence: `packages/cli/src/compile.ts`)
- Infrastructure compiler → Infrastructure definition: compiles entrypoint (evidence: `packages/cli/src/compile.ts`)
- Infrastructure compiler → Function handlers: compiles functions (evidence: `packages/cli/src/compile.ts`)
- Notation CLI → Hot replacement: starts watch (evidence: `packages/cli/src/index.ts`)
- Hot replacement → Infrastructure compiler: recompiles (evidence: `packages/cli/src/watch.ts`)
- Notation CLI → Deployment planning: plans changes
- Deployment planning → Resource model: plans resources (evidence: `packages/reconciler/src/plan.ts`)
- Deployment planning → Deployment state: reads state (evidence: `packages/reconciler/src/plan.ts`)
- Resource model → Resource diff: compares params (evidence: `packages/resource/src/resource.ts`)
- Notation CLI → Durable runtime: deploys or destroys
- Durable runtime → Durable reconciliation: runs reconciliation (evidence: `packages/core/src/provisioner/durable-runtime.ts`)
- Durable runtime → Deployment state: persists execution state
- Durable reconciliation → Resource model: reconciles resources
- Infrastructure definition → API Gateway resources: defines gateway
- API Gateway resources → Gateway authorization: configures authorization (evidence: `packages/aws.iac/src/resources/api-gateway/route.ts`)
- Notation CLI → Dashboard state API: starts dashboard (evidence: `packages/cli/src/index.ts`)
- Dashboard state API → Deployment state: reads snapshots (evidence: `packages/dashboard/server/server.ts`)
- Dashboard UI → Dashboard state API: receives remote state
- Notation CLI → Resource visualizer: visualizes resources
- Function handlers → Lambda handlers: uses runtime handlers
- Infrastructure definition → EventBridge schedules: defines schedules
