Full-stack framework — islands-first HTML, Svelte 5 runes on the client, server actions, file-based routes, and streaming SSR.
Website — nexusjs.dev · Docs in this repo · Contributing · Changelog
Nexus targets minimal JavaScript by default: most of the page is static HTML from the server; only subtrees marked with client:* hydrate in the browser. Interactive regions use Svelte 5 runes ($state, $derived, $effect, …). Server-side logic uses a --- frontmatter block in .nx files, plus typed server actions and optional pretext loaders for route data.
End-user documentation and tutorials live on nexusjs.dev. This repository holds the implementation (packages/), examples, and contributor docs under docs/.
Requirements: Node.js ≥ 22, pnpm ≥ 9 (use .nvmrc with nvm use / fnm use; this monorepo uses workspace: links — run pnpm install at the root).
New application (published CLI):
npm exec --package=@nexus_js/cli@latest -- create-nexus my-app
cd my-app
npm install
npm run devOther entrypoints (e.g. pnpm create @nexus_js/nexus, global installs) are described in packages/create-nexus/README.md.
Clone this repo (framework development):
git clone https://github.com/bierfor/nexus.git
cd nexus
nvm use # Node 22 — see .nvmrc (or fnm use / mise use)
pnpm install
pnpm build
pnpm testRun the minimal example: pnpm example (starts the basic example). Other examples: pnpm dev:pokedex, pnpm dev:nexusflow, etc.
Published npm packages live under packages/. examples/ are sample apps included in the workspace; they are not published as framework packages.
nexus/
├── packages/
│ ├── compiler/ # .nx → JS (parser, codegen, islands, CSS scoping)
│ ├── runtime/ # Client: runes, islands, navigation, cache, store
│ ├── server/ # HTTP server, SSR, streaming, actions
│ ├── router/ # File-based route manifest
│ ├── cli/ # `nexus` CLI and Nexus Studio
│ ├── create-nexus/ # `npm create @nexus_js/nexus` scaffold
│ ├── head/ # Metadata (defineHead / useHead)
│ ├── serialize/ # Types across server ↔ client boundaries
│ ├── vite-plugin-nexus/ # Vite integration
│ ├── assets/ # Image / font pipeline
│ ├── db/ # Optional DB helper (BYO client)
│ ├── middleware/, connect/, security/, sync/, audit/
│ ├── types/, testing/, ui/
│ └── nexus_js / nexus-js # Meta-packages re-exporting the stack
├── examples/ # Demos: basic, pokedex, nexusflow, …
├── docs/ # Contributor docs + [REPOSITORY.md](./docs/REPOSITORY.md) (clean GitHub publish)
└── .github/workflows/ # CI
Maintainers: release process is documented in docs/PUBLISHING.md.
Each file can include:
---frontmatter — server-only: imports, data loading,// nexus:pretext, actions.<script>— Svelte 5 runes for island code.<template>— HTML with{expressions}and{#if}/{#each}.<style>— scoped CSS.
Hydration examples: client:load, client:idle, client:visible, client:media="…", server:only. Details: docs/ISLANDS.md, docs/PRETEXT.md.
| Area | Highlights |
|---|---|
| Rendering | Islands, streaming SSR, automatic cache-related Cache-Control hints |
| Data | Pretext merged into $pretext(), cache() with tags/TTL |
| Client | Global store, optimistic updates, SPA-style navigation where enabled |
| Tooling | `nexus dev |
Issues and pull requests are welcome. See CONTRIBUTING.md (setup, structure, commits, tests). To replace or recreate the GitHub remote with a clean tree only, follow docs/REPOSITORY.md.
MIT — see LICENSE.