Skip to content
brought to you byVoidZero

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. If you already use a framework like Nuxt or TanStack Start, start with its integration guide.

Server routes and pages ​

Imagine you’re building a directory of people. Once you’ve defined a users table in your database schema, 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, 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 for a complete example. You can also use server routes 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 to store a value by key, object storage for files, or a queue 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 use a schema, local values, and production secrets.

Deploy to your own Cloudflare account, or connect to a Void platform 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. Your framework keeps its routing and rendering; Void handles resources and deployment.