A SpyneJS application template with pages, navigation, and UI components already wired up. Use it as the starting point for an application that needs routing and a page structure from the outset.
For a minimal starting point instead, see application-starter.
Node.js 18 or newer.
git clone https://github.com/spynejs/application-shell.git my-app
cd my-app
rm -rf .git && git init
npm install
npm startnpm start runs the webpack dev server with hot reload.
| Script | Description |
|---|---|
npm start |
Development server with hot reload; debug on, with the CMS and the console |
npm run build |
Production build into dist/; debug off, no CMS and no console |
npm test |
Unit tests via Web Test Runner |
npm run lint |
ESLint |
npm run lint:fix |
ESLint with autofix |
npm run format |
Prettier over src/ |
Under npm start, ctrl+alt+p turns the CMS and the console off for the browser tab, and the same keys turn them on again.
src/
app/
channels/ Channels — event flow and application state
components/ ViewStreams — nav, pages, page items, UI elements
traits/ SpyneTraits — reusable behaviour
scss/ Styles, including the design system tokens
static/ Data, fonts, and images
index.js Application entry: config, channel registration, root view
SpyneJS separates rendering (ViewStream), event flow (Channel), and
behaviour (SpyneTrait). Components are organised by those roles rather than by
feature.
Page content is read from src/static/data/app.model.json through a
ChannelFetch. Editing that file changes the rendered pages without touching
component code.
The build output in dist/ is a static single-page application. All application
routes must resolve to index.html, and requests for static assets must be
served directly. See HOSTING.md for platform-specific
configuration.
The photographs in src/static/imgs/ are placeholders from
Pexels, provided under the
Pexels License. They are not covered by this
project's MIT license. If you keep them, you are responsible for following the
Pexels terms; if you replace them, remove the photoCredit entry from
src/static/data/app.model.json to drop the footer credit. See
NOTICE.md for details and photo credits.
Source code: MIT — see LICENSE. Photographs are excluded; see NOTICE.md.