-
Notifications
You must be signed in to change notification settings - Fork 1
Tutorial UI Packs
Adrian Burlacu edited this page Feb 2, 2026
·
2 revisions
This tutorial covers developing, bundling, and deploying UI applications as Stark packs that run in browser nodes.
Stark Orchestrator can deploy UI applications to browser nodes, treating them as managed workloads just like server-side processes. This enables:
- Versioned UI deployments
- Instant rollbacks
- Coordinated frontend/backend releases
- Unified observability
- Stark Orchestrator running
- Node.js 20+
- pnpm 9+
- Basic Vue/Nuxt knowledge (for the examples)
# Create new Nuxt project
pnpm create nuxt my-ui-pack
cd my-ui-pack
pnpm installEdit nuxt.config.ts:
export default defineNuxtConfig({
// Disable server-side rendering
ssr: false,
// Generate static files
nitro: {
preset: 'static'
},
// Vite bundling configuration
vite: {
build: {
// Inline assets under 100KB as base64
assetsInlineLimit: 100 * 1024,
rollupOptions: {
output: {
// Disable code splitting - single bundle
inlineDynamicImports: true,
manualChunks: undefined,
},
},
},
},
})Edit pages/index.vue:
<template>
<div class="container">
<h1>My Stark UI Pack</h1>
<p>Version: {{ version }}</p>
<p>Deployed at: {{ deployedAt }}</p>
<button @click="count++">
Count: {{ count }}
</button>
</div>
</template>
<script setup lang="ts">
const version = '1.0.0'
const deployedAt = new Date().toISOString()
const count = ref(0)
</script>
<style scoped>
.container {
max-width: 600px;
margin: 0 auto;
padding: 2rem;
text-align: center;
}
button {
padding: 1rem 2rem;
font-size: 1.2rem;
cursor: pointer;
}
</style># From the Nuxt project directory
node packages/cli/dist/index.js pack bundle . --out ./ui-bundle.jsnode packages/cli/dist/index.js pack register ./ui-bundle.js \
--name my-ui-pack \
--ver 1.0.0 \
--runtime browserBrowser nodes are browsers that have:
- Loaded the Stark browser runtime adapter
- Connected to the orchestrator via WebSocket
- Registered their capabilities
# Deploy to a specific browser node
node packages/cli/dist/index.js pod create \
--pack my-ui-pack \
--node browser-node-1
# Or deploy to all browser nodes with a label
node packages/cli/dist/index.js deployment create ui-deployment \
--pack my-ui-pack \
--replicas 0 \
--node-selector runtime=browserFor assets to work in bundled packs, they must be inlined:
// nuxt.config.ts
export default defineNuxtConfig({
vite: {
build: {
// Increase limit for larger assets
assetsInlineLimit: 100 * 1024, // 100KB
},
},
})Place images in assets/images/ and reference them:
<template>
<img src="@/assets/images/logo.png" alt="Logo" />
</template>The bundler will inline them as base64 data URIs.
CSS is automatically extracted and inlined in the bundle.
<style>
/* Component styles are bundled automatically */
.my-class {
color: blue;
}
</style>When you make changes:
# Update version in your code
# Then bundle and register new version
node packages/cli/dist/index.js pack bundle . --out ./ui-bundle-v2.js
node packages/cli/dist/index.js pack register ./ui-bundle-v2.js \
--name my-ui-pack \
--ver 2.0.0 \
--runtime browserIf the new version has issues:
node packages/cli/dist/index.js pod rollback <pod-id> --ver 1.0.0Or update the deployment:
node packages/cli/dist/index.js deployment update ui-deployment --ver 1.0.0| Technique | Impact |
|---|---|
| Minimize dependencies | Smaller bundle |
| Use production builds | Removes dev code |
| Compress images | Smaller inline assets |
| Tree-shaking | Removes unused code |
-
Local development: Use
pnpm devfor hot reload -
Build: Use
pnpm generateto create static output - Bundle: Use Stark CLI to create pack bundle
- Test: Deploy to a test browser node
- Release: Register with production version
Use runtime configuration:
<script setup>
// Access runtime config
const config = useRuntimeConfig()
const apiUrl = config.public.apiUrl
</script>// nuxt.config.ts
export default defineNuxtConfig({
runtimeConfig: {
public: {
apiUrl: process.env.API_URL || 'https://localhost/api'
}
}
})See the complete example at examples/nuxt-pack.
- Home
- Getting Started
- Concepts
- Core Architecture
- Tutorials
- Reference
- Advanced Topics
- Contribution