Skip to main content

Application Templates

About 1 min

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@latest
# or
npm init @dxos/bare@latest

Note

If you encounter an error with EINVALIDPACKAGENAME it's likely the npm/node versions are out of date. Ensure node -v is 18 or higher and npm -v is 9 or higher.

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@latest 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

tasks template

This is a basic tasks app template. Try out the Tasks app hosted on dxos.orgopen in new window.

npm init @dxos/tasks@latest
# or
dx app create --template tasks <project-name>

Tasks includes the sharing panels for inviting other collaborators into the task list.

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.