Overview
Pulse Content is deployed on Cloudflare Pages, combining:- Static site hosting (React frontend)
- Edge functions (Cloudflare Workers for API)
- Global CDN (200+ data centers)
- KV storage (rate limiting, social metadata)
Prerequisites
Cloudflare Account
Sign up at cloudflare.com if you don’t have an account
Project Configuration
wrangler.toml
Note: Do NOT add
account_id in wrangler.toml for Pages projects. It’s passed via GitHub Actions secrets.Build Configuration
Build command:npm run build
Output directory: dist/
Build steps:
- TypeScript compilation (
tsc -p tsconfig.json) - Vite bundling with code splitting
- Asset optimization and minification
Environment Variables
Required Secrets
Optional Variables
KV Namespace Setup
Create KV Namespace
id to wrangler.toml:
Preview Namespace (Optional)
For testing in preview environments:Manual Deployment
Build and Deploy
Preview Production Build Locally
Test the production build before deploying:http://localhost:8788
Custom Domain Setup
Add custom domain
In Cloudflare dashboard:
- Navigate to Workers & Pages > pulse-content
- Go to Custom domains tab
- Click Set up a custom domain
Deployment Checklist
Before deploying to production:Rollback
Cloudflare Pages keeps deployment history:- Go to Workers & Pages > pulse-content > Deployments
- Find previous successful deployment
- Click ⋯ > Rollback to this deployment
Monitoring
View Logs
Analytics
View analytics in Cloudflare dashboard:- Workers & Pages > pulse-content > Analytics
- Request volume, error rates, response times
- Top endpoints, geographic distribution
Performance
Cloudflare Global Network
- 200+ data centers worldwide
- Sub-100ms latency for most users
- Automatic caching of static assets
- Edge computing for API endpoints
Build Optimizations
Troubleshooting
Build fails with TypeScript errors
Build fails with TypeScript errors
Run type checking locally:Fix all errors before deploying
Environment variables not working
Environment variables not working
- Verify secrets are set in Cloudflare dashboard
- Redeploy after adding new secrets
- Check variable names match code references
API endpoints return 500 errors
API endpoints return 500 errors
Check Worker logs:Common causes:
- Missing environment variables
- API rate limits exceeded
- Invalid API credentials
KV namespace binding errors
KV namespace binding errors
Ensure KV namespace ID in
wrangler.toml matches actual namespace:Next Steps
Environment Config
Learn about environment configuration
CI/CD Pipeline
Set up automated deployment
Setup Guide
Local development setup
Architecture
System architecture overview