A modern, lightweight desktop application template combining the power of Neutralino.js with SvelteKit, TypeScript, and Vite for fast development and optimal performance.
Traditional desktop app frameworks like Electron can be resource-heavy. This template provides:
Before getting started, ensure you have the following installed:
npm install -g @neutralinojs/neu
)Clone the repository
git clone <your-repo-url>
cd neutralino-sveltekit-template
Install dependencies
bun install
# or
npm install
Initialize Neutralino
neu update
Start the development server with hot module replacement:
bun run dev
# or
npm run dev
This will:
Create a production build:
bun run build
# or
npm run build
The build process will:
dist/
directoryneutralino-sveltekit-template/
āāā src/
ā āāā lib/ # Reusable Svelte components
ā ā āāā App.svelte # Main application component
ā ā āāā Counter.svelte # Example counter component
ā ā āāā NeutralinoCheck.svelte # Neutralino API demo
ā āāā routes/ # SvelteKit routes
ā ā āāā +layout.svelte # Root layout
ā ā āāā +layout.ts # Layout configuration
ā ā āāā +page.svelte # Home page
ā āāā app.css # Global styles
ā āāā app.html # HTML template
ā āāā vite-env.d.ts # Vite type definitions
āāā static/ # Static assets
āāā public/ # Public assets (icon, etc.)
āāā neutralino.config.json # Neutralino configuration
āāā svelte.config.js # SvelteKit configuration
āāā vite.config.ts # Vite configuration with Neutralino plugin
āāā package.json # Dependencies and scripts
āāā tsconfig.json # TypeScript configuration
The neutralino.config.json
file contains the desktop application settings:
The svelte.config.js
configures:
@sveltejs/adapter-static
for SPA generationThe vite.config.ts
includes a custom Neutralino plugin that:
This template demonstrates integration with Neutralino's native APIs:
Example usage in src/lib/NeutralinoCheck.svelte
:
import { computer } from '@neutralinojs/lib'
let osInfo = computer.getOSInfo()
Command | Description |
---|---|
bun run dev |
Start development server with Neutralino app |
bun run build |
Build for production |
bun run preview |
Preview production build |
bun run check |
Run Svelte type checking |
bun run check:watch |
Run type checking in watch mode |
The template includes:
package.json
: Modify name, description, and authorneutralino.config.json
: Change applicationId, title, and window propertiespublic/
and static/
directoriessrc/app.html
.svelte
files in src/lib/
src/routes/
src/app.css
After building, you'll find platform-specific binaries in the dist/
directory:
.exe
executable.app
bundle For production distribution, consider code signing your applications:
signtool
with a code signing certificategpg
for package signingContributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the ISC License - see the LICENSE file for details.
Happy coding! š If you find this template helpful, please consider giving it a ā on GitHub.