# sagnik-11j/nodebase architecture

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

- Interactive diagram: https://gitdiagram.com/sagnik-11j/nodebase
- Repository: https://github.com/sagnik-11j/nodebase

## Overview

Nodeabase is a workflow-building web application: users manage workflows, edit connected trigger/action nodes, and can view executions. The sampled workflow router supports listing, creating, loading, saving, renaming, and deleting workflows, persisting graph nodes and connections in PostgreSQL. The repository also includes manual-trigger and HTTP-request node interfaces and an Inngest integration, but the sampled runtime code does not establish how saved workflows become executed; that relationship is therefore not asserted. Several dashboard and account paths are known from the tree, while their implementations were not sampled.

Main entry points: [`src/lib/auth.ts`](https://github.com/sagnik-11j/nodebase/blob/main/src/lib/auth.ts) (Authentication), [`src/trpc/init.ts`](https://github.com/sagnik-11j/nodebase/blob/main/src/trpc/init.ts) (tRPC procedures), [`src/app/(dashboard)/(rest)/workflows/page.tsx`](https://github.com/sagnik-11j/nodebase/blob/main/src/app/(dashboard)/(rest)/workflows/page.tsx) (Workflow pages), [`src/app/(dashboard)/(editor)/workflows/[workflowId]/page.tsx`](https://github.com/sagnik-11j/nodebase/blob/main/src/app/(dashboard)/(editor)/workflows/%5BworkflowId%5D/page.tsx) (Editor page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Workflow interface"]
  node_workflow_pages["Workflow pages<br/>[page.tsx]"]
  node_workflow_list["Workflow list<br/>[workflows.tsx]"]
  node_entity_ui["Entity components"]
  node_editor_page["Editor page<br/>[page.tsx]"]
  node_editor["Workflow editor<br/>[editor.tsx]"]
  node_editor_header["Editor header<br/>[editor-header.tsx]"]
  node_node_registry["Node registry<br/>[node-components.ts]"]
  node_trigger_nodes["Manual trigger<br/>[node.tsx]"]
  node_request_nodes["HTTP request node<br/>[node.tsx]"]
end

subgraph group_workflow["Workflow management"]
  node_workflow_hook["Workflow queries<br/>[use-workflows.ts]"]
  node_workflow_router["Workflow procedures<br/>[routers.ts]"]
  node_prefetch["Workflow prefetch<br/>[prefetch.ts]"]
  node_workflow_params["Page parameters<br/>[params-loader.ts]"]
end

subgraph group_platform["Application platform"]
  node_db[("PostgreSQL database<br/>[index.ts]")]
  node_schema["Data schema<br/>[schema.ts]"]
  node_trpc_endpoint["tRPC endpoint<br/>[route.ts]"]
  node_app_router["Application router<br/>[_app.ts]"]
  node_trpc_init["tRPC procedures<br/>[init.ts]"]
  node_trpc_server["Server tRPC<br/>[server.tsx]"]
  node_trpc_client["Browser tRPC<br/>[client.tsx]"]
  node_query_client["Query cache<br/>[query-client.ts]"]
end

subgraph group_identity["Identity and billing"]
  node_auth_route["Auth endpoint<br/>[route.ts]"]
  node_auth["Authentication<br/>[auth.ts]"]
  node_auth_utils["Auth utilities<br/>[auth-utils.ts]"]
  node_polar["Polar billing<br/>[polar.ts]"]
end

subgraph group_runtime["Execution runtime"]
  node_execution_pages["Execution pages<br/>[page.tsx]"]
  node_execution_detail["Execution detail<br/>[page.tsx]"]
  node_inngest_endpoint["Inngest endpoint<br/>[route.ts]"]
  node_inngest_functions["Inngest functions<br/>[functions.ts]"]
  node_inngest_client["Inngest client<br/>[client.ts]"]
end

node_workflow_pages -->|"prefetches"| node_prefetch
node_workflow_pages -->|"renders"| node_workflow_list
node_workflow_pages -->|"loads parameters"| node_workflow_params
node_workflow_list -->|"queries workflows"| node_workflow_hook
node_workflow_list -->|"uses"| node_entity_ui
node_editor_page -->|"prefetches"| node_prefetch
node_editor_page -->|"renders"| node_editor
node_editor_page -->|"renders"| node_editor_header
node_editor -.->|"uses node types"| node_node_registry
node_node_registry -->|"registers"| node_trigger_nodes
node_node_registry -->|"registers"| node_request_nodes
node_workflow_hook -->|"calls"| node_trpc_client
node_workflow_hook -->|"uses parameters"| node_workflow_params
node_prefetch -->|"prefetches through"| node_trpc_server
node_trpc_endpoint -->|"routes through"| node_trpc_init
node_trpc_endpoint -->|"dispatches to"| node_app_router
node_trpc_client -->|"creates cache"| node_query_client
node_trpc_client -->|"types client"| node_app_router
node_trpc_server -->|"creates context"| node_trpc_init
node_trpc_server -->|"creates cache"| node_query_client
node_trpc_server -->|"uses router"| node_app_router
node_app_router -->|"mounts procedures"| node_workflow_router
node_workflow_router -->|"uses protected procedures"| node_trpc_init
node_workflow_router -->|"reads and writes"| node_db
node_workflow_router -->|"queries tables"| node_schema
node_auth_route -->|"serves auth"| node_auth
node_auth -->|"persists identity"| node_db
node_auth -->|"uses schema"| node_schema
node_auth -->|"configures billing"| node_polar
node_trpc_init -->|"checks session"| node_auth
node_trpc_init -->|"checks subscription"| node_polar
node_editor_page -->|"checks access"| node_auth_utils
node_workflow_pages -->|"checks access"| node_auth_utils
node_inngest_endpoint -->|"serves functions"| node_inngest_functions
node_inngest_functions -->|"uses client"| node_inngest_client
node_execution_pages -.->|"execution relationship unclear"| node_inngest_functions
node_execution_detail -.->|"execution relationship unclear"| node_inngest_functions

click node_workflow_pages "https://github.com/sagnik-11j/nodebase/blob/main/src/app/(dashboard)/(rest)/workflows/page.tsx"
click node_workflow_list "https://github.com/sagnik-11j/nodebase/blob/main/src/features/workflows/components/workflows.tsx"
click node_entity_ui "https://github.com/sagnik-11j/nodebase/blob/main/src/components/entity-components.tsx"
click node_editor_page "https://github.com/sagnik-11j/nodebase/blob/main/src/app/(dashboard)/(editor)/workflows/%5BworkflowId%5D/page.tsx"
click node_editor "https://github.com/sagnik-11j/nodebase/blob/main/src/features/editor/components/editor.tsx"
click node_editor_header "https://github.com/sagnik-11j/nodebase/blob/main/src/features/editor/components/editor-header.tsx"
click node_node_registry "https://github.com/sagnik-11j/nodebase/blob/main/src/config/node-components.ts"
click node_trigger_nodes "https://github.com/sagnik-11j/nodebase/blob/main/src/features/triggers/components/manual-trigger/node.tsx"
click node_request_nodes "https://github.com/sagnik-11j/nodebase/blob/main/src/features/executions/components/http-request/node.tsx"
click node_workflow_hook "https://github.com/sagnik-11j/nodebase/blob/main/src/features/workflows/hooks/use-workflows.ts"
click node_workflow_router "https://github.com/sagnik-11j/nodebase/blob/main/src/features/workflows/server/routers.ts"
click node_prefetch "https://github.com/sagnik-11j/nodebase/blob/main/src/features/workflows/server/prefetch.ts"
click node_workflow_params "https://github.com/sagnik-11j/nodebase/blob/main/src/features/workflows/server/params-loader.ts"
click node_db "https://github.com/sagnik-11j/nodebase/blob/main/src/db/index.ts"
click node_schema "https://github.com/sagnik-11j/nodebase/blob/main/src/db/schema.ts"
click node_trpc_endpoint "https://github.com/sagnik-11j/nodebase/blob/main/src/app/api/trpc/%5Btrpc%5D/route.ts"
click node_app_router "https://github.com/sagnik-11j/nodebase/blob/main/src/trpc/routers/_app.ts"
click node_trpc_init "https://github.com/sagnik-11j/nodebase/blob/main/src/trpc/init.ts"
click node_trpc_server "https://github.com/sagnik-11j/nodebase/blob/main/src/trpc/server.tsx"
click node_trpc_client "https://github.com/sagnik-11j/nodebase/blob/main/src/trpc/client.tsx"
click node_query_client "https://github.com/sagnik-11j/nodebase/blob/main/src/trpc/query-client.ts"
click node_auth_route "https://github.com/sagnik-11j/nodebase/blob/main/src/app/api/auth/%5B...all%5D/route.ts"
click node_auth "https://github.com/sagnik-11j/nodebase/blob/main/src/lib/auth.ts"
click node_auth_utils "https://github.com/sagnik-11j/nodebase/blob/main/src/lib/auth-utils.ts"
click node_polar "https://github.com/sagnik-11j/nodebase/blob/main/src/lib/polar.ts"
click node_execution_pages "https://github.com/sagnik-11j/nodebase/blob/main/src/app/(dashboard)/(rest)/executions/page.tsx"
click node_execution_detail "https://github.com/sagnik-11j/nodebase/blob/main/src/app/(dashboard)/(rest)/executions/%5BexecutionId%5D/page.tsx"
click node_inngest_endpoint "https://github.com/sagnik-11j/nodebase/blob/main/src/app/api/inngest/route.ts"
click node_inngest_functions "https://github.com/sagnik-11j/nodebase/blob/main/src/inngest/functions.ts"
click node_inngest_client "https://github.com/sagnik-11j/nodebase/blob/main/src/inngest/client.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_workflow_pages,node_workflow_list,node_entity_ui,node_editor_page,node_editor,node_editor_header,node_node_registry,node_trigger_nodes,node_request_nodes toneBlue
class node_workflow_hook,node_workflow_router,node_prefetch,node_workflow_params toneAmber
class node_db,node_schema,node_trpc_endpoint,node_app_router,node_trpc_init,node_trpc_server,node_trpc_client,node_query_client toneMint
class node_auth_route,node_auth,node_auth_utils,node_polar toneRose
class node_execution_pages,node_execution_detail,node_inngest_endpoint,node_inngest_functions,node_inngest_client toneIndigo
```

## Components

### Workflow interface

- [Workflow pages](https://github.com/sagnik-11j/nodebase/blob/main/src/app/(dashboard)/(rest)/workflows/page.tsx): `src/app/(dashboard)/(rest)/workflows/page.tsx`
- [Workflow list](https://github.com/sagnik-11j/nodebase/blob/main/src/features/workflows/components/workflows.tsx): `src/features/workflows/components/workflows.tsx`
- [Entity components](https://github.com/sagnik-11j/nodebase/blob/main/src/components/entity-components.tsx): `src/components/entity-components.tsx`
- [Editor page](https://github.com/sagnik-11j/nodebase/blob/main/src/app/(dashboard)/(editor)/workflows/%5BworkflowId%5D/page.tsx): `src/app/(dashboard)/(editor)/workflows/[workflowId]/page.tsx`
- [Workflow editor](https://github.com/sagnik-11j/nodebase/blob/main/src/features/editor/components/editor.tsx): `src/features/editor/components/editor.tsx`
- [Editor header](https://github.com/sagnik-11j/nodebase/blob/main/src/features/editor/components/editor-header.tsx): `src/features/editor/components/editor-header.tsx`
- [Node registry](https://github.com/sagnik-11j/nodebase/blob/main/src/config/node-components.ts): `src/config/node-components.ts`
- [Manual trigger](https://github.com/sagnik-11j/nodebase/blob/main/src/features/triggers/components/manual-trigger/node.tsx): `src/features/triggers/components/manual-trigger/node.tsx`
- [HTTP request node](https://github.com/sagnik-11j/nodebase/blob/main/src/features/executions/components/http-request/node.tsx): `src/features/executions/components/http-request/node.tsx`

### Workflow management

- [Workflow queries](https://github.com/sagnik-11j/nodebase/blob/main/src/features/workflows/hooks/use-workflows.ts): `src/features/workflows/hooks/use-workflows.ts`
- [Workflow procedures](https://github.com/sagnik-11j/nodebase/blob/main/src/features/workflows/server/routers.ts): `src/features/workflows/server/routers.ts`
- [Workflow prefetch](https://github.com/sagnik-11j/nodebase/blob/main/src/features/workflows/server/prefetch.ts): `src/features/workflows/server/prefetch.ts`
- [Page parameters](https://github.com/sagnik-11j/nodebase/blob/main/src/features/workflows/server/params-loader.ts): `src/features/workflows/server/params-loader.ts`

### Application platform

- [PostgreSQL database](https://github.com/sagnik-11j/nodebase/blob/main/src/db/index.ts): `src/db/index.ts`
- [Data schema](https://github.com/sagnik-11j/nodebase/blob/main/src/db/schema.ts): `src/db/schema.ts`
- [tRPC endpoint](https://github.com/sagnik-11j/nodebase/blob/main/src/app/api/trpc/%5Btrpc%5D/route.ts): `src/app/api/trpc/[trpc]/route.ts`
- [Application router](https://github.com/sagnik-11j/nodebase/blob/main/src/trpc/routers/_app.ts): `src/trpc/routers/_app.ts`
- [tRPC procedures](https://github.com/sagnik-11j/nodebase/blob/main/src/trpc/init.ts): `src/trpc/init.ts`
- [Server tRPC](https://github.com/sagnik-11j/nodebase/blob/main/src/trpc/server.tsx): `src/trpc/server.tsx`
- [Browser tRPC](https://github.com/sagnik-11j/nodebase/blob/main/src/trpc/client.tsx): `src/trpc/client.tsx`
- [Query cache](https://github.com/sagnik-11j/nodebase/blob/main/src/trpc/query-client.ts): `src/trpc/query-client.ts`

### Identity and billing

- [Auth endpoint](https://github.com/sagnik-11j/nodebase/blob/main/src/app/api/auth/%5B...all%5D/route.ts): `src/app/api/auth/[...all]/route.ts`
- [Authentication](https://github.com/sagnik-11j/nodebase/blob/main/src/lib/auth.ts): `src/lib/auth.ts`
- [Auth utilities](https://github.com/sagnik-11j/nodebase/blob/main/src/lib/auth-utils.ts): `src/lib/auth-utils.ts`
- [Polar billing](https://github.com/sagnik-11j/nodebase/blob/main/src/lib/polar.ts): `src/lib/polar.ts`

### Execution runtime

- [Execution pages](https://github.com/sagnik-11j/nodebase/blob/main/src/app/(dashboard)/(rest)/executions/page.tsx): `src/app/(dashboard)/(rest)/executions/page.tsx`
- [Execution detail](https://github.com/sagnik-11j/nodebase/blob/main/src/app/(dashboard)/(rest)/executions/%5BexecutionId%5D/page.tsx): `src/app/(dashboard)/(rest)/executions/[executionId]/page.tsx`
- [Inngest endpoint](https://github.com/sagnik-11j/nodebase/blob/main/src/app/api/inngest/route.ts): `src/app/api/inngest/route.ts`
- [Inngest functions](https://github.com/sagnik-11j/nodebase/blob/main/src/inngest/functions.ts): `src/inngest/functions.ts`
- [Inngest client](https://github.com/sagnik-11j/nodebase/blob/main/src/inngest/client.ts): `src/inngest/client.ts`

## Connections

- Workflow pages → Workflow prefetch: prefetches (evidence: `src/app/(dashboard)/(rest)/workflows/page.tsx`)
- Workflow pages → Workflow list: renders (evidence: `src/app/(dashboard)/(rest)/workflows/page.tsx`)
- Workflow pages → Page parameters: loads parameters (evidence: `src/app/(dashboard)/(rest)/workflows/page.tsx`)
- Workflow list → Workflow queries: queries workflows (evidence: `src/features/workflows/components/workflows.tsx`)
- Workflow list → Entity components: uses (evidence: `src/features/workflows/components/workflows.tsx`)
- Editor page → Workflow prefetch: prefetches (evidence: `src/app/(dashboard)/(editor)/workflows/[workflowId]/page.tsx`)
- Editor page → Workflow editor: renders (evidence: `src/app/(dashboard)/(editor)/workflows/[workflowId]/page.tsx`)
- Editor page → Editor header: renders (evidence: `src/app/(dashboard)/(editor)/workflows/[workflowId]/page.tsx`)
- Workflow editor → Node registry: uses node types
- Node registry → Manual trigger: registers (evidence: `src/config/node-components.ts`)
- Node registry → HTTP request node: registers (evidence: `src/config/node-components.ts`)
- Workflow queries → Browser tRPC: calls (evidence: `src/features/workflows/hooks/use-workflows.ts`)
- Workflow queries → Page parameters: uses parameters (evidence: `src/features/workflows/hooks/use-workflows.ts`)
- Workflow prefetch → Server tRPC: prefetches through (evidence: `src/features/workflows/server/prefetch.ts`)
- tRPC endpoint → tRPC procedures: routes through (evidence: `src/app/api/trpc/[trpc]/route.ts`)
- tRPC endpoint → Application router: dispatches to (evidence: `src/app/api/trpc/[trpc]/route.ts`)
- Browser tRPC → Query cache: creates cache (evidence: `src/trpc/client.tsx`)
- Browser tRPC → Application router: types client (evidence: `src/trpc/client.tsx`)
- Server tRPC → tRPC procedures: creates context (evidence: `src/trpc/server.tsx`)
- Server tRPC → Query cache: creates cache (evidence: `src/trpc/server.tsx`)
- Server tRPC → Application router: uses router (evidence: `src/trpc/server.tsx`)
- Application router → Workflow procedures: mounts procedures (evidence: `src/trpc/routers/_app.ts`)
- Workflow procedures → tRPC procedures: uses protected procedures (evidence: `src/features/workflows/server/routers.ts`)
- Workflow procedures → PostgreSQL database: reads and writes (evidence: `src/features/workflows/server/routers.ts`)
- Workflow procedures → Data schema: queries tables (evidence: `src/features/workflows/server/routers.ts`)
- Auth endpoint → Authentication: serves auth (evidence: `src/app/api/auth/[...all]/route.ts`)
- Authentication → PostgreSQL database: persists identity (evidence: `src/lib/auth.ts`)
- Authentication → Data schema: uses schema (evidence: `src/lib/auth.ts`)
- Authentication → Polar billing: configures billing (evidence: `src/lib/auth.ts`)
- tRPC procedures → Authentication: checks session (evidence: `src/trpc/init.ts`)
- tRPC procedures → Polar billing: checks subscription (evidence: `src/trpc/init.ts`)
- Editor page → Auth utilities: checks access (evidence: `src/app/(dashboard)/(editor)/workflows/[workflowId]/page.tsx`)
- Workflow pages → Auth utilities: checks access (evidence: `src/app/(dashboard)/(rest)/workflows/page.tsx`)
- Inngest endpoint → Inngest functions: serves functions (evidence: `src/app/api/inngest/route.ts`)
- Inngest functions → Inngest client: uses client (evidence: `src/inngest/functions.ts`)
- Execution pages → Inngest functions: execution relationship unclear
- Execution detail → Inngest functions: execution relationship unclear
