- Built on top of Svelte, a radical new approach to building user interfaces.
- Includes the latest stable versions of the Zea tools: Zea Engine, Zea UI, Zea UX, and Zea Collab.
- Supports SSR.
To get this template working, you're going to need Node.js (preferably the latest LTS version).
Our recommended way to clone this template is by using degit, a project scaffolding tool.
- Run this command on your terminal:
npx degit zeainc/zea-svelte-template#main my-awesome-app
- The above command will create the
my-awesome-app
directory for you. Go into it:
cd my-awesome-app
- Install the project's dependencies by running:
npm install
- Start a development server by running:
npm run dev
-
Use your browser to go to: http://localhost:5000/
-
Build something awesome.
Syntax | Description |
---|---|
build |
Build a bundled app with SSR + pre-rendering and dynamic imports |
dev |
Development (port 5000) |
serve |
Run after a build to preview. Serves SPA on 5000 and SSR on 5005 |
The template app leverages the Zea UI library for all its User interface components.
The UI library is built using the new 'web components' technology supported in all modern browsers.
The template leverages the Zea UX library to provide Undo, Redo and tools such as selection manager, transform tools.
This template app comes with a simple user identification and authentication system. Users enter their name and an optional password to gain access to the app.
onMount(async () => {
const isAuthenticated = await auth.isAuthenticated()
if (!isAuthenticated) {
$redirect('/login')
}
})
The Authentication can be disabled by commenting out the $redirect('/login') line in the index.svelte file.
Note: the 'auth.js' file is designed to support integrating other authentication systems provided by frameworks such as Firebase or Auth0.
If a user is identified, then the app integrates the powerful collaboration framework refrred to as 'Collab.
const SOCKET_URL = 'https://websocket-staging.zea.live'
const ROOM_ID = 'zea-template-collab'
Note: the roomID is what defines whether users of a given app are visible to each other. Always customize this value to avoid collisions with other apps.
const session = new Session(userData, SOCKET_URL)
session.joinRoom(ROOM_ID)
const sessionSync = new SessionSync(session, appData, userData, {})
the Zea CAD library comes pre-integrated and a sample zcad file is loaded.
const asset = new CADAsset()
asset.getGeometryLibrary().on('loaded', () => {
renderer.frameAll()
})
scene.getRoot().addChild(asset)
asset.getParameter('FilePath').setValue('/assets/HC_SRO4.zcad')
The code above loads the sample cad file.
Varcel is a great platform for quickly deploying SPAs (Single Page Applications) without needing to setup your own infrastructure.
In a few clicks you can connected Varcel to your GitHub repository, at which point Varcel will update your published web app on every push to your main branch.
-
The first step is to sign up to Varcel using your GitHub account, or whatever Git platform you can use.
-
Connect Varcel to the github repo containing the app built using this template
File it on Github: https://github.com/ZeaInc/zea-svelte-template
Start a discussion: https://github.com/ZeaInc/zea-svelte-template/discussions