Setup, integration, and first steps with the Strvct framework.
Strvct is designed to be used as a git submodule within your project. From your project's root folder:
git submodule add https://github.com/stevedekorte/strvct.net.git strvctIf you plan to deploy on GitHub Pages, add a .nojekyll file to your root folder to prevent Jekyll processing.
A typical Strvct project looks like this:
your-project/
├── strvct/ # Framework submodule
├── app/ # Your application code
│ ├── _imports.json # Declares your app's source files
│ └── ...
├── resources/ # Icons, sounds, images
├── build/ # Generated by build (do not edit)
│ ├── _index.json # Resource metadata catalog
│ └── _cam.json.zip # Compressed content bundle
├── _imports.json # Root imports (references strvct + app)
└── index.html # Entry pointStrvct uses _imports.json files instead of standard ES module imports. Each directory that contains source files needs an _imports.json listing its files and subdirectories:
[
"_css.css",
"external-libs/_imports.json",
"source/_imports.json",
"app/_imports.json"
]Paths are relative to the directory containing the _imports.json. Entries can be direct file paths (e.g. "MyClass.js") or references to sub-imports (e.g. "subfolder/_imports.json"). The build system recursively follows all references to discover the complete set of resources and their dependency order.
The build process scans your _imports.json tree and produces two files in the build/ directory:
_index.json — metadata catalog with paths, sizes, and SHA-256 content hashes_cam.json.zip — compressed content bundle keyed by hashTo run the build manually:
node ./strvct/source/boot/index-builder/ImportsIndexer.jsFor non-code assets (icons, sounds), run the resource indexer:
node ./strvct/source/boot/index-builder/SvResourceIndexer.js ./resources/icons ./resources/soundsIf your project uses a justfile, these are typically wrapped in a just build command.
Start the local web server:
node ./strvct/webserver/CliWebServer.js --config path/to/config.json --port 8000The server configuration is a JSON file specifying request handler classes:
{
"serverName": "MyApp",
"requestClasses": [
"./requests/MyRequestHandler.js"
]
}Use --secure true for HTTPS (you will need to accept the self-signed certificate warning on first visit) or --secure false for HTTP.
Cursor (and VSCode) can debug Strvct applications via Chrome DevTools. Key points for your launch configuration:
webRoot to your site directory (the folder containing the strvct/ submodule)"pathMapping": { "/": "${webRoot}/" }"sourceMaps": false) — Strvct uses sourceURL comments instead"disableNetworkCache": true) during developmentExample .vscode/launch.json configuration:
{
"name": "local",
"type": "chrome",
"request": "launch",
"url": "https://localhost:8000",
"webRoot": "${workspaceFolder}/site",
"pathMapping": { "/": "${webRoot}/" },
"sourceMaps": false,
"disableNetworkCache": true
}This allows breakpoints, stepping, and source display to work correctly with dynamically evaluated code.
Strvct includes an ESLint configuration at strvct/eslint.config.js. Key rules to be aware of:
function () not function(), methodName () not methodName()Install ESLint if you don't have it:
npm init @eslint/config -gCreate a file in your app directory and declare it in your _imports.json:
(class MyNode extends SvSummaryNode {
initPrototypeSlots () {
{
const slot = this.newSlot("greeting", "Hello, world!");
slot.setSlotType("String");
slot.setShouldStoreSlot(true);
slot.setSyncsToView(true);
slot.setCanEditInspection(true);
}
}
initPrototype () {
this.setShouldStore(true);
}
init () {
super.init();
return this;
}
subtitle () {
return this.greeting();
}
}.initThisClass());This creates a persistent node with an editable string property that automatically appears in the UI inspector. The framework handles view generation, storage, and synchronization — you only define the model.