Create .env from .env.example and provide the Firebase web app values through VITE_* variables before running or deploying the client.
Push notifications are enabled by default in the current app. Set VITE_ENABLE_PUSH_NOTIFICATIONS=false only if Firebase Cloud Messaging is not configured for your deployed domain yet.
Vercel can read this app correctly as a Vite SPA.
Add these Environment Variables in the Vercel project settings before deploying:
VITE_FIREBASE_API_KEYVITE_FIREBASE_AUTH_DOMAINVITE_FIREBASE_PROJECT_IDVITE_FIREBASE_STORAGE_BUCKETVITE_FIREBASE_MESSAGING_SENDER_IDVITE_FIREBASE_APP_IDVITE_FIREBASE_MEASUREMENT_IDVITE_FIREBASE_VAPID_KEYVITE_ENABLE_PUSH_NOTIFICATIONS
vercel.json adds the SPA rewrite Vercel expects for deep links such as /dashboard and /tasks/:id.
After the first deploy, add the Vercel production and preview domains to Firebase Authentication authorized domains, and complete Firebase Cloud Messaging web push setup for those same domains if you want device notifications on desktop or mobile browsers.
The app now registers FCM tokens only after notification permission is granted. For the stronger desktop/mobile device notifications to work while the app is in the background, make sure your Firebase Web Push certificate key is stored in VITE_FIREBASE_VAPID_KEY.
For Google sign-in to work in production, add every deployed domain to Firebase Authentication:
- Open Firebase Console.
- Go to Authentication > Settings > Authorized domains.
- Add your production domain and any preview domains you plan to use.
- Make sure Google is enabled under Authentication > Sign-in method.