Skip to content

tinacms/tina-react-starter

Repository files navigation

This is a TinaCMS starter project for Vite + React.

Local Development

Install dependencies and start the dev server (Tina + Vite):

Note

Do you know the best package manager for Node.js? Using the right package manager can greatly enhance your development workflow. We recommend using pnpm for its speed and efficient handling of dependencies. Learn more about why pnpm might be the best choice for your projects by checking out this rule from SSW.

pnpm install
pnpm dev

Building (hosted content API)

Copy .env.example to .env, fill in your values from app.tina.io, then:

pnpm build

No credentials yet? pnpm build-local builds against local content.

Deploying

This is a client-side SPA — pnpm build produces one dist/index.html plus assets, and react-router decides routes in the browser. A host that only serves matching files will 404 on a direct hit or refresh of any route but /, so a rewrite/fallback to index.html is required:

  • Vercelvercel.json (included) rewrites every path to /index.html.
  • Cloudflare Workerswrangler.jsonc (included) sets assets.not_found_handling: "single-page-application", which does the same thing. Deploy with npx wrangler deploy after pnpm build.

Learn More

About

Just the essentials - get started with TinaCMS with minimum clutter

Topics

Resources

Stars

26 stars

Watchers

4 watching

Forks

Contributors