Skip to content

A template repository that has basic setup for React/Vite, mui/material css framework, CF worker backend in typescript. Features dynamic cors policy for backend and baseUrl for frontend to aid in local development.

Notifications You must be signed in to change notification settings

TechnicalParadox/ReactViteMuiCFWorkerTS-Template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Vite/React, MUI/Material v6, Cloudflare Worker, TS Template

  1. npm install in both frontend and backend folders.
  2. Create backend/.dev.vars and set environment="development"
  3. Adjust name of backend worker in .wrangler.toml
  4. Adjust names in frontend and backend package.json
  5. Adjust domains in frontend/src/helpers/environment_detection.ts and in backend/src/index.ts to be actual site domains, development domains should work as is.
  6. In frontend, npm run dev to start vite development server
  7. In backend, npx wrangler init to start cf wroker development server
  8. You now have a basic Vite/React site with Material UI v6 toggleable light/dark theme and Cloudflare worker integration!

Packages: Hono, Oslo, @mui/material, react, etc.

The CF worker has a Cors policy that allows requests from localhost when in development and prodDomains in production. The frontend has a baseUrl constant to automatically adjust fetches to the cloudflare worker based on local development/production environment.

About

A template repository that has basic setup for React/Vite, mui/material css framework, CF worker backend in typescript. Features dynamic cors policy for backend and baseUrl for frontend to aid in local development.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published