This guide covers how to build and deploy the FHEVM Developer Bootcamp platform to production hosting services.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/0xchriswilder/journey/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The bootcamp is a static single-page application (SPA) built with Vite, React, and TypeScript. It can be deployed to any static hosting service including Netlify, Vercel, GitHub Pages, or AWS S3.The entire application runs client-side with no backend required. All student progress is stored locally using Zustand with localStorage persistence.
Prerequisites
Before deploying, ensure you have:- Node.js 18+ installed
- npm or bun package manager
- Git repository with the bootcamp source code
- Account on your chosen hosting platform
Build Process
Development Build
Run Development Server
Start the local development server:The app will be available at
http://localhost:8080.The dev server is configured in
vite.config.ts to run on port 8080 with IPv6 support (host: "::")Production Build
Build for Production
Create an optimized production build:This compiles TypeScript, bundles assets, and outputs to the
dist/ directory.Build configuration in vite.config.ts:- React SWC plugin for fast compilation
- Node.js polyfills for crypto libraries
- Path aliases (
@→./src) - Global shims for
Buffer,process,global
Build Slides (Optional)
If you’re using the Marp presentation slides:This converts Markdown slides in
public/slides/ to HTML using Marp CLI.Deployment Options
Option 1: Netlify
- Netlify CLI
- Netlify UI
Option 2: Vercel
Set Environment Variables
Option 3: GitHub Pages
Option 4: AWS S3 + CloudFront
Environment Variables Reference
All environment variables used in the bootcamp platform:RPC endpoint for blockchain connections (e.g.,
https://devnet.zama.ai)Chain ID for the network (e.g.,
8009 for Zama Devnet)Display name for the network (e.g.,
"Zama Devnet")Default contract address for demos. Use
0x0000... for mock mode.Enable mock contract interactions for testing without blockchain
URL to custom Comicy font file (optional)
Application name displayed in title and meta tags
SEO description for the bootcamp
GitHub repository URL for “View Source” links
Build Optimization
Bundle Size Analysis
Analyze your build size:vite.config.ts:
Performance Tips
Code Splitting
Code Splitting
The bootcamp already uses React Router lazy loading for pages. Further split large components:
Asset Optimization
Asset Optimization
- Compress images before adding to
public/ - Use WebP format for better compression
- Serve fonts from CDN (already configured for Telegraf)
Caching Strategy
Caching Strategy
Configure cache headers in your hosting:Netlify (Vercel (
netlify.toml):vercel.json):Continuous Deployment
Automated Deploys with Git
Most platforms support automatic deployment on git push:GitHub Actions Example
.github/workflows/deploy.yml
Troubleshooting
404 on Page Refresh
404 on Page Refresh
Problem: Refreshing any route except
/ returns 404.Solution: Ensure your hosting is configured for SPA routing:- Netlify: Check
public/_redirectsexists with/* /index.html 200 - Vercel: Add
vercel.jsonwith rewrites configuration - GitHub Pages: Use hash router or configure 404.html
Environment Variables Not Working
Environment Variables Not Working
Problem:
import.meta.env.VITE_* is undefined.Solution:- Ensure variables are prefixed with
VITE_ - Rebuild after changing
.env - For hosting platforms, set variables in the dashboard
- Check variables are set in build environment, not just runtime
Large Bundle Size
Large Bundle Size
Problem: Build size is too large.Solution:
- Check for duplicate dependencies:
npm dedupe - Analyze bundle:
npm run build -- --mode analyze - Remove unused Radix UI components
- Use dynamic imports for heavy components
Build Fails on Hosting Platform
Build Fails on Hosting Platform
Problem: Build succeeds locally but fails on hosting.Solution:
- Check Node.js version matches (18+)
- Ensure lock file is committed (
package-lock.json) - Check build logs for missing environment variables
- Try
npm ciinstead ofnpm installlocally
Custom Domain Setup
After deploying, configure a custom domain:- Netlify
- Vercel
- GitHub Pages
- Go to Site settings → Domain management
- Click “Add custom domain”
- Follow DNS configuration instructions
- Netlify auto-provisions SSL via Let’s Encrypt
Monitoring and Analytics
Add Analytics
Integrate analytics inindex.html:
Error Monitoring
Add Sentry for error tracking:src/main.tsx
Next Steps
After deployment:- Customize branding and content
- Set up instructor access
- Review the student experience
- Monitor analytics and user feedback
Need Help?
Open an issue on GitHub for deployment support