The public website for Copperhead Robotics, FRC Team 401: team401.org.
The site uses the Next.js App Router on vinext, with React, TypeScript and MDX. Vite handles the build, and the site runs as a Cloudflare Worker.
- Next.js App Router via vinext, React 19 and TypeScript
- MDX for page content
- Vite for local development and production builds
- Cloudflare Workers for hosting, static assets and image transformations
- GitHub Actions for CI and production deployments
- Node.js 26.12 or newer (
.nvmrcpins the expected version) - npm
npm ci
npm run devnpm run dev regenerates optimized images first, then starts the Vite dev server. Open the URL it prints.
| Command | Description |
|---|---|
npm run dev |
Optimize images and start the dev server |
npm run build |
Optimize images and create the production build |
npm run start |
Serve the production build locally |
npm run images:build |
Regenerate optimized images and the image manifest |
npm run lint |
Run ESLint |
npm run typecheck |
Run TypeScript checks |
npm run deploy |
Build and deploy the production Worker |
npm run deploy:preview |
Build and deploy a named Worker preview |
npm run cf-typegen |
Generate Worker types from cloudflare.config.ts |
- Pages live in
src/app/; most arepage.mdx, whilefirst/andoutreach/usepage.tsx. - Shared UI is in
src/app/components/and global styles are insrc/app/ui.css. - MDX element styling is configured in
mdx-components.tsx.
Put source images in public/img/ and render them with <RespImage src="/img/..." alt="..." />. scripts/optimize-images.mjs generates responsive AVIF and WebP variants in public/_optimized/ (gitignored) and writes src/generated/image-metadata.ts, which is committed. Run npm run images:build after adding or removing images; dev and build run it automatically.
CI (.github/workflows/ci.yml) runs on every push and pull request:
- ESLint and TypeScript
- production build
- client JavaScript budget (1400 KiB uncompressed)
- image manifest coverage and optimized variants
Merging to main runs .github/workflows/deploy.yml, which builds and deploys the team401-website Worker and records the deploy in the Production environment. It needs the CLOUDFLARE_API_TOKEN repository secret; the account ID and Worker settings live in cloudflare.config.ts.
Manual production deploy:
npm run deployNamed preview deploy:
npm run deploy:preview -- --preview-name my-fixThe site is served at team401.org. The Worker is also available at team401-website.team-401-resources.workers.dev, and each deployed version gets a preview URL of the form https://<version>-team401-website.team-401-resources.workers.dev. GitHub Pages is no longer used.