---
url: https://void.cloud/guide/quickstart.md
description: >-
  Create a Void app, run it locally, and deploy it. You can also add Void to an
  existing Vite app.
---

# Quickstart

Let’s build a small app with a `/api/hello` route, call it from the browser, and deploy it. If you already have a Vite app, you can [start there](#adding-to-an-existing-vite-app).

## Create an app

In an empty directory, install Void and run setup:

::: code-group

```sh [npm]
npm install -D void
npx void init
```

```sh [pnpm]
pnpm add -D void
pnpm void init
```

```sh [yarn]
yarn add -D void
yarn void init
```

```sh [bun]
# bunx runs Void with the `node` on your PATH: use Node.js 24.22+ or 26.12+
bun add -D void
bunx void init
```

```sh [vp]
vp add -D void
vpx void init
```

:::

Choose your UI framework, a starter, and a deployment target. For this example, choose D1 if you want a database you can run locally. You can connect your Cloudflare account now or skip deployment setup until the app is running.

By default, setup installs Vite+ for the project and keeps your package manager and lockfile. With pnpm, `pnpm create void my-app` can create the directory and configure build permissions in one step.

If `pnpm add` reports `ERR_PNPM_IGNORED_BUILDS`, continue with `pnpm void init`. It writes the required permissions to `pnpm-workspace.yaml`.

## Run locally

::: code-group

```sh [npm]
npm run dev
```

```sh [pnpm]
pnpm run dev
```

```sh [yarn]
yarn run dev
```

```sh [bun]
bun run dev
```

```sh [vp]
vpr dev
```

:::

Open `http://localhost:5173`. In a Pages starter, `pages/` contains your UI and companion `.server.ts` files contain its server loaders and actions. Loaders return data to page components as typed props.

## Call a server route

Edit `routes/api/hello.ts`, or create it if your starter doesn't include it:

```ts
import { defineHandler } from 'void';

export const GET = defineHandler(() => {
  return { message: 'Hello from Void' };
});
```

Open `http://localhost:5173/api/hello`. You should see `{"message":"Hello from Void"}`. Now call the same route from your client code.

```ts
import { fetch } from 'void/client';

const { message } = await fetch('/api/hello');
```

Hover over `message` in your editor. TypeScript knows it’s a string because that’s what the handler returns. Try renaming it to `greeting` in the handler. TypeScript will point you to the client code that still reads `message`.

Database starters also include `db/schema.ts`. Its Drizzle schema defines your tables and query types; Void runs a local database and provisions one when you deploy.

## Deploy

If you chose a target during setup:

```sh
npx void deploy
```

If you skipped setup, select your Cloudflare account:

```sh
npx void deploy --platform cloudflare
```

Void opens your browser to sign in when needed, builds the app, provisions resources, applies migrations, and prints the deployed URL. Later deploys use the saved target. See [Deployment](./deployment.md) for team platforms, CI, and rollback.

## Adding to an existing Vite app

Install Void and run `void init` with your package manager as shown [above](#create-an-app). Setup adds `voidPlugin()` to your Vite config and creates the remaining project files. If the config needs a manual edit, the CLI shows the change to make.

For a meta framework such as TanStack Start, React Router, or SvelteKit, follow its [integration guide](../integrations/frameworks/overview.md).

## Next steps

* [Pages Routing](./pages-routing/overview.md): loaders, layouts, and forms
* [Server Routing](./server-routing.md): params, middleware, and validation
* [Database](./database.md): queries and migrations
* [Environment Variables](./env-vars.md): local values and production secrets
* [Coding Agents](../integrations/agents.md): use Void's bundled docs and skills
