Skip to Content
Getting StartedInstallation

Installation

Hoikka is a SvelteKit store that runs on SQLite and deploys to either a Node.js server or Cloudflare Workers. The same codebase targets both — you pick with a single HOIKKA_TARGET env var.

Scaffold a new store

The recommended way to start is the create-hoikka-app installer. It clones the template, writes a .env, optionally seeds demo data, and — for the Cloudflare target — can provision D1 + R2, apply migrations, set secrets, and deploy.

pnpx create-hoikka-app my-store

It prompts for:

  • Deploy targetLocal / Node.js (SQLite file + local uploads) or Cloudflare (Workers + D1 + R2).
  • Demo content — seed demo products (local target only).

Flags make it scriptable: --target=local|cloudflare, --seed / --no-seed, --yes.

cd my-store pnpm dev

Your store runs at http://localhost:5173:

  • Storefront: http://localhost:5173
  • Admin: http://localhost:5173/admin

On first visit to /admin you are sent to /admin/setup to create the first admin account.

Manual setup

If you’d rather clone the repo directly:

git clone https://github.com/mhernesniemi/hoikka cd hoikka # Install dependencies (Node >= 20) pnpm install # (Optional) seed demo products pnpm seed # Start the dev server pnpm dev

pnpm seed creates and migrates the SQLite database on first run. Without it, migrations apply automatically the first time the server touches the database. The default database file is ./data/hoikka.db — override it with DATABASE_URL.

Copy .env.example to .env and set at least BETTER_AUTH_SECRET. See Configuration for the full list.

Cloudflare

For the Cloudflare target the app runs on Workers with D1 (database) and R2 (asset storage). create-hoikka-app can set this up for you; to do it by hand:

# Switch the target HOIKKA_TARGET=cloudflare # Create the resources named in wrangler.jsonc pnpm exec wrangler d1 create hoikka-db # copy the id into wrangler.jsonc pnpm exec wrangler r2 bucket create hoikka-assets # Apply migrations to the remote D1 database pnpm db:migrate:cf # Set secrets pnpm exec wrangler secret put BETTER_AUTH_SECRET # Build for Cloudflare and deploy pnpm deploy

Run the Cloudflare target locally (bindings via miniflare) with pnpm dev:cf.

AI-friendly codebase: Try prompts like “Add a weight field to products” and the agent can trace the full path from schema to admin to storefront.

Last updated on