Nuxt 4 and Nuxt UI application deployed on Cloudflare Workers. PostgreSQL stores Better Auth and application data through Cloudflare Hyperdrive; Workers KV provides key-value storage, and R2 stores uploaded images. Nuxt Image uses Cloudflare Image Transformations.
Install and activate Vite+ using its official installer, then in a new shell run vp env doctor. The project pins Node 26.12.0 in .node-version and pnpm in package.json; install dependencies with:
vp install
cp .dev.vars.example .dev.varsSet a random BETTER_AUTH_SECRET in .dev.vars (for example, generate one with openssl rand -base64 32). Set DATABASE_URL in .env to a PostgreSQL database you control. The example uses Cloudflare's public Turnstile test keys for local development. Then run the local Worker runtime:
vp run db:generate
vp run db:migrate
vp run db:seed:admin
vp run devTo load local-only demo content for the admin screens, run vp run db:seed:demo. It creates 100 sample records in each content collection. Re-run with vp run db:seed:demo -- --clear to remove those demo records.
For local development, the seed command creates [email protected] / admin123. Public sign-up is disabled. For a remote account, set ADMIN_EMAIL and ADMIN_PASSWORD before running the seed command; optionally set ADMIN_PREVIOUS_EMAIL to rename an existing seeded account.
vp run dev, vp run build, and vp run typecheck all go through the Void Nuxt integration. The development command uses Void's local Cloudflare bindings.
Void 1.11.0 handles local Cloudflare bindings and deployment for this Nuxt/Vue application; it requires Node.js 24.22+ or 26.12+ (the repository pins 26.12.0). void.config.ts is the canonical Worker configuration. void:dev uses a local target with no routes and DATABASE_URL. Staging uses an isolated PostgreSQL database via STAGING_DATABASE_URL, separate KV/R2 resources, and no Email Sending binding. Use vp run void:staging:dev, vp run void:staging:typecheck, vp run void:staging:build, and vp run void:staging:deploy for staging. The staging auth smoke command signs in a generated disposable account and checks protected admin access; run vp run void:staging:auth-smoke with STAGING_DATABASE_URL. Production uses DATABASE_URL. Production deploy automation stays disabled until data transfer and validation are complete and the protected GitHub variable POSTGRES_CUTOVER_READY is set to true. The guarded deploy applies PostgreSQL migrations. Run vp run void:production:build, vp run void:production:check, and vp run void:production:deploy only after the cutover gate is satisfied. The guard checks the Worker, KV/R2 resources, email binding, preview visibility, PostgreSQL migration files, and apex/www routes. DNS and routes are reused; do not use bare void deploy. The wrapper stages legacy dotenv files under ignored .void/ while Void runs and restores them afterward.
The PostgreSQL data copy has been completed and every row was compared against D1. The deployed Worker still serves D1 until Hyperdrive is provisioned and the PostgreSQL-backed Worker is deployed. Before cutover, run vp run db:sync:production-data to refresh the PostgreSQL mirror from the current D1 snapshot and verify it again. Keep POSTGRES_CUTOVER_READY unset until the production deploy succeeds.
Production KV and R2 resources are configured in void.config.ts. PostgreSQL is connected through Hyperdrive using DATABASE_URL; set that secret for local development and in the protected production deployment environment. For a new installation, provision resources in Cloudflare and update the bindings in that config before deploying.
Onboard ropodl.com for Cloudflare Email Sending in the Cloudflare dashboard and verify its SPF/DKIM records. The Worker uses a send_email binding restricted to [email protected]; local Cloudflare development uses the remote binding to send through Cloudflare Email Service.
Set production secrets:
vp exec void secret put BETTER_AUTH_SECRET
vp exec void secret put TURNSTILE_SECRET_KEYCreate a Turnstile widget in the Cloudflare dashboard. Set its site key as the Worker variable NUXT_PUBLIC_TURNSTILE_SITE_KEY. The local .dev.vars.example uses Cloudflare's published test keys; replace these with real keys for production.
For Web Analytics, add the site in Cloudflare's Web Analytics dashboard and set the provided token as the Worker variable NUXT_PUBLIC_CLOUDFLARE_WEB_ANALYTICS_TOKEN. The app injects the official Cloudflare beacon only when this token is set. Cloudflare Web Analytics reports field Core Web Vitals (LCP, INP, and CLS); review its Core Web Vitals dashboard after real visitor data has accumulated. Contact messages are sent via the Worker send_email binding from and to [email protected] (configure forwarding for that address in the Cloudflare dashboard).
Apply the PostgreSQL migration and create the remote admin account:
vp run db:migrate:remote
vp run db:seed:admin -- --remoteThen deploy:
vp run void:production:build
vp run void:production:check
vp run void:production:deployAdd a custom domain to the Worker in Cloudflare. Set BETTER_AUTH_URL to that origin if you need an explicit auth URL; otherwise, the request origin is used. Enable Images > Transformations for the zone to activate Nuxt Image's Cloudflare provider.
Canonical URLs and social-card links use https://ropodl.com by default; set NUXT_PUBLIC_SITE_URL when deploying to a different public origin.
The public sitemap is served at /sitemap.xml, with published blog posts and projects added from PostgreSQL. /robots.txt points crawlers to the sitemap and excludes private routes. /llms.txt provides AI assistants with a concise guide to the public site and its canonical URLs.
- The admin content editor stores versioned JSON blocks for paragraphs, headings, lists, quotes, callouts, images, galleries, timelines, stats, FAQs, buttons, links, code, and dividers. Existing rich HTML content remains readable and is converted to blocks when edited. Project detail pages use these blocks in an editorial case-study layout with a cover, section navigation, and reading progress.
server/utils/content.tsvalidates block counts, field lengths, link protocols, and per-user R2 image paths before saving. Public block rendering uses Vue text bindings; legacy HTML continues through the server-side allowlist sanitizer.void.config.tsis the canonical Worker config for local development and deployment.server/utils/cloudflare.tsreads request-scoped Worker bindings and secrets.db/schema.tsis Void's schema entry point and re-exports the tables inserver/db/schema.ts, which usevoid/schema-pg. Server queries use Void'svoid/dbclient and operators. PostgreSQL migrations live indb/migrations/; the former SQLite/D1 history is retained separately indb/migrations-d1/as a reference for the data transfer. Apply migrations withvp run db:migrateandvp run db:migrate:remote; generate new ones withvp run db:generate.- Public PostgreSQL-backed HTML uses host-scoped Void ISR with a 60-second TTL. Because the pages read editable content from PostgreSQL, they are not build-prerendered. Preview queries and private routes stay out of the shared cache.
server/utils/auth.tsconfigures Better Auth with PostgreSQL, email/password sign-in, and disabled public sign-up.server/utils/kv.tsexposes the Cloudflare KV namespace for server routes.- Cloudflare Workers Rate Limiting bindings protect contact submissions (5/min/IP), sign-in (10/min/IP), and uploads (20/min/user). These counters are approximate and location-local, as documented by Cloudflare.
- The contact form uses Turnstile and validates tokens server-side with Siteverify.
- Cloudflare Web Analytics loads its beacon only when
NUXT_PUBLIC_CLOUDFLARE_WEB_ANALYTICS_TOKENis configured. - Successful contact submissions and article usefulness feedback are aggregated by UTC day in PostgreSQL without storing visitor identifiers. The admin dashboard shows the last 30 days of contact conversions and feedback. Apply the PostgreSQL schema migration to enable these metrics.
- Article feedback is limited by a Cloudflare Rate Limiting binding and a per-article local-storage marker; it does not persist names, email addresses, or IP addresses. The
FEEDBACK_LIMITERbinding is configured invoid.config.ts. POST /api/uploadsrequires an authenticated session and stores PNG, JPEG, WebP, AVIF, or GIF images in R2 (up to 4 MB).GET /api/uploads/:pathserves them from the same Worker origin.POST /api/contactvalidates contact form submissions and sends them through Resend.
Vite+ is installed as the project task runner and manages the local Node/package-manager toolchain. The repository pins Node in .node-version and pnpm in package.json. Install dependencies with vp install; run tasks through vp run lint, vp run typecheck, vp run build, and the target-specific Void commands.
GitHub Actions installs the pinned dependencies and runs lint and typecheck through Vite+ on pull requests and pushes to main or migration/cloudflare-void-vue. Production deployment on main runs only when the protected repository variable POSTGRES_CUTOVER_READY is true; it builds and deploys through the guarded Void scripts with DATABASE_URL from the production environment secret. Configure CLOUDFLARE_API_TOKEN and DATABASE_URL as environment secrets and CLOUDFLARE_ACCOUNT_ID as an environment variable. Protect that environment with required reviewers if production deploy approval is desired. Deploys are serialized and are not cancelled once started. No production deploy occurs from pull requests or the migration branch.
vp run dev # Nuxt development server
vp run void:dev # Nuxt + Void local development
vp run void:typecheck # Typecheck with Void Nitro integration enabled
vp run void:build # Default-target Void build (does not deploy)
vp run void:smoke # Local candidate server smoke test
vp run void:staging:auth-smoke # Check staging sign-in and protected admin access
vp run db:generate # Generate Void migrations from the reconciled latest schema snapshot
vp run db:migrate # Apply migrations to local PostgreSQL (DATABASE_URL)
vp run db:migrate:remote # Apply migrations to the configured remote PostgreSQL database
vp run db:seed:admin # Seed local admin (add -- --remote for production)
vp run lint
vp run typecheck
