Skip to content
View ropodl's full-sized avatar
😋
Nevermind
😋
Nevermind

Block or report ropodl

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Content in all repositories owned by your account will be closed.
Maximum 250 characters. Please don’t include any personal information such as legal names or email addresses. This note will only be visible to you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
ropodl/README.md

Saroj Poudel Projects

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 develop

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.vars

Set 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 dev

To 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.

Cloudflare setup

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_KEY

Create 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 -- --remote

Then deploy:

vp run void:production:build
vp run void:production:check
vp run void:production:deploy

Add 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.

Cloudflare resources in code

  • 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.ts validates 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.ts is the canonical Worker config for local development and deployment.
  • server/utils/cloudflare.ts reads request-scoped Worker bindings and secrets.
  • db/schema.ts is Void's schema entry point and re-exports the tables in server/db/schema.ts, which use void/schema-pg. Server queries use Void's void/db client and operators. PostgreSQL migrations live in db/migrations/; the former SQLite/D1 history is retained separately in db/migrations-d1/ as a reference for the data transfer. Apply migrations with vp run db:migrate and vp run db:migrate:remote; generate new ones with vp 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.ts configures Better Auth with PostgreSQL, email/password sign-in, and disabled public sign-up.
  • server/utils/kv.ts exposes 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_TOKEN is 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_LIMITER binding is configured in void.config.ts.
  • POST /api/uploads requires an authenticated session and stores PNG, JPEG, WebP, AVIF, or GIF images in R2 (up to 4 MB). GET /api/uploads/:path serves them from the same Worker origin.
  • POST /api/contact validates contact form submissions and sends them through Resend.

Vite+ toolchain

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.

CI/CD

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.

Scripts

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

Pinned Loading

  1. VueDash VueDash Public

    Vue Dashboard UI with Vuetify Js.

    Vue 1 1

  2. apitech-website apitech-website Public

    API Technology offer you a business to business service in the Web, Mobile, Networking, ICT and Electronics Hardware platform.

    Vue

  3. techfest-admin techfest-admin Public

    Vue

  4. techfest-api techfest-api Public

    JavaScript 1 1

  5. wm-api wm-api Public

    JavaScript

  6. wm-app wm-app Public

    Vue