sveltekit-universal Svelte Themes

Sveltekit Universal

A sveltekit template that builds for web, mobile & desktop from a single codebase

Sveltekit Universal

Screenshot 2024-07-11 at 18 42 19

Run API endpoints, SSR, mobile & desktop from a single codebase.

We leverage two builds for this, one node and one static. The node build serves the API and SSR and the static build calls the node build for API and is used for mobile (capacitor) and desktop (tauri).

Install dependencies

npm i

Run dev mode

Node adapter (serving API & SSR)

This is the default mode, you need to run this for the static adapters to work since they will call this server for API.

npm run dev:node

Static adapter

This will not work unless you're also running the node adapter.

npm run dev:static

Build & preview

Pretty much same as dev mode, preview will build & preview by default.

npm run preview:node
npm run preview:static

Mobile & desktop dev

Tauri dev

(requires rust toolchain locally)

npx tauri dev

Capacitor

(will require you to have either an iOS or an android emulator locally)

npx cap sync
npx cap run android # or ios

Tauri build

npx tauri build

Run production node server

npm run build:node
node build-node/index.js

Top categories

svelte logo

Need a Svelte website built?

Hire a professional Svelte developer today.
Loading Svelte Themes