graph LR
UI_Presentation["UI‑Presentation"]
UI_State_Store["UI‑State Store"]
API_Controllers["API‑Controllers"]
Orchestration_Service["Orchestration‑Service"]
Persistence_Repository["Persistence‑Repository"]
Authentication_Session["Authentication & Session"]
External_KG_SDOS["External‑KG & SDOS"]
Config_Env["Config‑& Env"]
Unclassified["Unclassified"]
UI_Presentation -- "reads preferences" --> UI_State_Store
UI_Presentation -- "save flow" --> API_Controllers
UI_Presentation -- "run orchestration" --> API_Controllers
API_Controllers -- "auth context" --> Authentication_Session
API_Controllers -- "business logic" --> Orchestration_Service
Orchestration_Service -- "store metadata / results" --> Persistence_Repository
Orchestration_Service -- "RDF store / orchestration" --> External_KG_SDOS
Persistence_Repository -- "return data" --> API_Controllers
API_Controllers -- "response payload" --> UI_Presentation
Config_Env -- "config" --> UI_Presentation
Config_Env -- "config" --> API_Controllers
Config_Env -- "config" --> Orchestration_Service
Authentication_Session -- "session info" --> UI_Presentation
click UI_Presentation href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/sdos-orchestration-flow-designer/UI_Presentation.md" "Details"
click API_Controllers href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/sdos-orchestration-flow-designer/API_Controllers.md" "Details"
click Orchestration_Service href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/sdos-orchestration-flow-designer/Orchestration_Service.md" "Details"
click Persistence_Repository href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/sdos-orchestration-flow-designer/Persistence_Repository.md" "Details"
click External_KG_SDOS href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/sdos-orchestration-flow-designer/External_KG_SDOS.md" "Details"
The SDOS Orchestration Flow Designer follows a clean, layered architecture. The React UI‑Presentation layer renders the graph canvas, nodes, edges and execution logs, pulling UI preferences from a persisted Zustand UI‑State Store. User actions (save, execute) are sent to thin Next.js API‑Controllers, which first run through the Authentication & Session middleware (Azure AD + OBO token injection). Controllers delegate to the Orchestration‑Service, where the graph payload is validated against a Zod schema (graphSchema.ts) and then either persisted in the relational Persistence‑Repository (Prisma) or pushed to the external Stardog RDF store via stardogService.ts. Asynchronous orchestration requests are forwarded to the SDOS engine using an OBO token obtained from sdosOBO.ts. All external‑system interactions are encapsulated in the External‑KG & SDOS services, keeping the core domain logic independent of third‑party APIs. Configuration and runtime environment validation are performed by src/lib/env.js and the top‑level validateEnv.js. Logging (src/lib/logger.js) is woven throughout for observability. This separation of concerns yields a clear, arrow‑driven data flow that can be directly mapped to a high‑level flow‑graph diagram.
UI‑Presentation [Expand]
React/Next.js SPA components that render the graph canvas, nodes, edges, toolbars and execution logs, receiving data via props or the UI‑State Store.
Related Classes/Methods:
src/components/CustomEdge/CustomEdge.jssrc/components/CircularNode.tsx/index.tsxsrc/components/ActionToolbar/ActionToolbar.tsxsrc/components/ExecutionLog/ExecutionLog.tsx
Zustand store that holds UI‑wide preferences such as connection type and double‑click mode, persisted in localStorage.
Related Classes/Methods:
API‑Controllers [Expand]
Next.js API route handlers that validate requests, apply authentication middleware, and delegate business logic to the Orchestration‑Service.
Related Classes/Methods:
src/pages/api/flow/[id].tssrc/pages/api/execute/async.tssrc/pages/api/persist/index.tssrc/pages/api/flows/index.ts
Orchestration‑Service [Expand]
Core domain layer that validates graph payloads with Zod, interacts with the Stardog RDF store, and obtains OBO tokens for SDOS orchestration.
Related Classes/Methods:
Persistence‑Repository [Expand]
Prisma‑based data‑access layer that defines the relational schema and provides a singleton client for CRUD operations on flow metadata and execution results.
Related Classes/Methods:
Next‑Auth configuration for Azure AD, plus custom middleware that injects OBO tokens into request context for downstream services.
Related Classes/Methods:
External‑KG & SDOS [Expand]
Service layer that encapsulates all interactions with the external Stardog RDF store and the SDOS orchestration engine, re‑using the same implementations as the Orchestration‑Service.
Related Classes/Methods:
Utility modules that load, validate, and expose environment variables at runtime, and provide a logger for observability.
Related Classes/Methods:
Component for all unclassified files and utility functions (Utility functions/External Libraries/Dependencies)
Related Classes/Methods: None