App Integration

Most projects do not call Forge directly. @noego/app reads the client block from noego.config.yml, starts the Forge frontend service, and wires page controllers through the IoC container.

The Client Config Block

These fields are the public contract between App and Forge in generated projects.

noego.config.yml
# noego.config.yml
client:
  main: src/ui/frontend.ts
  shell: src/ui/index.html
  openapi: src/ui/stitch.yaml
  componentDir: src/ui
  watch:
    - src/ui/**/*.ts
    - src/ui/**/*.svelte
    - src/ui/openapi/**/*.yaml

dev:
  splitServe: true
  port: 3000

What Each Field Does

client.main
Frontend service entry. App imports this file when starting the Forge SSR process.
client.shell
HTML shell. Forge renders SSR output into this document and App rewrites it for production assets.
client.openapi
UI route document. Forge reads x-view, x-layout, x-controller, module base paths, and fallback routes from here.
client.componentDir
Base path for pages, layouts, controllers, and load files referenced by UI route metadata.
client.watch
Files that restart the frontend service in development when Vite HMR is not enough.
dev.splitServe
Runs router, frontend SSR, and backend API as separate services in development.

Frontend Entry Points

The frontend service entry starts Forge on the server. The browser entry initializes hydration after the HTML shell loads.

src/ui/frontend.ts
// src/ui/frontend.ts
import { client } from "@noego/app/client";

export default async function frontend() {
  await client.boot();
}
src/ui/client.ts
// src/ui/client.ts
import { client } from "@noego/app/client";

export default async function initApp() {
  await client.init();
}

Runtime Handoff

App

Loads noego.config.yml, resolves relative paths, starts the frontend service, and supplies a controller factory.

Forge

Uses the resolved client paths to load routes, pages, layouts, load files, and page controllers.

Svelte/Vite

Compile and hydrate the components. In development Vite also provides hot module replacement.

Production Build Notes

  • App builds the browser bundle and SSR components ahead of time.
  • Forge should receive paths that point at the built component tree in production.
  • The HTML shell is rewritten to load built client assets instead of dev scripts.
  • File-based contracts stay intact: routes still point to page/layout/controller paths.

Related App Docs

NoEgo

© 2025 NoEgo. All rights reserved.