A modern, production-ready template for building full-stack React applications using React Router and the Cloudflare Vite plugin.
- 🚀 Server-side rendering
- ⚡️ Hot Module Replacement (HMR)
- 📦 Asset bundling and optimization
- 🔄 Data loading and mutations
- 🔒 TypeScript by default
- 🎉 TailwindCSS for styling
- 📖 React Router docs
Outside of this repo, you can start a new project with this template using C3 (the create-cloudflare CLI):
npm create cloudflare@latest -- --template=cloudflare/templates/react-router-starter-templateA live public deployment of this template is available at https://react-router-starter-template.templates.workers.dev
Install the dependencies:
npm installStart the development server with HMR:
npm run devYour application will be available at http://localhost:5173.
Generate types for your Cloudflare bindings in wrangler.json:
npm run typegenCreate a production build:
npm run buildPreview the production build locally:
npm run previewIf you don't have a Cloudflare account, create one here! Go to your Workers dashboard to see your free custom Cloudflare Workers subdomain on *.workers.dev.
Once that's done, you can build your app:
npm run buildAnd deploy it:
npm run deployTo deploy a preview URL:
npx wrangler versions uploadYou can then promote a version to production after verification or roll it out progressively.
npx wrangler versions deployThis template comes with Tailwind CSS already configured for a simple default starting experience. You can use whatever CSS framework you prefer.
Built with ❤️ using React Router.