Dual Targets
One codebase: npm run build produces a static web app (dist/), npm run electron runs it as a desktop app, and npm run electron:build packages it with electron-builder.
.-. .-. .-. . . .-. .-. .-. . .-. . .-. .-. .-. .-. .-. . . .-. |-' | | | |-| |-| | )|- | |- | |- | | |( | | | | |\| ' `-' `-' ' ` ` ' `-' `-' `-' `-' `-' `-' `-' ' ' ' `-' `-' ' ` '
Pochade-Electron is an npx project scaffolder: a lightweight, opinionated starter template for building apps that ship as
both an Electron desktop app and a static, front-end-only web app — with SQLite local persistence and optional
C++/Rust WebAssembly, all in vanilla JavaScript. No framework lock-in. No unnecessary abstractions. Just fast, passionate code.
One codebase: npm run build produces a static web app (dist/), npm run electron runs it as a desktop app, and npm run electron:build packages it with electron-builder.
node:sqlite — Node's built-in SQLite module — runs in the Electron main process, persisting to a real SQLite file on disk, with read/write of entries and index generation out of the box.
The File System Access API exports/imports the database file — works in Chrome, Edge, and Electron's renderer.
Built-in support for dataroom-js. Create reusable components without Shadow DOM complexity.
Choose C++ (Emscripten), Rust (wasm-pack), both, or none at scaffolding time. Prebuilt binaries are included, so it works before you install any toolchain.
Webpack 5, SWC, PostCSS with cssnano. Write real CSS — no CSS-in-JS required.
WebdriverIO end-to-end tests run the real Electron app, and Vitest unit tests ship with the template, ready to run.
Includes an AGENTS.md describing the project's conventions for AI-assisted development.
npx pochade-electron my-projectcd my-projectnpm start — then open http://localhost:3000npm run electron (it hot-reloads against the dev server)The scaffolder copies the template, prunes the WASM examples you didn't pick, configures package.json (including the electron-builder appId/productName), fills in your metadata, and installs all dependencies automatically.
The SQLite database runs via Node's built-in node:sqlite in the Electron main process and persists to a real SQLite file on disk
(sessionData/app.sqlite3). No cross-origin isolation headers, no browser storage quotas.
In a plain web browser the static build still runs, but database calls reject with a descriptive error pointing at npm run electron.
Either way, the database can be exported to — and imported from — a file via the File System Access API
(showSaveFilePicker / showOpenFilePicker).
| npm start | Start the web development server |
| npm run build | Build the static web app into dist/ |
| npm run electron | Launch in Electron (dev server if running, else dist/) |
| npm run electron:build | Build and package the desktop app into release/ |
| npm test | Run the WebdriverIO e2e tests in the real Electron app (headless CI: install xvfb) |
| npm run test:unit | Run the Vitest unit tests |
| npm run build:wasm:cpp | Rebuild the C++ wasm example (needs Emscripten) |
| npm run build:wasm:rust | Rebuild the Rust wasm example (needs wasm-pack) |
No framework lock-in, no Shadow DOM, no CSS-in-JS, no complex build chains. Write JavaScript, not framework code.
Same as Pochade-JS