Anatomy of an installed project
A Spine project is two concentric layers: a sealed framework layer the package owns and overwrites on upgrade, and a customer layer the framework never writes to.
my-project/
├─ .framework/ # SEALED — framework source, vendored by init/upgrade
│ ├─ cli/ # the spine-framework CLI source
│ ├─ functions/ # Netlify functions (the whole API surface)
│ ├─ migrations/ # SQL migrations applied by `migrate`
│ ├─ public/ # static assets + _redirects
│ ├─ schemas/ # spine.config.schema.json
│ ├─ scripts/ seeds/ docs/ templates/
│ ├─ src/ # React frontend + admin app + this book
│ └─ tests/
├─ config/ # SEALED — build config (vite, tsconfig, tailwind…)
├─ scripts/ # SEALED — assemble/verify/dev shell scripts
├─ bin/ # SEALED — spine-framework bin shims
├─ custom/ # YOURS — apps, functions, components, migrations, tests
├─ .assembled/ # GENERATED — build output, never edit
├─ .spine-manifest.json # GENERATED — frozen integrity manifest
├─ spine.config.json # YOURS — branding + registration policy
├─ netlify.toml # mixed — framework blocks + your custom_* sections
├─ package.json # merged — framework scripts/deps + your own
└─ .env # YOURS — secrets; never written by the frameworkThe sealed layer
The file set is declared in .framework/templates/project.json (framework_dirs, framework_files, config_files, root_scripts, bin) and every protected file's sha256 is recorded in .spine-manifest.json — the protected trees are .framework, config, scripts, and bin (scripts/checksum-manifest.mts, PROTECTED_DIRS).
npm run verify(scripts/verify-integrity.sh→scripts/verify-manifest.mts) re-hashes the tree and fails on drift.SPINE_INTEGRITY=warndowngrades to warnings.npx spine-framework upgradere-syncs the sealed layer to thespine-frameworkversion installed innode_modules(.framework/cli/commands/upgrade.ts). It first verifies the tree against the manifest and aborts on any locally modified or missing protected file unless--forceis passed — so do not edit.framework/,config/,scripts/, orbin/; changes there are destroyed on the next upgrade anyway.- Deletions on upgrade are confined to
.framework/; sealed files dropped upstream outside it are left in place with a warning.
custom/ — your code
init creates custom/apps, custom/functions, custom/components, custom/migrations, and custom/tests (.framework/cli/commands/init.ts). Everything in it is yours: not integrity-tracked, never touched by upgrade.
- Custom apps live at
custom/apps/<slug>/.npx spine-framework create-app <slug>scaffoldsmanifest.json,index.tsx, andcomponents/, then inserts theappsrow withrenderer: 'custom'(.framework/cli/commands/create-app.ts).CustomAppLoaderresolves the UI viaimport.meta.glob('../../../custom/apps/*/index.tsx')(.framework/src/components/CustomAppLoader.tsx), and the Vite alias@custompoints atcustom/apps(config/vite.config.ts). - Custom functions live at
custom/functions/or inside an app atcustom/apps/<slug>/functions/; assembly merges them into the flat functions directory and hard-fails on basename collisions with framework functions (scripts/assemble-functions.sh). Name yourscustom_*. - Custom migrations in
custom/migrations/run withnpx spine-framework migrate(skip them with--framework-only). - Packaged apps installed via
npx spine-framework install-app <pkg>also land undercustom/apps/<slug>/; theirmanifest.jsoncan seed types, roles, pipelines, and registration policy into the database (.framework/cli/commands/install-app.ts). Unlike a hand-written app, a packaged app's files are publisher-owned:install-app/update-appre-copy the package's entries (reinstall keeps only your localmanifest.json),uninstall-appremoves the whole directory — so an "untouchedcustom/" promise applies toupgrade, not to app updates.
.assembled/ — build output
npm run assemble (scripts/assemble.sh) produces .assembled/ fresh on every dev start and build:
.assembled/src— the framework frontend plus eachcustom/apps/<slug>/copied verbatim (never basename-flattened), plus the fixed-upindex.html(scripts/assemble-frontend.sh). Vite builds and serves from here..assembled/netlify/functions— framework + custom functions flattened into the single directory Netlify requires (netlify.tomlfunctions.directory); duplicate basenames are a hard error, not a last-wins overwrite (scripts/assemble-functions.sh).
Never edit .assembled/ — it is regenerated and deleted freely.
.spine-manifest.json — the integrity contract
Written by init and regenerated by upgrade (.framework/cli/lib/project-files.ts → writeFrozenManifest): the package version (framework_version), the framework-owned dependency list, a tree digest, and a sha256 per protected file. It is the input to npm run verify and to upgrade's local-modification check.
spine.config.json — project runtime config
Customer-owned; init seeds the neutral template (.framework/templates/spine.config.neutral.json) and install-app/update-db-app merge per-app registration policy into it (.framework/cli/commands/install-app.ts). It carries branding and the registration block that drives signup routing/role assignment — schema at .framework/schemas/spine.config.schema.json. Upgrade never writes it.
netlify.toml and package.json — mixed ownership
netlify.toml: framework blocks are rewritten on upgrade, but[functions."custom_*"]sections are treated as app-owned and preserved verbatim (.framework/cli/lib/project-files.ts→splitNetlifyToml/renderNetlifyToml). Scheduled custom functions belong there.package.json: framework-owned scripts and dependencies are merged in andspine-frameworkpinned exactly; your own scripts and deps are preserved. Upgrade removes a dependency only if the previous framework version owned it and the new one does not.
.env — yours, always
No framework command writes .env; it is gitignored and excluded from the file set (.framework/templates/project.json exclude_globs). .env.example ships as the documented baseline.