Nucleify Docs

Getting Started

Introduction

Build once. Move to any framework.

Nucleify is a modular full-stack monorepo built around framework migration. Keep your product in shared modules, develop day-to-day in Nuxt (web/), and move web or admin - or an external app - to another framework when hiring, buyers, or clients demand it. Product convert migrates an existing framework tree as-is: you do not rewrite the app into *.nuc.tsx first. Portable emit is an optional path for new shared UI; import brings emit edits back.

Frameworks: Vue · React · Nuxt · Next · Astro · Svelte · Solid - not a React/Next-only or Vue/Nuxt-only product.

Keep the product. Migrate the framework.


What is Nucleify?

Nucleify is a pnpm workspace that bundles everything for a modern product:

Package Path Role
@nucleify/web web/ Nuxt 4 landing app (canonical)
@nucleify/admin admin/ Nuxt 4 admin panel
@nucleify/docs docs/ Astro 5 documentation site
@nucleify/compiler compiler/ IR portable UI + product convert
@nucleify/cli published Installable nuc emit CLI (cli.nucleify.io)
@nucleify/shared-modules shared_modules/ Six exported feature modules

Supporting directories:

  • portable/nui/ - design tokens and Lit nui-* registration
  • overrides/ - per-package file overrides (overrides/{web,admin,docs,shared_modules}/)
  • supabase/ - DB config, migrations, edge functions
  • .config/ - Biome, Vitest, bash scripts, Make shim (.config/bin/make)

Canonical Nuxt and generated hosts

Mode Stack Command Output
Canonical (default) Nuxt 4 + Vue 3.5 make web web/
Converted (generated) Next / Solid / Svelte / Astro make web --target=next · -t=solid · … gitignored emit tree (see Compiler)
Emit demos Vue · React · Nuxt · Next · Solid · Svelte · Astro make vue · react · nuxt · next · solid · svelte · astro {framework}/demo

Canonical Nuxt is where this monorepo develops daily - pages, composables, and shared modules live in Vue. Product convert takes that tree (or an external app via --path / --git) and emits another host without a *.nuc.tsx rewrite. Portable emit demos are optional shared-UI samples. The docs site itself stays in tracked docs/; web-astro/ is a converted product emit, not that site.

All paths share shared_modules/, Supabase, and design tokens. You do not maintain seven unrelated codebases.


The compiler

The compiler (@nucleify/compiler) is the migration core. It works at two levels - product convert first for existing apps, portable emit second for optional shared UI. Day-to-day you usually call it through nuc emit (CLI) or Make.

1. Product convert (existing apps - no *.nuc.tsx rewrite)

Convert a whole product app - or an external app via --path / --git - to Next, Solid, Svelte, or Astro. Bring the project as framework source; do not rewrite pages and components into *.nuc.tsx before converting.

export PATH="$PWD/.config/bin:$PATH"

make web --target=next    # → web-next/
make web -t=solid         # → web-solid/
make web --target=svelte  # → web-svelte/
make web --target=astro   # → web-astro/

# Published CLI (same convert):
nuc emit convert web --target=next

# External tree (from Nucleify monorepo root):
nuc emit convert web --target=next --path=/path/to/your-app --out=my-next --force

Same routes, shared modules, different framework host. Output is generated by the compiler - not part of the canonical monorepo layout. Full details: Compiler.

2. Portable components (*.nuc.tsx) - optional

Author framework-agnostic presentational UI with #nuc-compiler/runtime when you want one source that emits sibling .vue, React .tsx, Solid .tsx, Svelte .svelte, and .css files. This is optional shared-UI authoring - not a gate before product convert.

import { component, state, handler } from '#nuc-compiler/runtime'

export default component({
  name: 'Counter',
  props: { label: { type: 'string', default: 'Count' } },
  setup(props) {
    const count = state(0)
    const onInc = handler(() => count.set(count.value + 1))
    return () => (
      <button type="button" onClick={onInc}>
        {props.label}: {count.value}
      </button>
    )
  },
})

