examples/react/authenticated-routes-firebase/README.md
An example demonstrating authentication with Firebase and protected routes.
To start a new project based on this example, run:
npx gitpick TanStack/router/tree/main/examples/react/authenticated-routes-firebase authenticated-routes-firebase
Create a Firebase project
Enable Authentication in the Firebase console
Add GitHub as an authentication provider:
https://your-firebase-project-id.firebaseapp.com/__/auth/handlerCreate a web app in your Firebase project:
Copy the .env.example provided and configure with your firebase credentials:
VITE_FIREBASE_API_KEY=
VITE_FIREBASE_AUTH_DOMAIN=
VITE_FIREBASE_PROJECT_ID=
VITE_FIREBASE_STORAGE_BUCKET=
VITE_FIREBASE_MESSAGING_SENDER_ID=
VITE_FIREBASE_APP_ID=
Install dependencies:
pnpm install
Start the development server:
pnpm dev
Build for production:
pnpm build
This example demonstrates: