Skip to content

Development Setup

FranciszekRyszka edited this page Jul 1, 2026 · 1 revision

Development Setup

Prerequisites

  • Node.js ≥ 22.13 — required by pnpm 11 (which uses node:sqlite). Node 20 will fail with ERR_UNKNOWN_BUILTIN_MODULE: node:sqlite.
  • pnpm 11 — npm install -g pnpm@11 or via corepack enable.
  • Rust (stable) via rustup — only needed for the desktop app.

Platform prerequisites for the desktop build:

OS Requirements
Windows Visual Studio C++ Build Tools + WebView2 (preinstalled on Win 10/11)
macOS xcode-select --install
Linux libwebkit2gtk-4.1-dev build-essential curl wget file libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev

Install dependencies

pnpm install

Run in development

Web app (browser)

pnpm dev

Open http://localhost:3000. Hot reload is on. Data is stored in ./data/snippets.db.

Desktop app (Tauri)

pnpm tauri:dev

This starts the Next.js dev server and opens the native Tauri window pointed at it (devUrl: http://localhost:3000).

Useful scripts

Command Description
pnpm dev Next.js dev server (web)
pnpm build Production build of the web app (.next/)
pnpm start Serve the production web build
pnpm lint Run ESLint
pnpm build:tauri Static export for the desktop app (see Building and Packaging)
pnpm tauri:dev Run the desktop app in development
pnpm tauri:build Build desktop installers

Type-checking

pnpm exec tsc --noEmit

If pnpm tries to purge/reinstall node_modules or crashes, you probably moved the project folder after installing. See Troubleshooting.

Project layout

app/            Next.js App Router pages + API routes (/api/snippets)
components/      React components (shadcn/ui lives in components/ui)
hooks/          Custom React hooks (e.g. use-debounce)
lib/            db.ts (web SQLite), tauri-api.ts (runtime bridge), languages.ts, utils
scripts/        SQL migrations + build-tauri.mjs (static-export helper)
src-tauri/      Rust desktop app (commands in lib.rs, DB in db.rs)
public/         Static assets

See Architecture for how these fit together.

Clone this wiki locally