---
url: https://void.cloud/guide.md
description: >-
  Void is a full-stack framework for Cloudflare Workers, powered by Vite. It
  connects routing, data, and deployment in one project.
---

# What is Void?

Void is a full-stack framework for Cloudflare Workers, powered by Vite. You can build pages with React, Vue, Svelte, or Solid and write the server code they call in the same project.

To create your first app, follow the [Quickstart](./quickstart.md). If you already use a framework like Nuxt or TanStack Start, start with its [integration guide](../integrations/frameworks/overview.md).

## Server routes and pages

Imagine you’re building a directory of people. Once you’ve defined a `users` table in your [database schema](./database.md#schema-definition), you can serve their names at `/api/users` by creating this file:

```ts
// routes/api/users.ts
import { users } from '@schema';
import { defineHandler } from 'void';
import { db } from 'void/db';

export const GET = defineHandler(async () => {
  return await db.select({ name: users.name }).from(users);
});
```

The file gives the route its URL. The query gives it a response type. When you call the route with [typed fetch](./typed-fetch.md), TypeScript knows that each item has a `name`. If you rename that field, your editor shows you which callers need updating.

To render a page at `/users`, put an `index` component in `pages/users/`. Its companion `index.server.ts` can export a **loader** that reads the users and returns typed props to the component. Add an **action** there when you want a form to save a new user. See [Pages routing](./pages-routing/overview.md) for a complete example. You can also use [server routes](./server-routing.md) with your own client-side router or build an API on its own.

## Resources from your code

In the example above, importing `db` tells Void that the app needs a database. With the default D1 database, you can work on the directory locally, then let Void provision its database when you deploy. Use [KV](./kv.md) to store a value by key, [object storage](./storage.md) for files, or a [queue](./queues.md) to process work in the background.

## From local development to production

Vite runs your app locally with Cloudflare's runtime. `void deploy` builds it, provisions resources, applies database migrations, and publishes it. [Environment variables](./env-vars.md) use a schema, local values, and production secrets.

Deploy to [your own Cloudflare account](./deployment.md#deploy-to-cloudflare), or connect to a [Void platform](./self-hosted-platform.md) run by your team. Both use the same application APIs. A platform adds shared access, deployment history, and administration.

Void also deploys [existing frameworks and static sites](./app-types.md). Your framework keeps its routing and rendering; Void handles resources and deployment.
