Skip to content

Nuxt App On System-Core

Recipe

This is the default full-stack path for a public site or admin app hosted on Nuxt 3 / Nitro.

Target Outcome

  • Nuxt hosts the HTTP surface and frontend rendering.
  • createSystem() owns CMS, auth, delivery, storage, and platform runtime concerns.
  • Nuxt routes and server handlers compose around package exports instead of bypassing them.

Build Shape

  1. Install @system-core/core and the required peer dependencies.
  2. Create one Nuxt server plugin that bootstraps createSystem({ prisma, ... }).
  3. Use @system-core/core/integrations/nuxt for request/response adapter work.
  4. Keep server routes on runtime surfaces like system.cms, system.auth, and system.delivery.
  5. Use site-client, theme, sections, and ui-contracts on the browser side.

Install

bash
npm install @system-core/core zod @prisma/client h3
npm install bcryptjs jsonwebtoken nodemailer

Add these only if the project needs them:

  • Redis-backed limits or queues: npm install ioredis
  • S3 media storage: npm install @aws-sdk/client-s3 @aws-sdk/s3-request-presigner

Server Bootstrap

ts
import { createSystem } from '@system-core/core'

export default defineNitroPlugin(async () => {
  const system = await createSystem({
    prisma,
    media,
    notifications: {
      appUrl: 'https://example.com',
      appName: 'Example'
    }
  })

  globalThis.__system = system
})

HTTP Composition

ts
import { h3Adapter } from '@system-core/core/integrations/nuxt'

export default defineEventHandler(async (event) => {
  const system = globalThis.__system
  const body = await h3Adapter.readBody(event)

  const page = await system.cms.getPageBySlug(body.slug)
  return { page }
})

Frontend Boundaries

  • Public pages: @system-core/core/site-client
  • Theming: @system-core/core/theme
  • Section rendering metadata: @system-core/core/sections
  • Shared renderer contracts: @system-core/core/packages/ui-contracts

Do Not

  • Import core/* files into Nuxt app code.
  • Rebuild auth or CMS state outside createSystem().
  • Push server runtime objects into browser bundles.

Follow With

system-core documentation for maintainers, integrators, and AI build agents.