Skip to content

dev-templates/vinext-quick-start

Repository files navigation

vinext-quick-start

A full-stack application template powered by the vinext framework, deployed to Cloudflare Workers.

Tech Stack

  • Framework: vinext (Vite-based Next.js-compatible implementation, App Router)
  • Build Tool: Vite 8
  • Runtime: React 19, TypeScript
  • Styling: Tailwind CSS v4
  • Font: Geist (via next/font/google compatibility layer)
  • Package Manager: bun
  • Deployment Target: Cloudflare Workers (wrangler)

Getting Started

Install dependencies:

bun install

Start the development server:

bun dev

Open http://localhost:3000 to view the page.

Available Scripts

Command Description
bun dev Start the development server
bun build Build for production
bun start Preview the production build locally
bun lint Run code linting
bun check Run linter in CI mode (no auto-fix)
bun deploy Deploy to Cloudflare Workers

Deployment

  1. Log in to Cloudflare:
bun wrangler login
  1. Deploy:
bun deploy

For non-interactive deployments (e.g., CI environments), set the CLOUDFLARE_API_TOKEN environment variable instead of logging in.

Deployment configuration is located in wrangler.jsonc.

Configuration

The project ships with two pre-configured files — both contain commented-out examples you can uncomment and customize:

  • wrangler.jsonc — Cloudflare Workers deployment config. Includes examples for custom domains, environment variables, bindings (KV, D1, R2), and multi-environment setup.
  • next.config.ts — Application-level config (vinext-compatible subset of Next.js config). Includes examples for base path, redirects, rewrites, custom headers, and image optimization.

Custom Domain

To bind a custom domain, configure routes in wrangler.jsonc:

"routes": [
  { "pattern": "example.com", "custom_domain": true }
]

Setting custom_domain: true lets Cloudflare manage DNS automatically. For production, set workers_dev: false to disable the default *.workers.dev subdomain.

Environment Variables & Secrets

  • Non-sensitive values — define in the vars section of wrangler.jsonc.
  • Secrets — use the CLI: wrangler secret put <KEY>.
  • .env files — Next.js-style .env / .env.local files are also supported. Variables prefixed with NEXT_PUBLIC_ are exposed to the client bundle.

Bindings (KV, D1, R2)

Uncomment the relevant binding sections in wrangler.jsonc to attach storage resources. In your application code, access them via the Workers runtime API:

import { env } from "cloudflare:workers";

const value = await env.MY_KV.get("key");

See the comments in wrangler.jsonc for the full list of supported binding types.

Project Structure

.
├── app/          # Pages and layouts (App Router convention)
│   ├── layout.tsx
│   ├── page.tsx
│   └── globals.css
├── public/       # Static assets
├── vite.config.ts
└── wrangler.jsonc

About

A full-stack application template powered by the vinext framework, deployed to Cloudflare Workers.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors