LAYQ

From SaaS host to mounted child

Install a reviewed Next.js host, generate a child module, mount it on a route and verify the resulting application locally.

Review the host source

Use Node.js 24.14 or newer and npm. Copy the main application prompt from the home page. Open the client as text, review it and save that exact file in a temporary directory. Set CLIENT to its path and ORIGIN to the reachable site origin in the prompt. Inspect the file list before creating the project.

node "$CLIENT" inspect "$ORIGIN/registry/v1/app.json"

Install the revision you reviewed

Set REVIEWED_URL to the full Reviewed URL printed by inspect, including its #sha256 fragment. From the intended parent directory, run the install command. If my-saas already exists, choose a new destination. A changed manifest or an existing destination stops the installation.

node "$CLIENT" install "$REVIEWED_URL" ./my-saas

Exercise the host before extending it

Read package.json, install the locked dependencies and start the local server. Open 127.0.0.1:3000, sign in and edit a brief. In another terminal in my-saas, run npm run check:workspace. The probe creates, updates and deletes its own brief, checks sign-out and verifies the bundled activity module.

cd my-saas
npm ci
test -e .env.local || cp .env.example .env.local
npm run dev

Generate a module with its own checks

From the host root, generate reports. Its layq-manifest.json names the entry, capabilities, inherited settings and local verification commands. The release preflight runs tests and inspects the package contents. Creating a module leaves the choice of route to you.

npm run subapp -- modules/reports
npm --prefix modules/reports test
npm --prefix modules/reports run release:check

Mount the module on a route

Create app/reports/page.jsx in a free route. Import the child’s default export and pass the product name, theme and locale. Open /reports and look for “Updates for Studio.” For a protected feature, use the same session guard as app/workspace/page.jsx before rendering it.

import Reports from '../../modules/reports/src/index.mjs';

export default function ReportsPage() {
  return <Reports config={{
    productName: 'Studio',
    theme: 'light',
    locale: 'en'
  }} />;
}

Verify the complete application

Stop the development server before the production build. Run the host checks below. The production build checks the new route as part of the complete app. Publishing it, connecting an identity provider and choosing persistent storage remain decisions for your deployment.

npm test
npm run build