# OpenNoodl Codebase Quick Navigation ## πŸ—ΊοΈ Package Map ``` β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ MONOREPO ROOT β”‚ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚ package.json β†’ Workspace config, global scripts β”‚ β”‚ lerna.json β†’ Monorepo management β”‚ β”‚ scripts/ β†’ Build and CI scripts β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β–Ό β–Ό β–Ό β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ EDITOR (GPL) β”‚ β”‚ RUNTIME (MIT) β”‚ β”‚ UI LIBRARY β”‚ β”‚ noodl-editor β”‚ β”‚ noodl-runtime β”‚ β”‚ noodl-core-ui β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β€’ Electron app β”‚ β”‚ β€’ Node engine β”‚ β”‚ β€’ React componentsβ”‚ β”‚ β€’ React UI β”‚ β”‚ β€’ Data flow β”‚ β”‚ β€’ Storybook β”‚ β”‚ β€’ Property panels β”‚ β”‚ β€’ Event system β”‚ β”‚ β€’ Styling β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β”‚ β–Ό β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ VIEWER (MIT) β”‚ β”‚ β”‚ noodl-viewer-reactβ”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β€’ React runtime β”‚ β”‚ β”‚ β€’ Visual nodes β”‚ β”‚ β”‚ β€’ DOM handling β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β–Ό β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ PLATFORM LAYER β”‚ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚ noodl-platform β”‚ platform-electron β”‚ platform-node β”‚ β”‚ (abstraction) β”‚ (desktop impl) β”‚ (server impl) β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ ``` --- ## πŸ“ Key Directories ### noodl-editor (Main Application) ``` packages/noodl-editor/src/ β”œβ”€β”€ editor/src/ β”‚ β”œβ”€β”€ models/ # 🎯 Business logic & data β”‚ β”‚ β”œβ”€β”€ projectmodel.ts β†’ Project state β”‚ β”‚ β”œβ”€β”€ nodegraphmodel.ts β†’ Graph structure β”‚ β”‚ β”œβ”€β”€ componentmodel.ts β†’ Components β”‚ β”‚ β”œβ”€β”€ nodelibrary/ β†’ Node type registry β”‚ β”‚ β”œβ”€β”€ AiAssistant/ β†’ AI features β”‚ β”‚ └── sidebar/ β†’ Sidebar state β”‚ β”‚ β”‚ β”œβ”€β”€ views/ # πŸ–₯️ UI components β”‚ β”‚ β”œβ”€β”€ nodegrapheditor.ts β†’ Canvas/graph editor β”‚ β”‚ β”œβ”€β”€ panels/ β†’ Property panels β”‚ β”‚ β”œβ”€β”€ NodePicker/ β†’ Node creation UI β”‚ β”‚ β”œβ”€β”€ documents/ β†’ Document views β”‚ β”‚ └── popups/ β†’ Modal dialogs β”‚ β”‚ β”‚ β”œβ”€β”€ utils/ # πŸ”§ Utilities β”‚ β”‚ β”œβ”€β”€ CodeEditor/ β†’ Monaco integration β”‚ β”‚ β”œβ”€β”€ filesystem.ts β†’ File operations β”‚ β”‚ └── projectimporter.js β†’ Import/export β”‚ β”‚ β”‚ β”œβ”€β”€ store/ # πŸ’Ύ Persistent state β”‚ β”‚ └── AiAssistantStore.ts β†’ AI settings β”‚ β”‚ β”‚ └── pages/ # πŸ“„ Page components β”‚ └── EditorPage/ β†’ Main editor page β”‚ β”œβ”€β”€ main/ # ⚑ Electron main process β”‚ └── main.js β†’ App entry point β”‚ └── shared/ # πŸ”— Shared utilities └── utils/ └── EventDispatcher.ts β†’ Pub/sub system ``` ### noodl-runtime (Execution Engine) ``` packages/noodl-runtime/ β”œβ”€β”€ src/ β”‚ β”œβ”€β”€ nodes/ # πŸ“¦ Node implementations β”‚ β”‚ └── std-library/ β”‚ β”‚ β”œβ”€β”€ data/ β†’ Data nodes (REST, DB, etc.) β”‚ β”‚ β”œβ”€β”€ logic/ β†’ Logic nodes β”‚ β”‚ └── events/ β†’ Event nodes β”‚ β”‚ β”‚ β”œβ”€β”€ node.js # Base node class β”‚ β”œβ”€β”€ nodedefinition.js # Node definition API β”‚ β”œβ”€β”€ noderegister.js # Node registry β”‚ β”œβ”€β”€ nodescope.js # Component scope β”‚ └── nodecontext.js # Runtime context β”‚ └── noodl-runtime.js # Main runtime entry ``` ### noodl-viewer-react (React Runtime) ``` packages/noodl-viewer-react/src/ β”œβ”€β”€ nodes/ # 🎨 Visual nodes β”‚ β”œβ”€β”€ basic/ β†’ Group, Text, Image β”‚ β”œβ”€β”€ controls/ β†’ Button, Input, Checkbox β”‚ β”œβ”€β”€ navigation/ β†’ PageRouter, Page β”‚ └── std-library/ β†’ Standard library nodes β”‚ └── react-component-node.js # React node wrapper ``` ### noodl-core-ui (Component Library) ``` packages/noodl-core-ui/src/ β”œβ”€β”€ components/ β”‚ β”œβ”€β”€ common/ # 🧩 Basic components β”‚ β”‚ β”œβ”€β”€ Icon/ β”‚ β”‚ └── ActivityIndicator/ β”‚ β”‚ β”‚ β”œβ”€β”€ inputs/ # πŸ“ Form controls β”‚ β”‚ β”œβ”€β”€ TextInput/ β”‚ β”‚ β”œβ”€β”€ PrimaryButton/ β”‚ β”‚ └── Checkbox/ β”‚ β”‚ β”‚ β”œβ”€β”€ layout/ # πŸ“ Layout components β”‚ β”‚ β”œβ”€β”€ Box/ β”‚ β”‚ β”œβ”€β”€ Container/ β”‚ β”‚ └── Tabs/ β”‚ β”‚ β”‚ β”œβ”€β”€ popups/ # πŸ’¬ Dialogs & menus β”‚ β”‚ β”œβ”€β”€ MenuDialog/ β”‚ β”‚ └── PopupToolbar/ β”‚ β”‚ β”‚ └── ai/ # πŸ€– AI UI components β”‚ β”œβ”€β”€ AiChatBox/ β”‚ └── AiChatMessage/ β”‚ └── styles/ # 🎨 Global styles ``` --- ## πŸ” Finding Things ### Search Patterns ```bash # Find a file by name find packages/ -name "*NodeGraph*" -type f # Find where a function is defined grep -rn "function processNode" packages/ # Find where something is imported/used grep -r "import.*from.*nodegraphmodel" packages/ # Find all usages of a component grep -r "; } interface Connection { fromId: string; fromPort: string; toId: string; toPort: string; } // Component structure (componentmodel.ts) interface ComponentModel { name: string; graph: NodeGraphModel; metadata: Record; } ``` --- ## πŸ“ Path Aliases ```typescript // Configured in tsconfig.json @noodl-models/ β†’ packages/noodl-editor/src/editor/src/models/ @noodl-utils/ β†’ packages/noodl-editor/src/editor/src/utils/ @noodl-contexts/ β†’ packages/noodl-editor/src/editor/src/contexts/ @noodl-hooks/ β†’ packages/noodl-editor/src/editor/src/hooks/ @noodl-constants/ β†’ packages/noodl-editor/src/editor/src/constants/ @noodl-core-ui/ β†’ packages/noodl-core-ui/src/ @noodl/platform β†’ packages/noodl-platform/src/ ``` --- ## 🚨 Common Issues ### Build Problems ```bash # Clear caches rm -rf node_modules/.cache rm -rf packages/*/node_modules/.cache # Reinstall dependencies rm -rf node_modules npm install ``` ### TypeScript Errors ```bash # Check for circular dependencies npx madge --circular packages/noodl-editor/src ``` ### Electron Issues ```bash # Clear app data (macOS) rm -rf ~/Library/Application\ Support/OpenNoodl/ # Rebuild native modules npm run rebuild ``` --- *Quick reference card for OpenNoodl development. Print or pin to your IDE!*