Build modular interfaces that developers, teams, and AI assistants can understand and extend.
ModularCube.js is a lightweight frontend framework: a reusable foundation for the part of an
application people see and use. It works with vanilla JavaScript, HTML, CSS, and native browser APIs.
Each feature is organized as a self-contained component with its own template, styles, configuration,
and lifecycle. This makes the code easier to learn, review, reuse, and grow.
Because the structure is explicit and predictable, AI models can receive clearer project context and
act as practical helpers for code generation, explanation, review, and routine development tasks—while
people remain in control.
import { HTMLComponent } from '@modular-cube'; import config from './MyComponent.config.json' with { type: "json" }; export default class MyComponent extends HTMLComponent { // Define your variables // Called before the component is fully processed // Used to load configuration (HTML, CSS, behavior settings, etc.) async preProcess() { super.preProcess({ config }); } // Called early in the component lifecycle // Can be used to set up initial properties or prepare internal state async toProcess() { // Add early setup logic here } // Called after the component’s DOM has been created // Provides access to the shadow DOM for manipulation or event binding async atProcess(dom) { // Add async logic here } // Enable your component config to call update every frame // Called every frame for continuous logic, animation, or state updates async inProcess(dom) { } }
<!-- Text content interpolation --> <p>Hello, ${this.word}!</p> <!-- Attribute binding --> <img alt="${this.title}"> <!-- Conditional class binding --> <div class="card-${this.color}">...</div> <!-- Inline style binding --> <span style="color: '${this.color}';">Colored Text</span> <!-- Rendered if color is "blue" --> <divif="${this.color === 'blue'}"> Blue </div>
:host { --component-radius: ${this.borderRadius}; } .card { border: 1px solid #ccc; border-radius: var(--component-radius); padding: 1rem; background: ${this.cardBackground}; }
{
"name": "MyComponent",
"descripttion": "",
"files": {
"html": {
"path": "./MyComponent.html"
},
"css": {
"path": "./MyComponent.css"
}
},
"behavior": {
"apendToBody": false,
"lazyLoading": false,
"fps": 0,
"debug": false
}
}
Use direct, readable patterns for templates, events, updates, styles, and component boundaries managed by the browser.
Start, run, coordinate, and grow ModularCube.js applications from one clear workspace.
Serve is the planned development companion for ModularCube.js. Its goal is to make full-stack work easier to start and easier to understand through guided setup, local runtime control, and a clear view of connected projects. The same predictable structure is intended to support AI agents with better context, helping them follow project conventions and handle repetitive development tasks while the developer keeps final control.
ModularCube.js starts from a practical belief: software should remain readable, explainable, and easy to change as it grows.
AI is treated as a helper, not a replacement for developer judgment. The goal is to make routine work easier: explain a component, trace behavior, suggest a change, prepare tests, or scaffold a feature from clear project context.
By staying close to vanilla JavaScript and the browser, ModularCube.js aims to reduce lock-in, keep web skills transferable, and support applications that people can understand for the long term.
Each part stays clear on its own while connecting to a larger application.
A frontend framework people and AI helpers can understand