Application Templates

Less than 1 minute

Application Templates

DXOS provides turnkey application templates complete with all the essentials for local application development.

To create a new DXOS project:

npm init @dxos
# or
npm init @dxos/bare

These can also be used from the dx CLI:

dx app create <project-name>
# or
dx app create --template bare <project-name>

hello template

This is the default template when using npm init @dxos or dx app create. It inherits everything from the bare template and adds a single-page welcome guide which is easy to delete.

bare template

This template provides some opinions for app development:

FeatureDescription
viteA fast developer loop based on esbuild.
typescriptType safety
vite-pwaTurnkey PWA configuration provided by vite-plugin-pwa
tailwindA productive CSS framework
phosphor-iconsA solid icons library
@dxos/clientECHO, HALO, KUBE configuration support
@dxos/react-componentsUI components for React
@dxos/react-shellUI flows for managing HALO identity and ECHO spaces

Turn features on or off

Invoking the template with --interactive like below will ask about enabling each feature one at a time.

npm init @dxos --interactive # or
dx app create <appname> --interactive

Example turning off PWA features:

dx app create example --interactive
Creating app...
? Include react: Yes
? Include the DXOS UI system for react: Yes
? Include a Storybook component sandbox (https://storybook.js.org): Yes
? Enable PWA support: No

Application example created.

Run the app:
$ cd example
$ pnpm install
$ pnpm serve

See also:
- example/README.md
- https://docs.dxos.org/guide/cli/app-templates

Source code

The templates can be found in the main dxos repoopen in new window under packages/apps/templatesopen in new window.