I'm currently building my beta SPA app and trying to incorporate authentication.
My stack is React, MySql, Node, Express.
What does everyone recommend? I think @csallen uses Firebase for Indiehackers.com, but I'm worried that Firebase won't scale well.
Any practical recommendations would be super helpful.
I'm a seasoned dev who's usually always built custom auth systems, but for my latest project, I started using Firebase Auth, and I have to say, it's amazing for a lot of reasons.
For one thing, I was able to integrate it into my own system in about 2 hours (and only because it was my first time). And it takes care of so much hassle for you, including password reset emails and account linking. You can also have unlimited users, which is pretty amazing considering it's free.
I'm also curious about why you think firebase won't scale well? Especially considering IH uses it and it's a pretty traffic-heavy site and it seems to do wonderfully with it.
Is it easy to integrate with an existing backend API? The marketing pages sells it really well as a tool to use in client apps.
It is quite easy. Once you've authenticated the user on the front-end, you can retrieve that user's token, which you can send to your back-end. You can then use the firebase npm package or your own JWT decoder to verify the token and retrieve the user. More details here: https://firebase.google.com/docs/auth/admin/verify-id-tokens
Depends how complicated the API is, the approach I usually use is to setup firebase authentication on the front end and then once the user is authenticated and makes a request to the API I send a json web token that I get from firebase in the headers of that request and then authenticate with that token on the backend
Hi,
I am a full-stack dev and have worked on ROR, React, ReactNative, Express, etc. While I usually choose a relational DB like MySQL and in some cases Mongo, for my recent hobby project I chose Firebase as my backend. Here are my findings.
The auth system is very good. You can easily implement it on React. However, sign in with popup and redirects don't work on ReactNative.
Overall, the documentation is very good and I was able to set it up in a fairly small amount of time.
You could leave your entire auth system to Firebase and use MySQL, Express stack as your backend. UUIDs come very handy to handle data ownereships. Use accessTokens to maintain sessions.
Firebase auth does not have any scaling issue. You should start worrying about scaling only if you are using Firebase Real Time Database or Firebase Cloud Firestore.
Thanks Shouvik! I'm pretty much heading in the direction of #2. I'm currently working on the database and once I get all that ironed out and I'll tackle auth. I sincerely appreciate the advice.
That's awesome. Please, feel free to ping me if you want to brainstorm over the implementation.
Sweetness. I'll definitely take you up on the offer! As soon as I'm at a good place, I'll reach out!
Cool. ~ Cheers!
Vendor lockin is the only thing that worries me about firebase. Google keeps shutting down services.
I think worrying about something that won't necessarily scale early is counterproductive. Worrying about a hypothetical situation doesn't do anything for you to get customers. Firebase is good enough to get you started. If you actually have a problem with scale with Firebase, you can pay for more scale. By then, having a scaling problem will be a good sign that you're growing :).
i'm using firebase in my side projects. gets me off the ground faster. I'm a frontend dev, so rolling my own auth with passportjs or the like would be burdensome. plus i can prototype my whole app on firebase faster than building out my own api.
do things that dont scale. if firebase doesn't "scale well" thats a good problem to have. if you hit that ceiling, chances are you can afford to pay someone to build out a proper api. good luck!
What about firebase do you think won't scale? in my experience firebase scales just fine if you design the structure correctly
I've used Auth0 in the past and it's alright, if this is a super simple project what's stopping you rolling your own custom authentication that authenticates by using JWT's?
I have no basis for my worry regarding Firebase scaling honestly. Probably more worried about my own implementation that it works correctly. My goal is to have something similar to IH in terms of user base, but I won't be building my own forum. I want something that can be used for SSO to plan for the future.
The thing that's stopping me from rolling my own custom Auth is simply my skill level at this moment. I'm good at following templates/tutorials, but launching my own custom thing is a little daunting.
Alright, don't worry about it then your firebase will scale auth wise, you just need to worry about your database design, read this post on denormalising your firebase data to get the most out of firebase - https://firebase.googleblog.com/2013/04/denormalizing-your-data-is-normal.html
If you feel your skill level isn't up to scratch then maybe using something like firebase auth is the best, You should make sure you take your time and fully understand how it works though as auth is something you don't wanna skimp on, I've set up firebase authentication countless times and can give you some advice on implementing it so that it is secure, let me know if you want to chat
Thanks for the offer and I'll take you up on the offer if I end up using Firebase. I'm in the trenches with the database design right now so hopefully I can move on to auth here in the next couple of weeks, if not sooner. I appreciate the offer!
No problemo, could be an idea to let me double check your database structure too but that's completely up to yourself :)
I appreciate the offer. Let me a get a little further along and I'll reach out.
Thanks man!