Skip to main content

Documentation Index

Fetch the complete documentation index at: https://zenbulabs.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

1

Scaffold the project

npx create-zenbu-app my-app
This creates a new directory with everything you need to get started.
2

Install dependencies

cd my-app && pnpm install
3

Start the app

pnpm run dev
Your app will open in a new window, and any changes you make will hot-reload.

Project structure

After scaffolding, your project looks like this:
my-app/
├── zenbu.config.ts       # The only required config file
├── package.json
├── vite.config.ts
├── tsconfig.json
└── src/
    ├── main/
    │   ├── schema.ts     # Zod schema for the database
    │   └── services/
    │       └── app.ts    # Opens the main window on boot
    └── renderer/
        ├── index.html
        ├── main.tsx
        └── App.tsx
The zenbu.config.ts file is the entry point. It tells Zenbu.js where everything in your project is.
zenbu.config.ts
import { defineConfig, definePlugin } from "@zenbujs/core/config"

export default defineConfig({
  db: "./.zenbu/db",
  uiEntrypoint: "./src/renderer",
  plugins: [
    definePlugin({
      name: "app",
      services: ["./src/main/services/*.ts"],
      schema: "./src/main/schema.ts",
    }),
  ],
})

Available scripts

ScriptWhat it does
pnpm run devRun the app locally with hot reloading.
pnpm run linkRegenerate types after changing your project structure.
pnpm run db:generateCreate a migration after changing your database schema.
pnpm run build:sourceStage the source tree for publishing.
pnpm run build:electronProduce a signed .app / installer.

Next steps

Concepts

Learn the plugin model, state, and RPC.