A modern desktop application template combining the best of web technologies with native desktop capabilities. This template embeds a SvelteKit development server within a NeutralinoJS client window, providing hot-reload during development and native API access.
- ⚡ Svelte 5 - Latest Svelte with runes for reactive state management
- 🖥️ NeutralinoJS - Lightweight native desktop framework (no Chromium bundling)
- 🎨 Tailwind CSS 4 - Utility-first CSS framework
- 🔥 Hot Reload - Full HMR support during development
- 🛠️ TypeScript - Full type safety
- 📦 Deno Task Runner - Modern JavaScript runtime for task orchestration
- 🔧 Native API Access - OS integration, file system, notifications, and more
- 🌐 Cross-Platform - Windows, macOS, and Linux support
┌─────────────────────────────────────────────────────────────┐
│ Desktop Window │
│ ┌───────────────────────────────────────────────────────┐ │
│ │ NeutralinoJS Container │ │
│ │ ┌─────────────────────────────────────────────────┐ │ │
│ │ │ SvelteKit Dev Server │ │ │
│ │ │ (http://localhost:5173) │ │ │
│ │ │ │ │ │
│ │ │ ┌─────────────────────────────────────────────┐ │ │ │
│ │ │ │ Svelte Application │ │ │ │
│ │ │ │ • Hot Module Replacement (HMR) │ │ │ │
│ │ │ │ • Native API Integration │ │ │ │
│ │ │ │ • Tailwind Styling │ │ │ │
│ │ │ └─────────────────────────────────────────────┘ │ │ │
│ │ └─────────────────────────────────────────────────┘ │ │
│ └───────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
.
├── deno.json # Deno task runner configuration
├── scripts/
│ ├── setup.sh # Unix setup script
│ └── setup.bat # Windows setup script
├── src/
│ ├── client/ # NeutralinoJS client
│ │ ├── neutralino.config.json
│ │ └── .gitignore
│ └── server/ # SvelteKit application
│ ├── package.json
│ ├── svelte.config.js
│ ├── vite.config.ts
│ ├── tsconfig.json
│ └── src/
│ ├── app.html
│ ├── app.d.ts
│ ├── lib/
│ │ ├── index.ts
│ │ ├── neutralino.ts # Neutralino integration
│ │ └── assets/
│ └── routes/
│ ├── +layout.svelte
│ ├── +page.svelte
│ └── layout.css
- Node.js 18+ (Download)
- Deno 1.40+ (Download)
- Neutralino CLI (install globally):
npm install -g @neutralinojs/neu
-
Install npm dependencies:
deno task install
-
Generate SvelteKit types and sync configuration:
deno task prepare
Note: This generates the
.svelte-kit/tsconfig.jsonfile that the project extends. Run this whenever you add new dependencies or change SvelteKit configuration. -
Download Neutralino binaries:
cd src/client && neu update
deno task dev:neutralinoThis starts both the SvelteKit dev server and the Neutralino client simultaneously.
Terminal 1 - Start SvelteKit dev server:
deno task dev:serverTerminal 2 - Start Neutralino client:
deno task dev:clientdeno task devOpen http://localhost:5173 in your browser.
If you see errors like Cannot find type definition file for 'node' or Cannot find module '@sveltejs/kit':
- Make sure you've run
deno task installto install npm dependencies - Run
deno task prepareto generate SvelteKit types - Restart your editor's TypeScript language server
Run deno task prepare to generate the SvelteKit configuration files.
Make sure the SvelteKit dev server is running on port 5173 before starting the Neutralino client.
| Task | Description |
|---|---|
deno task install |
Install npm dependencies |
deno task dev |
Start SvelteKit dev server on port 5173 |
deno task dev:server |
Alias for dev with host binding |
deno task dev:client |
Start Neutralino client |
deno task dev:neutralino |
Run both dev server and client |
| Task | Description |
|---|---|
deno task build |
Build SvelteKit for production |
deno task build:server |
Build SvelteKit to client resources |
deno task build:client |
Build Neutralino binaries |
deno task build:neutralino |
Build complete application |
| Task | Description |
|---|---|
deno task check |
Run TypeScript type checking |
deno task lint |
Run ESLint and Prettier checks |
deno task format |
Format code with Prettier |
The template supports full hot module replacement (HMR):
- Changes to Svelte components update instantly in the Neutralino window
- Tailwind CSS changes are reflected immediately
- Native API calls work seamlessly during development
Use the $lib/neutralino module to access native capabilities:
<script lang="ts">
import { isNeutralino, showNotification, selectFile, closeApp } from '$lib/neutralino';
async function handleNotify() {
await showNotification('Hello', 'From Svelte!');
}
async function handleOpenFile() {
const files = await selectFile({
filters: [{ name: 'Images', extensions: ['png', 'jpg', 'gif'] }]
});
console.log('Selected:', files);
}
</script>
<button onclick={handleNotify} disabled={!isNeutralino()}>
Show Notification
</button>- App:
closeApp(),restartApp() - OS:
showNotification(),showMessageBox(),selectFile(),saveFile() - Filesystem:
readTextFile(),writeTextFile(),createDirectory() - Storage:
setStorageItem(),getStorageItem() - System:
getSystemInfo()
The template uses @sveltejs/adapter-static to build for Neutralino:
adapter: adapter({
pages: '../client/resources',
assets: '../client/resources',
fallback: 'index.html'
})Key settings for development:
{
"url": "/",
"enableNativeAPI": true,
"nativeAllowList": [
"app.*",
"os.*",
"filesystem.*",
"storage.*",
"computer.*"
]
}Configured for cross-origin requests from Neutralino:
server: {
host: true,
cors: { origin: '*' }
}To create a production release:
# Build everything
deno task build:neutralino
# Output location
src/client/dist/The production build:
- Compiles SvelteKit to static files in
src/client/resources/ - Bundles Neutralino binaries for your platform
- Creates distributable packages in
src/client/dist/
Use Neutralino's filesystem API for cross-platform path handling:
import { readTextFile, writeTextFile } from '$lib/neutralino';
// Works on all platforms
const content = await readTextFile('./data/config.json');import { getSystemInfo } from '$lib/neutralino';
const info = await getSystemInfo();
console.log(info.os.name); // 'Windows', 'Darwin', 'Linux'If you see Cannot find module errors:
deno task prepare # Generate SvelteKit types
deno task install # Reinstall dependenciesEnsure you're running the app through Neutralino:
# Don't just open in browser
deno task dev # Only starts SvelteKit
# Use instead:
deno task dev:neutralino # Starts both- Check that port 5173 is available
- Ensure
host: trueis set invite.config.ts - Verify firewall settings for local connections
- Svelte 5 - Cybernetically enhanced web apps
- SvelteKit - The official Svelte application framework
- NeutralinoJS - Portable and lightweight cross-platform desktop application development framework
- Tailwind CSS 4 - A utility-first CSS framework
- Deno - A modern runtime for JavaScript and TypeScript
- Vite - Next generation frontend tooling
MIT - See LICENSE for details.
Contributions welcome! Please follow the existing code style and ensure:
- TypeScript strict mode compliance
- Cross-platform compatibility
- Proper error handling for native API calls