# blocknextai/blocknext architecture

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

- Interactive diagram: https://gitdiagram.com/blocknextai/blocknext
- Repository: https://github.com/blocknextai/blocknext

## Overview

BlockNext is a no-code platform for designing and running AI-powered workflows. Users sign in, configure credentials and triggers, compose flows in the visual editor, then start runs manually, on a schedule, or through external requests; the platform executes tasks and streams progress to the live execution view. README-documented branches include AI/integration nodes, natural-language node configuration, MCP tools, and credential management. The tree identifies these subsystems, but most runtime wiring is unsampled, so only README-supported relationships are shown and remain unverified.

Main entry points: [`apps/platform-api/internal/modules/executions/internal/application/taskexecutions/service.go`](https://github.com/blocknextai/blocknext/blob/main/apps/platform-api/internal/modules/executions/internal/application/taskexecutions/service.go) (Task and node execution), [`apps/platform/src/main.tsx`](https://github.com/blocknextai/blocknext/blob/main/apps/platform/src/main.tsx) (Platform UI), [`apps/platform/src/lib/ws-manager.ts`](https://github.com/blocknextai/blocknext/blob/main/apps/platform/src/lib/ws-manager.ts) (Live execution view), [`apps/platform-api/internal/modules/account/internal/http/routes.go`](https://github.com/blocknextai/blocknext/blob/main/apps/platform-api/internal/modules/account/internal/http/routes.go) (Account endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_web["Platform UI<br/>[main.tsx]"]
  node_routes["Page routing<br/>[routes.tsx]"]
  node_ws_client["Live execution view<br/>[ws-manager.ts]"]
end

subgraph group_identity["Identity and access"]
  node_account_routes["Account endpoints<br/>[routes.go]"]
  node_account_usecases["Account services"]
  node_account_storage[("Account persistence")]
end

subgraph group_workflow["Workflow authoring"]
  node_editor["Visual flow editor"]
  node_node_catalog["Node catalog client<br/>[node-engine.ts]"]
  node_node_hooks["Node engine hooks<br/>[use-node-engine.ts]"]
  node_generation["Flow generation"]
  node_workflows["Workflow endpoints<br/>[routes.go]"]
end

subgraph group_runtime["Workflow runtime"]
  node_triggers["Trigger endpoints<br/>[routes.go]"]
  node_execution["Task and node execution<br/>[service.go]"]
  node_lifecycle["Task lifecycle"]
  node_ws["Live progress<br/>[routes.go]"]
  node_history["Execution history<br/>[page.tsx]"]
end

subgraph group_integration["Extensions and files"]
  node_credentials["Credentials management<br/>[routes.go]"]
  node_mcp["MCP server<br/>[routes.go]"]
  node_file_api["File gateway<br/>[main.go]"]
  node_file_storage[("File providers<br/>[storage.go]")]
end

node_user(("Platform user"))
node_mcp_client(("MCP client"))
node_webhook(("Webhook/API caller"))
node_postgres[("PostgreSQL")]
node_ai_services["AI and integrations"]

node_user -->|"uses"| node_web
node_web -->|"renders"| node_routes
node_user -.->|"authenticates"| node_account_routes
node_account_routes -->|"dispatches"| node_account_usecases
node_account_usecases -.->|"persists"| node_account_storage
node_web -.->|"authors flows"| node_editor
node_editor -.->|"uses"| node_node_hooks
node_node_hooks -->|"fetches"| node_node_catalog
node_node_catalog -->|"requests"| node_credentials
node_user -.->|"requests generation"| node_generation
node_generation -.->|"uses Gemini"| node_ai_services
node_user -.->|"manages"| node_credentials
node_user -.->|"configures"| node_triggers
node_webhook -.->|"starts flows"| node_triggers
node_user -.->|"runs flows"| node_workflows
node_workflows -.->|"dispatches tasks"| node_lifecycle
node_lifecycle -.->|"runs tasks"| node_execution
node_execution -.->|"invokes nodes"| node_ai_services
node_execution -.->|"uses files"| node_file_api
node_file_api -.->|"uploads to"| node_file_storage
node_execution -.->|"stores runs"| node_postgres
node_execution -.->|"publishes progress"| node_ws
node_ws_client -.->|"receives updates"| node_ws
node_ws_client -.->|"supports review"| node_history
node_mcp_client -.->|"calls tools"| node_mcp
node_mcp -.->|"runs integration tools"| node_execution

click node_web "https://github.com/blocknextai/blocknext/blob/main/apps/platform/src/main.tsx"
click node_routes "https://github.com/blocknextai/blocknext/blob/main/apps/platform/src/routes.tsx"
click node_editor "https://github.com/blocknextai/blocknext/blob/main/apps/platform/src/features/flow-editor/components/flow-drag-preview.tsx"
click node_node_catalog "https://github.com/blocknextai/blocknext/blob/main/apps/platform/src/features/flow-editor/services/node-engine.ts"
click node_node_hooks "https://github.com/blocknextai/blocknext/blob/main/apps/platform/src/features/flow-editor/hooks/use-node-engine.ts"
click node_generation "https://github.com/blocknextai/blocknext/blob/main/apps/platform/src/features/generation/components/workflow-preview.tsx"
click node_account_routes "https://github.com/blocknextai/blocknext/blob/main/apps/platform-api/internal/modules/account/internal/http/routes.go"
click node_account_usecases "https://github.com/blocknextai/blocknext/tree/main/apps/platform-api/internal/modules/account/internal/usecases"
click node_account_storage "https://github.com/blocknextai/blocknext/tree/main/apps/platform-api/internal/modules/account/internal/postgres"
click node_credentials "https://github.com/blocknextai/blocknext/blob/main/apps/platform-api/internal/modules/nodeengine/internal/http/routes.go"
click node_triggers "https://github.com/blocknextai/blocknext/blob/main/apps/platform-api/internal/modules/triggers/internal/http/routes.go"
click node_workflows "https://github.com/blocknextai/blocknext/blob/main/apps/platform-api/internal/modules/workflows/internal/http/routes.go"
click node_execution "https://github.com/blocknextai/blocknext/blob/main/apps/platform-api/internal/modules/executions/internal/application/taskexecutions/service.go"
click node_lifecycle "https://github.com/blocknextai/blocknext/blob/main/apps/platform-api/internal/modules/taskrunner/internal/application/taskrunner/task_lifecycle_manager.go"
click node_ws "https://github.com/blocknextai/blocknext/blob/main/apps/platform-api/internal/modules/ws/internal/http/routes.go"
click node_history "https://github.com/blocknextai/blocknext/blob/main/apps/platform/src/pages/organizations/%5BorganizationId%5D/history/page.tsx"
click node_mcp "https://github.com/blocknextai/blocknext/blob/main/apps/platform-api/internal/modules/mcp/internal/http/routes.go"
click node_file_api "https://github.com/blocknextai/blocknext/blob/main/apps/file-gateway-api/cmd/file-gateway-api/main.go"
click node_file_storage "https://github.com/blocknextai/blocknext/blob/main/apps/file-gateway-api/internal/modules/storage/storage.go"
click node_ws_client "https://github.com/blocknextai/blocknext/blob/main/apps/platform/src/lib/ws-manager.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_web,node_routes,node_ws_client,node_user,node_mcp_client toneBlue
class node_account_routes,node_account_usecases,node_account_storage,node_postgres toneAmber
class node_editor,node_node_catalog,node_node_hooks,node_generation,node_workflows,node_webhook toneMint
class node_triggers,node_execution,node_lifecycle,node_ws,node_history toneRose
class node_credentials,node_mcp,node_file_api,node_file_storage,node_ai_services toneIndigo
```

## Components

### User experience

- [Platform UI](https://github.com/blocknextai/blocknext/blob/main/apps/platform/src/main.tsx): `apps/platform/src/main.tsx`
- [Page routing](https://github.com/blocknextai/blocknext/blob/main/apps/platform/src/routes.tsx): `apps/platform/src/routes.tsx`
- [Live execution view](https://github.com/blocknextai/blocknext/blob/main/apps/platform/src/lib/ws-manager.ts): `apps/platform/src/lib/ws-manager.ts`

### Identity and access

- [Account endpoints](https://github.com/blocknextai/blocknext/blob/main/apps/platform-api/internal/modules/account/internal/http/routes.go): `apps/platform-api/internal/modules/account/internal/http/routes.go`
- [Account services](https://github.com/blocknextai/blocknext/tree/main/apps/platform-api/internal/modules/account/internal/usecases): `apps/platform-api/internal/modules/account/internal/usecases`
- [Account persistence](https://github.com/blocknextai/blocknext/tree/main/apps/platform-api/internal/modules/account/internal/postgres): `apps/platform-api/internal/modules/account/internal/postgres`

### Workflow authoring

- [Visual flow editor](https://github.com/blocknextai/blocknext/blob/main/apps/platform/src/features/flow-editor/components/flow-drag-preview.tsx): `apps/platform/src/features/flow-editor/components/flow-drag-preview.tsx`
- [Node catalog client](https://github.com/blocknextai/blocknext/blob/main/apps/platform/src/features/flow-editor/services/node-engine.ts): `apps/platform/src/features/flow-editor/services/node-engine.ts`
- [Node engine hooks](https://github.com/blocknextai/blocknext/blob/main/apps/platform/src/features/flow-editor/hooks/use-node-engine.ts): `apps/platform/src/features/flow-editor/hooks/use-node-engine.ts`
- [Flow generation](https://github.com/blocknextai/blocknext/blob/main/apps/platform/src/features/generation/components/workflow-preview.tsx): `apps/platform/src/features/generation/components/workflow-preview.tsx`
- [Workflow endpoints](https://github.com/blocknextai/blocknext/blob/main/apps/platform-api/internal/modules/workflows/internal/http/routes.go): `apps/platform-api/internal/modules/workflows/internal/http/routes.go`

### Workflow runtime

- [Trigger endpoints](https://github.com/blocknextai/blocknext/blob/main/apps/platform-api/internal/modules/triggers/internal/http/routes.go): `apps/platform-api/internal/modules/triggers/internal/http/routes.go`
- [Task and node execution](https://github.com/blocknextai/blocknext/blob/main/apps/platform-api/internal/modules/executions/internal/application/taskexecutions/service.go): `apps/platform-api/internal/modules/executions/internal/application/taskexecutions/service.go`
- [Task lifecycle](https://github.com/blocknextai/blocknext/blob/main/apps/platform-api/internal/modules/taskrunner/internal/application/taskrunner/task_lifecycle_manager.go): `apps/platform-api/internal/modules/taskrunner/internal/application/taskrunner/task_lifecycle_manager.go`
- [Live progress](https://github.com/blocknextai/blocknext/blob/main/apps/platform-api/internal/modules/ws/internal/http/routes.go): `apps/platform-api/internal/modules/ws/internal/http/routes.go`
- [Execution history](https://github.com/blocknextai/blocknext/blob/main/apps/platform/src/pages/organizations/%5BorganizationId%5D/history/page.tsx): `apps/platform/src/pages/organizations/[organizationId]/history/page.tsx`

### Extensions and files

- [Credentials management](https://github.com/blocknextai/blocknext/blob/main/apps/platform-api/internal/modules/nodeengine/internal/http/routes.go): `apps/platform-api/internal/modules/nodeengine/internal/http/routes.go`
- [MCP server](https://github.com/blocknextai/blocknext/blob/main/apps/platform-api/internal/modules/mcp/internal/http/routes.go): `apps/platform-api/internal/modules/mcp/internal/http/routes.go`
- [File gateway](https://github.com/blocknextai/blocknext/blob/main/apps/file-gateway-api/cmd/file-gateway-api/main.go): `apps/file-gateway-api/cmd/file-gateway-api/main.go`
- [File providers](https://github.com/blocknextai/blocknext/blob/main/apps/file-gateway-api/internal/modules/storage/storage.go): `apps/file-gateway-api/internal/modules/storage/storage.go`

### Other components

- **Platform user**
- **MCP client**
- **Webhook/API caller**
- **PostgreSQL**
- **AI and integrations**

## Connections

- Platform user → Platform UI: uses (evidence: `README.md`)
- Platform UI → Page routing: renders (evidence: `apps/platform/src/main.tsx`)
- Platform user → Account endpoints: authenticates (evidence: `README.md`)
- Account endpoints → Account services: dispatches (evidence: `apps/platform-api/internal/modules/account/internal/http/routes.go`)
- Account services → Account persistence: persists
- Platform UI → Visual flow editor: authors flows (evidence: `README.md`)
- Visual flow editor → Node engine hooks: uses
- Node engine hooks → Node catalog client: fetches (evidence: `apps/platform/src/features/flow-editor/hooks/use-node-engine.ts`)
- Node catalog client → Credentials management: requests (evidence: `apps/platform/src/features/flow-editor/services/node-engine.ts`)
- Platform user → Flow generation: requests generation (evidence: `README.md`)
- Flow generation → AI and integrations: uses Gemini (evidence: `README.md`)
- Platform user → Credentials management: manages (evidence: `README.md`)
- Platform user → Trigger endpoints: configures (evidence: `README.md`)
- Webhook/API caller → Trigger endpoints: starts flows (evidence: `README.md`)
- Platform user → Workflow endpoints: runs flows (evidence: `README.md`)
- Workflow endpoints → Task lifecycle: dispatches tasks
- Task lifecycle → Task and node execution: runs tasks
- Task and node execution → AI and integrations: invokes nodes (evidence: `README.md`)
- Task and node execution → File gateway: uses files
- File gateway → File providers: uploads to
- Task and node execution → PostgreSQL: stores runs
- Task and node execution → Live progress: publishes progress (evidence: `README.md`)
- Live execution view → Live progress: receives updates (evidence: `README.md`)
- Live execution view → Execution history: supports review (evidence: `README.md`)
- MCP client → MCP server: calls tools (evidence: `README.md`)
- MCP server → Task and node execution: runs integration tools (evidence: `README.md`)
