Skip to content

Latest commit

 

History

31 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Supabase Auth

React + Supabase Auth

Minimal React + Vite + Supabase Auth starter from @open-templates — Google OAuth, email/password flows, protected routes, and JWT calls to a paired Cloudflare Worker API.

Use this template



Release License React CI



React Supabase Auth template


Features

  • Google OAuthsignInWithOAuth({ provider: 'google' }) via Supabase
  • Email auth — login, signup, password recovery, and reset
  • Auth routing — guest-only and authenticated route guards
  • Session handlingAuthContext with access token mirrored for API calls
  • API health indicator — header polls GET /health every 30s
  • Protected homeGET /me with the Supabase JWT on the authenticated landing page
  • Backend pairing — shared contract with cf-hono-supabase-api-template
  • Init wizard./scripts/init-from-template.sh personalizes repo metadata from templates/

Stack

  • React 19, TypeScript, Vite 7
  • Supabase Auth (@supabase/supabase-js)
  • Tailwind CSS, shadcn-style UI primitives
  • Bun (package manager)

Quick start

  1. Use this template on GitHub, then clone your repo.
  2. Personalize from templates/:
./scripts/init-from-template.sh
  1. Install and run:
bun install
cp .env.example .env.local
bun run dev

Start the API worker first (cf-hono-supabase-api-template on port 8787) so health and /me work locally.

See templates/ABOUT_TEMPLATES.md and docs/INIT_TEMPLATE.md.

Environment variables

Variable Required Purpose
VITE_SUPABASE_URL Yes Supabase project URL
VITE_SUPABASE_PUBLISHABLE_KEY Yes Supabase anon/publishable key
VITE_API_BASE_URL No Worker URL (default http://localhost:8787)

Supabase + Google OAuth setup: docs/SUPABASE_SETUP.md

Scripts

Script Purpose
bun run dev Development server
bun run build / bun run ci Production build
bun run lint / bun run typecheck Quality checks
bun run init Copy templates/ → root (after fork)

Deployment

Target: Cloudflare Pages. Build command bun run build, output directory dist. Set the same VITE_* variables in the Pages project settings.

Documentation

Doc Description
index.md OKF bundle — routes, API contracts, extension notes
INSTRUCTIONS.md Maintainer and adopter guide
docs/SUPABASE_SETUP.md Supabase project + Google OAuth
docs/INIT_TEMPLATE.md Init wizard reference
.agents/skills/ Cursor agent skills catalog
CHANGELOG.md Release history

Supabase Auth pack: pairs with cf-hono-supabase-api-template (Hono), or any backend implementing the same GET /health and JWT GET /me contract.

Maintained by @open-templates · Charlie Rios (@xarlizard)

License

MIT — see LICENSE.


Repository documents

README | INSTRUCTIONS | CHANGELOG | CONTRIBUTING | SECURITY | CODE_OF_CONDUCT

About

React + Supabase Auth starter template. Auth on the client; data via your API worker.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Contributors

Languages