This npm-workspaces monorepo contains the applications for Your Average Tech Bro. Both applications run on TanStack Start and Cloudflare Workers.
apps/
web/ Consulting website and Cloudflare Worker
studio/ Private video production workspace and Cloudflare Worker
docs/
migration/ Migration plan, architecture, and decision log
Add future applications under apps. Keep code inside an application until another application needs the same contract.
Install Node.js 22 or newer, then run these commands from the repository root:
npm ci
cp apps/web/.dev.vars.example apps/web/.dev.vars
npm run devReplace both placeholder values in apps/web/.dev.vars if you need to exercise Stripe. The landing page does not need Stripe credentials.
Open http://localhost:3000.
Create the local D1 database and start Studio:
npx wrangler d1 migrations apply yatb-studio --local --cwd apps/studio
BETTER_AUTH_SECRET=replace-with-at-least-32-random-characters \
APP_ORIGIN=http://localhost:3001 EMAIL_MODE=capture \
EMAIL_FROM=studio@studio-mail.youraveragetechbro.com npm run dev:studioSet a random BETTER_AUTH_SECRET with at least 32 characters. Open
http://localhost:3001. Local authentication messages are stored in the
email_outbox D1 table. Production sends them through the restricted
AUTH_EMAIL Cloudflare Email Sending binding.
Run the type and Cloudflare binding checks:
npm run checkBuild the production Worker and prerendered landing page:
npm run buildRun the production output locally:
npm run previewAuthenticate Wrangler with the Cloudflare account that owns the project:
npx wrangler login
npx wrangler whoamiSet the production Stripe secret once for the yatb-web Worker:
npx wrangler secret put STRIPE_SECRET_KEY --cwd apps/webDeploy the checked and built application:
npm run deploy:webapps/web/wrangler.jsonc defines the Worker name, runtime date, non-secret bindings, and canonical application origin. The Stripe price ID is a public identifier stored there as a Worker variable. Run npm run cf-typegen --workspace @yatb/web after you change that file.
Studio deployment remains separate. Follow the checked production procedure in
docs/studio/production-runbook.md. The
runbook separates validation, migration, and deployment so no production write
is hidden inside a check command.
The custom domain migration keeps www.youraveragetechbro.com as the canonical hostname and redirects the apex domain to www. Verify the workers.dev deployment before changing production DNS.