How doriandarren/node-generator works
• Scaffolding new projects or modules in Node.js, PHP, React
• AI integrations (ChatGPT API, Ollama local model)
• Miscellaneous utilities (ADB control, CLI helpers, file helpers)
Main Components
• 1.1 CLI Layer (Entry point)
• app.js
• 1.2 Controller Layer (Command handlers under src/controllers)
• addkit
• ai (chatGPT & Ollama sub-controllers)
• database (to_generate, to_list)
• export_diagrams
• import_diagrams
• node (to_create_module + to_create_project)
• php (to_create_module + to_create_project)
• react (to_create_module_crud, to_create_module_single, to_create_project)
• 1.3 Shared Utilities
• src/helpers (file, string, date, inquirer wrappers)
• src/models/Prompt.js
• src/controllers/database/helpers (DB connection factory)
• 1.4 Infrastructure Services
• Database: MySQL (via sequelize + mysql2)
• AI Services:
– ChatGPT API (external HTTP call)
– Ollama local model service
• ADB (adbkit)
• 1.5 File System
• public/ (static assets, Postman collection)
• src/scripts (dbTestConnection.js, dbAlter.js)
Relationships and Data Flows
• CLI Layer → Controller Layer
• Controller Layer → Shared Utilities
• Calls helpers for file I/O, string/date formatting, prompting.
• Controller Layer → Infrastructure Services
• Database controllers → Sequelize → MySQL
• AI controllers → HTTP client → ChatGPT API or local Ollama
• export_diagrams → xmlbuilder2 → produces .drawio XML
• node/php/react controllers → FS write → generated project/module files
• addkit controllers → ADB via adbkit
• Scripts → Database
• DB test / alteration scripts use the same connection helper.
• public/ static → optional web UI (if enabled via Handlebars)
Architectural Patterns
• Modular Monolith: each language/framework generator lives in its own subfolder under src/controllers.
• Command Pattern: each controller exports a “main” function invoked by the CLI dispatcher.
• Layered Architecture:
• Presentation (CLI)
• Application (Controllers)
• Domain/Utilities (Helpers, Models)
• Infrastructure (DB, AI, XML, ADB)
Detail Level
• That scripts under src/scripts reuse the same database connection path.
• Optionally, illustrate CLI dependencies (dotenv → loads .env).