A modern MERN stack replacement designed for ultra-cheap, zero-ops deployment on Cloudflare—powered by ESMate, React, Nitro, Cloudflare Workers, oRPC type-safe APIs, Drizzle ORM, Cloudflare D1, Better Auth, TanStack Router, and elegant shadcn/ui components.
Everything you need to ship production-ready apps.
A carefully curated stack of modern technologies that work perfectly together.
Built with Vite, React, and TanStack Router for a blazing-fast, type-safe single page application experience. Styled with Tailwind CSS and shadcn/ui for modern, accessible interfaces.
Powered by Nitro for universal deployment and oRPC for end-to-end type safety. Includes Drizzle ORM for database management and Better Auth for a complete authentication solution.
Includes ESMate, a modern task runner and CLI that streamlines project management, automates formatting, and enhances your development workflow.
Explore fully functional demo apps built with this template to see the stack in action here:
https://cloudflare-react-nitro-orpc.dthvien.workers.dev/
A complete CRUD application demonstrating oRPC mutations, optimistic updates, and real-time state management with TanStack Query.
A live chat room showcasing oRPC subscriptions (Server-Sent Events) for real-time updates, message persistence, and multi-user communication.
This project is generated by the ESMate React Nitro template, providing a comprehensive and pre-configured foundation for building modern, type-safe full-stack applications with ease.
-
Create a new project:
npx create-esmate --template react-nitro
Change into the new project directory:
cd [new-project-name] -
Install dependencies:
pnpm install
-
Set up environment variables:
Create a
.envfile by copying thesample.envfile:cp sample.env .env
-
Configure Cloudflare
npx wrangler login
Then configure
wrangler.jsonwith your worker and database information. -
Run the development server:
pnpm run dev
This will run migrations and start the development server. Open http://localhost:8787 (or the port shown in your terminal) to see the result.
pnpm run dev: Runs database migrations and starts the Nitro + Vite development environment.pnpm run build: Performs type checking and creates a production build.pnpm run start: Previews the production build locally.pnpm run deploy: Deploys the production build to the cloud.pnpm run fix: Automatically fixes code formatting and linting issues.pnpm run check: Checks the codebase for formatting and linting errors.pnpm run test: Runs unit tests using Vitest.
Deploying on Cloudflare Workers and D1 provides a robust, cost-effective infrastructure for modern applications:
- Zero-Ops Scaling: Automatically scales from zero to global traffic without manual server management.
- Global Edge Performance: Your application runs in 300+ cities worldwide, delivering sub-100ms latency to users globally.
- Cost Efficiency: Leverage a generous free tier and a pay-as-you-go model that is significantly cheaper than traditional cloud providers.
- Integrated Data: Cloudflare D1 offers a native, serverless SQL database designed to work seamlessly with Workers.
- Fast Development Cycle: With
wrangler, you can preview and deploy changes to the global network in seconds.