How glitchworker/aislewire works
Main Components
• Build System & Task Runner: Represent gulp (with its gulpfile.js and tasks subdirectories) and webpack (webpack.config.js with reference to different modules). Also note the integration of DartSass (and its helper modules under tasks/modules/dart-sass-functions and dart-sass-glob).
• Template Engine: A Handlebars component that processes the multiple .hbs templates (layouts, components, pages, partials) found within src/templates. Indicate also the preprocessing of configuration files (like src/config.jsonc and data in /_modules/import).
• Style Processing: A SCSS system that uses DartSass, along with a separation of common styles (under src/common/stylesheets), mixins, vars, and page-specific styling (src/stylesheets for PC and SP).
• JavaScript Bundling: The source JavaScript is divided between “pc” and “sp” in src/javascripts, with module files in TypeScript (e.g. sample.ts, Caller.ts, etc.) that are all bundled with webpack (using Babel & possibly TypeScript support).
• Data/API Mock Server: A RESTful API server feature is available (when enabled in config.jsonc) that serves JSON files from src/_modules/api. Indicate ports (default: 9000) and typical API endpoints.
• Asset Management & Import Copy Data: There is a mechanism for copying external/folder assets into the build (under src/_modules/import) and the final output in /htdocs (assets, css, js and images) as well as folders for PC and SP.
• Local Git Environment: Under _setup/git, a local Git repository is set up optionally to use as version control during development.
Relationships and Data Flow
• The gulp tasks take the source files and apply preprocessing (handling SCSS -> CSS, compiling Handlebars templates, and bundling JavaScript via webpack) to produce the final output in htdocs.
• The API Mock Server reads JSON files from src/_modules/api and provides RESTful endpoints for front-end developers.
• That configuration files (src/config.jsonc) are passed through Gulp tasks (gulpfile.js) to influence both templating and style variables.
• External libraries and plugins (Handlebars, Sass, Babel, webpack, Browsersync) as influencing components that provide core functionality.
Architectural Patterns & Principles
• Modularity: The project architecture is divided into modular directories (data, common, templates, tasks, and modules) which should be diagrammatically separated.
• Separation of Concerns: Frontend templating, style processing, JavaScript bundling, and asset management are clearly separated. Represent this by grouping related directories (for example, “Templates” for hbs files, “Styles” for SCSS, “Scripts” for JavaScript, and “Data/API” for JSON modules).
• Configurable & Extensible: The use of config.jsonc and import data allows for customization and extension. Show this configuration as the central “settings” module that feeds into multiple pipelines.
Relevant Technologies, Frameworks, and Tools
• NodeJS (runtime) and npm/yarn for package management.
• Gulp for task automation.
• Webpack and Babel (and possibly TypeScript support) for JavaScript bundling.
• Handlebars.js for SSR or static page templating.
• Sass (DartSass) for style pre-processing, with PostCSS as an additional tool.
• Browsersync for live reloading.
• json-server (or similar) for the API mock server.
Detailed Component Breakdown
• Source Modules:
• Templates: All .hbs files from src/templates
• Styles: SCSS files in src/stylesheets and common/stylesheets
• Scripts: JavaScript/TypeScript files in src/javascripts (pc & sp folders)
• Data & API: JSON and YAML files under src/_modules/api and /data
• Asset Imports: Files in src/_modules/import and images in src/images and common/images
• Build Pipeline:
• Gulp Tasks (defined in gulpfile.js, tasks/* modules) orchestrate compilation, bundling, and Copy Data actions.
• Webpack Configuration processes modern JavaScript (transpilation via Babel/TypeScript).
• Sass (DartSass) plus PostCSS are used to compile and process styles.
• Output & Deployment:
• htdocs folder containing built assets (HTML, CSS, JS, images) with further segmentation for PC vs SP.
• Optional & External Services:
• API Mock Server: Enabled based on configuration (serves endpoints on port 9000).
• Local Git Environment: Provided optionally (under _setup/git) for version control in development.
Happy diagramming!