# qaziong/workflow-automation-builder architecture

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

- Interactive diagram: https://gitdiagram.com/qaziong/workflow-automation-builder
- Repository: https://github.com/qaziong/workflow-automation-builder

## Overview

Dynamic Workflow Automation Builder lets users register or sign in, manage their own workflows, then visually edit and save a graph of trigger, action, and condition nodes. The graph is design data only; nodes do not execute. The frontend calls the Express API, which validates and authenticates requests, scopes workflow operations to the owner, and persists workflow data in MongoDB. The graph preserves the documented dashboard, editor, authentication, health, and API responsibilities. Some subsystem links rely on README statements or the source index because their implementation excerpts were not provided.

Main entry points: [`client/src/App.jsx`](https://github.com/qaziong/workflow-automation-builder/blob/main/client/src/App.jsx) (Routes and pages), [`server/src/app.js`](https://github.com/qaziong/workflow-automation-builder/blob/main/server/src/app.js) (Express API), [`client/src/pages/workflows/WorkflowEditorPage.jsx`](https://github.com/qaziong/workflow-automation-builder/blob/main/client/src/pages/workflows/WorkflowEditorPage.jsx) (Workflow editor), [`server/src/routes/auth.routes.js`](https://github.com/qaziong/workflow-automation-builder/blob/main/server/src/routes/auth.routes.js) (Auth routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client_auth["Client authentication"]
  node_app["Routes and pages<br/>[App.jsx]"]
  node_auth_page["Sign-in and registration<br/>[AuthPage.jsx]"]
  node_auth_form["Credential form<br/>[AuthForm.jsx]"]
  node_auth_context["Session context<br/>[AuthContext.jsx]"]
  node_protected_route["Protected routes<br/>[ProtectedRoute.jsx]"]
  node_auth_service["Auth API calls<br/>[authService.js]"]
end

subgraph group_client_workflows["Client workflows"]
  node_dashboard["Workflow dashboard<br/>[DashboardPage.jsx]"]
  node_editor["Workflow editor"]
  node_canvas["Graph canvas<br/>[WorkflowCanvas.jsx]"]
  node_node_config["Node configuration"]
  node_workflow_dialog["Workflow dialog<br/>[WorkflowDialog.jsx]"]
  node_workflow_service["Workflow API calls<br/>[workflowService.js]"]
  node_api_client["HTTP API client<br/>[apiClient.js]"]
end

subgraph group_server_api["Server API"]
  node_api["Express API<br/>[app.js]"]
  node_auth_routes["Auth routes<br/>[auth.routes.js]"]
  node_workflow_routes["Workflow routes<br/>[workflow.routes.js]"]
  node_health_routes["Health endpoint<br/>[health.routes.js]"]
  node_auth_controller["Authentication handlers<br/>[auth.controller.js]"]
  node_workflow_controller["Workflow handlers"]
  node_auth_middleware["Session verification<br/>[auth.middleware.js]"]
  node_body_validation["Body validation"]
  node_server_entry["Server startup<br/>[server.js]"]
end

subgraph group_server_data["Persistence"]
  node_user_model[("User model<br/>[user.model.js]")]
  node_workflow_model[("Workflow model<br/>[workflow.model.js]")]
  node_database_config["Mongo connection<br/>[database.js]"]
end

node_user(("User"))
node_mongodb[("MongoDB")]

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_auth_page
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_editor
node_app -->|"guards routes"| node_protected_route
node_auth_page -->|"renders"| node_auth_form
node_auth_page -->|"uses session"| node_auth_context
node_auth_context -->|"calls"| node_auth_service
node_protected_route -->|"reads session"| node_auth_context
node_dashboard -->|"manages workflows"| node_workflow_service
node_dashboard -->|"renders"| node_workflow_dialog
node_editor -->|"loads and saves"| node_workflow_service
node_editor -->|"renders"| node_canvas
node_editor -->|"uses"| node_node_config
node_auth_service -->|"requests"| node_api_client
node_workflow_service -->|"requests"| node_api_client
node_api_client -->|"sends HTTP"| node_api
node_api -->|"mounts"| node_auth_routes
node_api -->|"mounts"| node_workflow_routes
node_api -->|"mounts"| node_health_routes
node_auth_routes -->|"dispatches"| node_auth_controller
node_auth_routes -->|"protects profile"| node_auth_middleware
node_auth_routes -->|"validates body"| node_body_validation
node_workflow_routes -->|"dispatches"| node_workflow_controller
node_workflow_routes -->|"requires session"| node_auth_middleware
node_workflow_routes -->|"validates body"| node_body_validation
node_auth_controller -->|"creates and reads"| node_user_model
node_auth_middleware -->|"finds user"| node_user_model
node_workflow_controller -->|"reads and writes"| node_workflow_model
node_server_entry -->|"starts"| node_api
node_server_entry -->|"connects"| node_database_config
node_database_config -.->|"connects"| node_mongodb
node_health_routes -.->|"checks availability"| node_mongodb

click node_app "https://github.com/qaziong/workflow-automation-builder/blob/main/client/src/App.jsx"
click node_auth_page "https://github.com/qaziong/workflow-automation-builder/blob/main/client/src/features/auth/components/AuthPage.jsx"
click node_auth_form "https://github.com/qaziong/workflow-automation-builder/blob/main/client/src/features/auth/components/AuthForm.jsx"
click node_auth_context "https://github.com/qaziong/workflow-automation-builder/blob/main/client/src/features/auth/AuthContext.jsx"
click node_protected_route "https://github.com/qaziong/workflow-automation-builder/blob/main/client/src/features/auth/components/ProtectedRoute.jsx"
click node_auth_service "https://github.com/qaziong/workflow-automation-builder/blob/main/client/src/services/authService.js"
click node_dashboard "https://github.com/qaziong/workflow-automation-builder/blob/main/client/src/pages/dashboard/DashboardPage.jsx"
click node_editor "https://github.com/qaziong/workflow-automation-builder/blob/main/client/src/pages/workflows/WorkflowEditorPage.jsx"
click node_canvas "https://github.com/qaziong/workflow-automation-builder/blob/main/client/src/features/workflows/components/WorkflowCanvas.jsx"
click node_node_config "https://github.com/qaziong/workflow-automation-builder/blob/main/client/src/features/workflows/components/NodeConfigurationPanel.jsx"
click node_workflow_dialog "https://github.com/qaziong/workflow-automation-builder/blob/main/client/src/features/workflows/components/WorkflowDialog.jsx"
click node_workflow_service "https://github.com/qaziong/workflow-automation-builder/blob/main/client/src/services/workflowService.js"
click node_api_client "https://github.com/qaziong/workflow-automation-builder/blob/main/client/src/services/apiClient.js"
click node_api "https://github.com/qaziong/workflow-automation-builder/blob/main/server/src/app.js"
click node_auth_routes "https://github.com/qaziong/workflow-automation-builder/blob/main/server/src/routes/auth.routes.js"
click node_workflow_routes "https://github.com/qaziong/workflow-automation-builder/blob/main/server/src/routes/workflow.routes.js"
click node_health_routes "https://github.com/qaziong/workflow-automation-builder/blob/main/server/src/routes/health.routes.js"
click node_auth_controller "https://github.com/qaziong/workflow-automation-builder/blob/main/server/src/controllers/auth.controller.js"
click node_workflow_controller "https://github.com/qaziong/workflow-automation-builder/blob/main/server/src/controllers/workflow.controller.js"
click node_auth_middleware "https://github.com/qaziong/workflow-automation-builder/blob/main/server/src/middleware/auth.middleware.js"
click node_body_validation "https://github.com/qaziong/workflow-automation-builder/blob/main/server/src/middleware/validate-body.middleware.js"
click node_user_model "https://github.com/qaziong/workflow-automation-builder/blob/main/server/src/models/user.model.js"
click node_workflow_model "https://github.com/qaziong/workflow-automation-builder/blob/main/server/src/models/workflow.model.js"
click node_database_config "https://github.com/qaziong/workflow-automation-builder/blob/main/server/src/config/database.js"
click node_server_entry "https://github.com/qaziong/workflow-automation-builder/blob/main/server/src/server.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_app,node_auth_page,node_auth_form,node_auth_context,node_protected_route,node_auth_service,node_user toneBlue
class node_dashboard,node_editor,node_canvas,node_node_config,node_workflow_dialog,node_workflow_service,node_api_client,node_mongodb toneAmber
class node_api,node_auth_routes,node_workflow_routes,node_health_routes,node_auth_controller,node_workflow_controller,node_auth_middleware,node_body_validation,node_server_entry toneMint
class node_user_model,node_workflow_model,node_database_config toneRose
```

## Components

### Client authentication

- [Routes and pages](https://github.com/qaziong/workflow-automation-builder/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Sign-in and registration](https://github.com/qaziong/workflow-automation-builder/blob/main/client/src/features/auth/components/AuthPage.jsx): `client/src/features/auth/components/AuthPage.jsx`
- [Credential form](https://github.com/qaziong/workflow-automation-builder/blob/main/client/src/features/auth/components/AuthForm.jsx): `client/src/features/auth/components/AuthForm.jsx`
- [Session context](https://github.com/qaziong/workflow-automation-builder/blob/main/client/src/features/auth/AuthContext.jsx): `client/src/features/auth/AuthContext.jsx`
- [Protected routes](https://github.com/qaziong/workflow-automation-builder/blob/main/client/src/features/auth/components/ProtectedRoute.jsx): `client/src/features/auth/components/ProtectedRoute.jsx`
- [Auth API calls](https://github.com/qaziong/workflow-automation-builder/blob/main/client/src/services/authService.js): `client/src/services/authService.js`

### Client workflows

- [Workflow dashboard](https://github.com/qaziong/workflow-automation-builder/blob/main/client/src/pages/dashboard/DashboardPage.jsx): `client/src/pages/dashboard/DashboardPage.jsx`
- [Workflow editor](https://github.com/qaziong/workflow-automation-builder/blob/main/client/src/pages/workflows/WorkflowEditorPage.jsx): `client/src/pages/workflows/WorkflowEditorPage.jsx`
- [Graph canvas](https://github.com/qaziong/workflow-automation-builder/blob/main/client/src/features/workflows/components/WorkflowCanvas.jsx): `client/src/features/workflows/components/WorkflowCanvas.jsx`
- [Node configuration](https://github.com/qaziong/workflow-automation-builder/blob/main/client/src/features/workflows/components/NodeConfigurationPanel.jsx): `client/src/features/workflows/components/NodeConfigurationPanel.jsx`
- [Workflow dialog](https://github.com/qaziong/workflow-automation-builder/blob/main/client/src/features/workflows/components/WorkflowDialog.jsx): `client/src/features/workflows/components/WorkflowDialog.jsx`
- [Workflow API calls](https://github.com/qaziong/workflow-automation-builder/blob/main/client/src/services/workflowService.js): `client/src/services/workflowService.js`
- [HTTP API client](https://github.com/qaziong/workflow-automation-builder/blob/main/client/src/services/apiClient.js): `client/src/services/apiClient.js`

### Server API

- [Express API](https://github.com/qaziong/workflow-automation-builder/blob/main/server/src/app.js): `server/src/app.js`
- [Auth routes](https://github.com/qaziong/workflow-automation-builder/blob/main/server/src/routes/auth.routes.js): `server/src/routes/auth.routes.js`
- [Workflow routes](https://github.com/qaziong/workflow-automation-builder/blob/main/server/src/routes/workflow.routes.js): `server/src/routes/workflow.routes.js`
- [Health endpoint](https://github.com/qaziong/workflow-automation-builder/blob/main/server/src/routes/health.routes.js): `server/src/routes/health.routes.js`
- [Authentication handlers](https://github.com/qaziong/workflow-automation-builder/blob/main/server/src/controllers/auth.controller.js): `server/src/controllers/auth.controller.js`
- [Workflow handlers](https://github.com/qaziong/workflow-automation-builder/blob/main/server/src/controllers/workflow.controller.js): `server/src/controllers/workflow.controller.js`
- [Session verification](https://github.com/qaziong/workflow-automation-builder/blob/main/server/src/middleware/auth.middleware.js): `server/src/middleware/auth.middleware.js`
- [Body validation](https://github.com/qaziong/workflow-automation-builder/blob/main/server/src/middleware/validate-body.middleware.js): `server/src/middleware/validate-body.middleware.js`
- [Server startup](https://github.com/qaziong/workflow-automation-builder/blob/main/server/src/server.js): `server/src/server.js`

### Persistence

- [User model](https://github.com/qaziong/workflow-automation-builder/blob/main/server/src/models/user.model.js): `server/src/models/user.model.js`
- [Workflow model](https://github.com/qaziong/workflow-automation-builder/blob/main/server/src/models/workflow.model.js): `server/src/models/workflow.model.js`
- [Mongo connection](https://github.com/qaziong/workflow-automation-builder/blob/main/server/src/config/database.js): `server/src/config/database.js`

### Other components

- **User**
- **MongoDB**

## Connections

- User → Routes and pages: uses (evidence: `client/src/App.jsx`)
- Routes and pages → Sign-in and registration: routes to (evidence: `client/src/App.jsx`)
- Routes and pages → Workflow dashboard: routes to (evidence: `client/src/App.jsx`)
- Routes and pages → Workflow editor: routes to (evidence: `client/src/App.jsx`)
- Routes and pages → Protected routes: guards routes (evidence: `client/src/App.jsx`)
- Sign-in and registration → Credential form: renders (evidence: `client/src/features/auth/components/AuthPage.jsx`)
- Sign-in and registration → Session context: uses session (evidence: `client/src/features/auth/components/AuthPage.jsx`)
- Session context → Auth API calls: calls (evidence: `client/src/features/auth/AuthContext.jsx`)
- Protected routes → Session context: reads session (evidence: `client/src/features/auth/components/ProtectedRoute.jsx`)
- Workflow dashboard → Workflow API calls: manages workflows (evidence: `client/src/pages/dashboard/DashboardPage.jsx`)
- Workflow dashboard → Workflow dialog: renders (evidence: `client/src/pages/dashboard/DashboardPage.jsx`)
- Workflow editor → Workflow API calls: loads and saves (evidence: `client/src/pages/workflows/WorkflowEditorPage.jsx`)
- Workflow editor → Graph canvas: renders (evidence: `client/src/pages/workflows/WorkflowEditorPage.jsx`)
- Workflow editor → Node configuration: uses (evidence: `client/src/pages/workflows/WorkflowEditorPage.jsx`)
- Auth API calls → HTTP API client: requests (evidence: `client/src/services/authService.js`)
- Workflow API calls → HTTP API client: requests (evidence: `client/src/services/workflowService.js`)
- HTTP API client → Express API: sends HTTP (evidence: `client/src/services/apiClient.js`)
- Express API → Auth routes: mounts (evidence: `server/src/app.js`)
- Express API → Workflow routes: mounts (evidence: `server/src/app.js`)
- Express API → Health endpoint: mounts (evidence: `server/src/app.js`)
- Auth routes → Authentication handlers: dispatches (evidence: `server/src/routes/auth.routes.js`)
- Auth routes → Session verification: protects profile (evidence: `server/src/routes/auth.routes.js`)
- Auth routes → Body validation: validates body (evidence: `server/src/routes/auth.routes.js`)
- Workflow routes → Workflow handlers: dispatches (evidence: `server/src/routes/workflow.routes.js`)
- Workflow routes → Session verification: requires session (evidence: `server/src/routes/workflow.routes.js`)
- Workflow routes → Body validation: validates body (evidence: `server/src/routes/workflow.routes.js`)
- Authentication handlers → User model: creates and reads (evidence: `server/src/controllers/auth.controller.js`)
- Session verification → User model: finds user (evidence: `server/src/middleware/auth.middleware.js`)
- Workflow handlers → Workflow model: reads and writes (evidence: `server/src/controllers/workflow.controller.js`)
- Server startup → Express API: starts (evidence: `server/src/server.js`)
- Server startup → Mongo connection: connects (evidence: `server/src/server.js`)
- Mongo connection → MongoDB: connects
- Health endpoint → MongoDB: checks availability
