Skip to content
team401Public

About

Website for FRC Team 401

Resources

Stars

0 stars

Watchers

2 watching

Forks

Repository files navigation

FRC Team 401 Website

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.

Stack

  • 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

Requirements

  • Node.js 26.12 or newer (.nvmrc pins the expected version)
  • npm

Development

npm ci
npm run dev

npm run dev regenerates optimized images first, then starts the Vite dev server. Open the URL it prints.

Scripts

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

Content

  • Pages live in src/app/; most are page.mdx, while first/ and outreach/ use page.tsx.
  • Shared UI is in src/app/components/ and global styles are in src/app/ui.css.
  • MDX element styling is configured in mdx-components.tsx.

Images

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.

Checks

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

Deployment

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 deploy

Named preview deploy:

npm run deploy:preview -- --preview-name my-fix

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

About

Website for FRC Team 401

Resources

Stars

0 stars

Watchers

2 watching

Forks

Used by

Contributors

Languages