Deployment
Kinetic Email is hosted on Vercel with automatic deployments from the main branch.
Build Pipeline
convex deploy --cmd 'npm run build:vite && npm run build:prerender && npm run build:sitemap'
This runs in sequence:
- Convex deploy — Deploys real-time tracking functions
- Vite build — Compiles React app to
dist/ - Pre-render — Generates static HTML for SEO (
scripts/prerender.mjs) - Sitemap — Generates
dist/sitemap.xml(scripts/generate-sitemap.mjs)
Vercel Configuration
The vercel.json file defines:
- Framework: Vite
- API functions: Serverless functions from
api/directory - Rewrites: SPA fallback (
/*→index.html), blog OG images - Headers: Security headers (X-Content-Type-Options, X-Frame-Options), CORS, cache control
- CORS: Restricted to
kinetic.emailand localhost origins
Pre-rendering for SEO
The pre-render script (scripts/prerender.mjs) injects static HTML and meta tags into route-specific index.html files:
dist/index.html → Homepage
dist/learn/index.html → Learning hub
dist/playground/index.html → AI Playground
dist/blog/index.html → Blog listing
...
SEO metadata is configured in src/seo/seoConfig.ts. Auth-gated pages (learn modules 2-6, marketing modules 2-5) have noindex: true.
Running Tests Before Deploy
npm test # Run all tests
npm run build # Verify build succeeds
Always run tests before deploying, especially after modifying:
- API routes
- Auth logic
- Token economy functions
- Email generation pipeline
Environment Variables
All environment variables must be configured in the Vercel project settings. See Environment Variables for the complete list.