A Website for previewing mccc 3D model
- Cloudflare Pages (@cloudflare/next-on-pages): Hosting Service
- pnpm: Node.js package manager
- Next.js: React Framework
- React Three Fiber:
Three.js
wrapper for React
While Three.js lacks official TypeScript support, the community-maintained @types/three
library does provide excellent type definitions.
However, its coverage isn't exhaustive, and many existing examples and documents use JavaScript.
All you need is node
and pnpm
. You can install them as you like, but I recommend using mise
and corepack
for a consistent development environment.
- (Optional) Install and Setup mise, a JavaScript runtime manager. (Another option is
volta
,nodenv
,nvm
, etc.) - (Optional) Setup corepack corepack, a package manager manager.
corepack up
to install pnpm according topackage.json
settings.pnpm install
to install dependencies.pnpm fetch-model
(to clone the model's repository and move*.gltf
topublic/models
)
pnpm dev
to start the development server atlocalhost:3000
.pnpm lint
to lint the code.pnpm fmt
to format the code.
All deployment configuration is set in the Cloudflare dashboard. Cloudflare will automatically detect bun.
- Build Settings
- Build command:
pnpm build:cloudflare:pnpm
- Build directory:
.vercel/output/static
- Build command:
- Environment Variables
NODE_VERSION
:20
- Function Settings
- flags:
nodejs_compat
- flags:
Copy Cloudflare's deploy webhook URL and set it to the model's github repository's webhook so that the model is automatically updated when the model's repository is updated.