Starter Code - Full Setup of Next.js and Firebase Auth + Firestore + Cloud Messaging #23875
Unanswered
shreyas-jadhav
asked this question in
Show and tell
Replies: 1 comment 6 replies
-
Great example, have you considered lazy loading some of the firebase modules to improve performance? |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Guys!
From past few weeks, I was working with next-firebase-auth and Firebase apps. No doubt it's a great library, but as a not so pro developer I wasted a lot of time finding examples, solving errors to make Firebase Apps work well with Next.js.
Most terrible issue I faced was caused by accidentally using Admin SDK in my client side. And I literally no idea or traces, why I was getting errors. Then, I doubted that
next-firebase-auth
was causing errors as it had already initialized SDK (I was wrong), so I wasted a lot of time finding an examples how to make work Firebase Apps withnext-firebase-auth
. I didn't find any examples to make them work together with proper structure and setup.Then, I had to find way to implement with Firebase Cloud Messaging, as the official examples didn't provide sufficient way to make it work with their Firestore's example, it did waste my lot of time, and probably others too.
There wasn't a single example to make all Firebase Apps work together. So after a few day, I finally made one by myself! And I hope it would help a lot of you guys, if you are making one of such projects or plan to.
Just grab my template and start working. I have the Auth(Protected pages, login custom element) already setup, Project structure for Firestore (references/functions/client-admin SDKs) already setup, and even Firebase Cloud Messaging (service workers, get-token) setup already! I guess this would save someone's a hell of a lot of time, especially beginners.
Just add you environment variables and you have everything working already!
Check out the demo and here's my template repository - next-firebase-starter.
Enjoy!
Beta Was this translation helpful? Give feedback.
All reactions