See Compiler and compiler/PORTABLE.md for the full authoring rules.


Shared modules

Six exported feature modules live in shared_modules/:

Module Domain
nuc_api API client, gateway dispatch, auth forms, entity requests
nuc_colors Theme/color system, SCSS variables
nuc_dark_mode Dark mode preference
nuc_globals Media queries, global styles, shared types
nuc_languages i18n, locale messages, translations API
nuc_stores Pinia/Zustand helpers, cookie/localStorage utils

Apps import modules directly or via the modules alias (configured in web/.config/nuxt/structure.ts). Registration for the web app happens in web/src/plugins/modules.ts.

Read more: Modules · Feature-Sliced Design


API gateway

All server API traffic flows through one Nitro catch-all:

web/src/server/api/[...slug].ts
  → dispatchSupabaseApiGateway()
  → shared_modules/nuc_*/supabase/api/handle.ts

Module handlers register in shared_modules/nuc_api/supabase/api/gateway_dispatch.ts. Client code calls /api/... - never Supabase directly from the browser for privileged operations.


Design system

UI primitives are Lit web components from nucleify-ui (nui-button, nui-icon, …). Design tokens and registration live in portable/nui/. Every host consumes the same custom elements; the compiler maps nui-* tags in *.nuc.tsx across emit targets (Vue, React, Solid, Svelte, and related hosts).


Monorepo layout

nucleify/
├── web/                    # @nucleify/web - Nuxt 4 landing (canonical)
│   ├── nuxt.config.ts
│   ├── .config/nuxt/       # split Nuxt config
│   └── src/
│       ├── pages/          # Vue route wrappers (home, investor, …)
│       ├── sections/       # Marketing section SFCs (hero, pillars, …)
│       ├── templates/      # Shared UI pieces (holo cube, module board, …)
│       ├── plugins/        # modules.ts, nucleify-ui.client.ts
│       ├── composables/
│       ├── layouts/
│       └── server/api/     # Nitro API gateway [...slug].ts
├── admin/                  # @nucleify/admin - Nuxt 4 admin
├── docs/                   # @nucleify/docs - Astro 5 docs
├── compiler/               # @nucleify/compiler - IR + product convert
├── shared_modules/         # six exported nuc_* modules
├── portable/nui/           # design tokens, Lit nui-* registration
├── overrides/              # overrides/{web,admin,docs,shared_modules}/
├── supabase/
├── .config/                # tooling + bin/make shim for --target= / -t=
├── Makefile
└── package.json

Full breakdown: Monorepo Layout


Quick commands

Enable CLI-style Make flags once per shell:

export PATH="$PWD/.config/bin:$PATH"
Command What it does
make help Commands, flags (-t / --target), variables
make run Create .env, install deps, husky, sync rules, build compiler
make web Start Nuxt dev server (web/)
make web --target=next Convert web → Next, start dev (web-next/)
make web -t=solid Convert web → Solid, start dev
make web --target=svelte Convert web → Svelte, start dev
make web --target=astro Convert web → Astro + React islands
make admin --target=next Admin convert equivalents
make vue / react / nuxt / next / solid / svelte / astro Portable emit demos ({framework}/demo)
make docs Start Astro docs dev
make compiler pnpm compiler:check + pnpm compiler:build
nuc emit convert web --target=next Same convert via published CLI
nuc emit build / nuc emit check Portable emit + fingerprint check

Classic assignment without the shim: make web TARGET=next. Root pnpm shortcuts: pnpm dev, pnpm admin, pnpm docs.


Next steps

  1. Installation - prerequisites and first setup
  2. Quick Start - run the landing app in minutes
  3. CLI - full nuc emit reference
  4. Monorepo Layout - where everything lives
  5. Environment - configure Supabase and app vars