Getting Started

Learn how ViteHub fits into a Nitro app, from route structure to shared server config.

ViteHub adds server-side primitives to Nitro. Each feature owns its own package, Nitro module entrypoint, optional top-level config key, and documented runtime imports when the feature needs them.

Mental model

Every feature follows the same pattern:

  • install the feature package
  • register the feature Nitro module
  • add a top-level config object only when you need to customize the default behavior
  • define named resources under src/<feature>/** ::
  • define named resources under server/<feature>/** ::
  • call the documented runtime import from a route, task, or other server code

ViteHub documents one Nitro-facing config style: top-level db, blob, cache, sandbox, workflow, cron, kv, and queue keys inside defineNitroConfig when you need feature-specific overrides.

Feature map

Database
Top-level `db` config for Drizzle and raw SQL through ViteHub-owned runtime helpers.
Cache
Nitro cache storage with hosting-aware defaults for local, Vercel, and Cloudflare.
Sandbox
Isolated execution with Vercel, Cloudflare, Deno, or Docker.
Workflow
Named workflow runs with provider-aware status and run controls.
Cron
Scheduled Nitro crons for Node, Cloudflare, and Vercel.
Queue
Background work queues with provider-native handles and enqueue options.
Blob
Object storage with local, S3, Vercel Blob, and Cloudflare R2 drivers.
KV
Durable key-value storage with provider-aware defaults and a small SDK.

Resource patterns

Most features follow one of these patterns:

  • discovered files become public names
  • global feature config sets provider defaults
  • definition-level options override behavior next to the resource itself
  • resolved handles expose provider-specific methods only after you ask for them

Crons keep scheduling simpler in the docs: choose the provider in cron, then declare schedules next to the handler with defineCron(handler, options?).

Start here

Installation
Install the feature package you need and register the Nitro module.
Configuration
Learn the shared layering model for global, named, and definition-level config.
Using Nitro
Call the runtime helpers from Nitro routes, tasks, and other server utilities.