Deployment Guide
1. Local Development & Build
Development Environment
npm start
Uses the Create React App dev server with hot reload. Default URL: http://localhost:3000.
Production Build
npm run build
Output goes to the build/ directory, including optimized HTML, JS, CSS, and static assets.
2. Production Deployment (Cloudflare Pages)
Production is hosted on Cloudflare Pages.
| Configuration | Value |
|---|---|
| Build command | npm run build |
| Output directory | build |
| SPA support | Supported by default, no extra config |
Deployment Steps
- Create a Pages project in the Cloudflare Dashboard
- Connect your GitHub repo and select the branch
- Set the build command and output directory as in the table above
- Each push will trigger an automatic build and deploy
Environment Variables
If needed, configure them under Settings → Environment variables in the project.
Appendix: Other Hosting Options
| Platform | Build command | Output directory | Notes |
|---|---|---|---|
| Netlify / Vercel | npm run build | build | Connect Git to deploy |
| GitHub Pages | npm run build | build | Use gh-pages or Actions |
| Nginx self-hosted | — | build/ directory | Requires SPA fallback config |
Nginx SPA Fallback
For self-hosting, unmatched routes must serve index.html:
location / {
try_files $uri $uri/ /index.html;
}