An open API service indexing awesome lists of open source software.

https://github.com/mmvergara/react-supabase-auth-template

React Supabase Auth template with Protected Routes
https://github.com/mmvergara/react-supabase-auth-template

authentication boilerplate boilerplate-template react react-router-dom supabase template

Last synced: 11 months ago
JSON representation

React Supabase Auth template with Protected Routes

Awesome Lists containing this project

README

          


React Supabase Auth with Protected Routes



[**`🌐 App Demo`**](https://react-supabase-auth-template.vercel.app/)

## 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.](https://react-supabase-auth-template.vercel.app/)

[We also have a similar template for FIREBASE πŸ”₯](https://github.com/mmvergara/react-firebase-auth-template)
## Getting Started

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

## What you need to know

- `/router/index.tsx` is where you declare your routes
- `/context/SessionContext.tsx` is where you can find the `useSession` hook
- This hook gives you access to the `session` object from Supabase globally
- `/Providers.tsx` is where you can add more `providers` or `wrappers`

## Other Supabase Templates

- [React ShadCN Supabase Auth Template 🌟](https://github.com/mmvergara/react-supabase-shadcn-auth-template)
- [NextJs ShadCN Supabase Auth Template 🌟](https://github.com/mmvergara/nextjs-shadcn-supabase-auth-starter)

## More Starter Templates

- [NextJs MongoDB Prisma Auth Template 🌟](https://github.com/mmvergara/nextjs-mongodb-prisma-auth-template)
- [NextJs Discord Bot Template 🌟](https://github.com/mmvergara/nextjs-discord-bot-boilerplate)
- [React FirebaseπŸ”₯ Auth Template 🌟](https://github.com/mmvergara/react-firebase-auth-template)
- [Golang Postgres Auth Template](https://github.com/mmvergara/golang-postgresql-auth-template)
- [Vue Golang PostgresSql Auth Template](https://github.com/mmvergara/vue-golang-postgresql-auth-starter-template)
- [Vue Supabase Auth Template](https://github.com/mmvergara/vue-supabase-auth-starter-template)
- [Remix Drizzle Auth Template](https://github.com/mmvergara/remix-drizzle-auth-template)