TLDR: got tired of setting up this lightweight stack over and over again for some clients so i made a template, and i'm just here to share to ya'll.
π Github Repository
π App Demo
Features
- π Protected Routes
- π Firebase User Object in Global Context via
useUser - π User Authentication
- π Routing
It's also blazingly fast π₯ No really, try it out for yourself.
Getting Started
- Clone the repository
- Install dependencies:
npm install - Go to
./config.tsand add your Firebase configuration - Run the app:
npm run dev
What you need to know
-
/router/index.tsxis where you declare your routes -
/context/AuthContext.tsxis where you can find theuseUserhook- This hook gives you access to the
userobject from Firebase Auth globally
- This hook gives you access to the
-
/Providers.tsxis where you can add moreprovidersorwrappers
mmvergara / react-firebase-auth-template
React Firebase Auth template with Protected Routes π₯
React Firebase Auth with Protected Routes
Features
- π Protected Routes
- π Firebase User Object in Global Context via
useUser - π User Authentication
- π Routing
It's also blazingly fast π₯ No really, try it out for yourself.
We also have a similar template for SUPABASEππ
Getting Started
- Clone the repository
- Install dependencies:
npm install - Go to
./config.tsand add your Firebase configuration - Run the app:
npm run dev
What you need to know
-
/router/index.tsxis where you declare and manage your routes -
/context/AuthContext.tsxis where you can find theuseUserhook- This hook gives you access to the
userobject from Firebase Auth globally
- This hook gives you access to the
-
/Providers.tsxis where you can add moreprovidersorwrappers

Top comments (1)
dev.to/mmvergara/react-supabase-au...
Made a similar template for supabase too π