ZOYKUHot Board

mmvergara/react-supabase-auth-templateTài liệu kỹ thuật

React Supabase Auth Starter Template with Protected Routes

Thông báo ngôn ngữ:Chưa có tài liệu tiếng Việt cho kho lưu trữ này. Đang hiển thị bản gốc tiếng Anh chính thức.
npm i react-supabase-auth-template

React Supabase Auth with Protected Routes

🌐 App Demo

Features

  • 🚀 Protected Routes
  • 🚀 Supabase Session Object in Global Context via useSession
  • 🚀 User Authentication
  • 🚀 Routing and Route Guards

It's also blazingly fast 🔥 No really, try it out for yourself.

We also have a similar template for FIREBASE 🔥

Getting Started

  1. Requires Node.js 22.22+
  2. Clone the repository
  3. Install dependencies: npm install
  4. Create .env using the .env.example as a template
VITE_SUPABASE_URL=
VITE_SUPABASE_ANON_KEY=
  1. Run the app: npm run dev

What you need to know

  • Built with React Router v8 framework mode in SPA mode (ssr: false in react-router.config.ts)
  • app/routes.ts is where you declare your routes, each route module lives in app/routes/
    • app/routes/auth-protected-layout.tsx guards every route nested under it
  • app/context/SessionContext.ts is where you can find the useSession hook
    • This hook gives you access to the session object from Supabase globally
  • app/root.tsx is the HTML document and where you can add more providers or wrappers
  • npm run build outputs a static site to build/client

Other Supabase Templates

More Starter Templates

Bản sao tài liệu lưu trữ từ kho lưu trữ GitHub chính thức · Xem trên GitHub
Ngày đồng bộ: 2026-11-08