Skip to content

MaxwellCohen/web-perf-reporting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

252 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Web perf reporting (monorepo)

pnpm workspace containing the Next.js dashboard and the Cloudflare PageSpeed worker.

Package Path Deploy
Web apps/web Vercel — root directory apps/web
Worker apps/worker Cloudflare Workers — project root apps/worker

Both apps deploy from this repo via dashboard Git integrations (no GitHub Actions required).

Local development

From the repo root:

pnpm install
pnpm dev:web      # Next.js at http://localhost:3000
pnpm dev:worker   # wrangler dev

Other root scripts: pnpm test, pnpm typecheck, pnpm build:web, pnpm check:worker.

Environment

App Env file Required variables
apps/web .env (see .env.example) PAGESPEED_INSIGHTS_API, TURSO_*, NEXT_PUBLIC_POSTHOG_*, WORKER_URL
apps/worker .dev.vars (see .dev.vars.example) PAGESPEED_INSIGHTS_API

If you still have .env at the repo root from before the monorepo move, copy it to apps/web/.env.

Vercel (apps/web)

In the Vercel project for web-perf-reporting:

  1. Root Directoryapps/web

  2. Install Command (monorepo lockfile at repo root):

    cd ../.. && pnpm install --frozen-lockfile
  3. Build Commandpnpm build (runs in apps/web)

  4. Environment variables — include existing vars plus WORKER_URL (production worker URL, e.g. https://web-perf-report-cf.<account>.workers.dev)

  5. Ignored Build Step (optional):

    git diff HEAD^ HEAD --quiet -- apps/web pnpm-lock.yaml pnpm-workspace.yaml package.json

Cloudflare Workers (apps/worker)

In Workers & Pages → web-perf-report-cf (or reconnect Git):

  1. RepositoryMaxwellCohen/web-perf-reporting, branch main
  2. Root directoryapps/worker
  3. Wrangler configapps/worker/wrangler.toml
  4. SecretsPAGESPEED_INSIGHTS_API (dashboard or wrangler secret)
  5. KV/R2 bindings in wrangler.toml must match your account

After migration, archive the standalone web-perf-report-cf repo.

App docs

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages