Dude, Sam, I read your article on that exact same implementation too! Great stuff, as a newer developer it’s articles like yours that help me level up.
To answer your question, your examples do make sense. As for the why am I doing this? Well, I love Gatsby and really wanna do something crazy. I fell like most people are quick to dismiss it being a static site generator and all. I’ve built a quite a few sites with Contentful CMS as the read only data source, and even made client side calls to various APIs, so I figured if it can do that, why can’t I just use Gatsby instead of React in a MERN app?
I’m really just trying to challenge myself, and find the boundaries in Gatsby. For more context I want to use the “GraphQL Gatsby way” to pre-load as much data as I can (in this case from an external API on video game data, and the associate user data from my database). Then once the hydrate life cycle method is activated, a user can then leverage the dynamic capabilities to perform CRUD operations with respect to an express/node server (which I’ll eventually refactor into a GraphQL server). I really wanted to throw Auth0 in there cause, seriously, I think this is the coolest implementation of auth I’ve ever seen, and I want to get better with the Auth0 service.
If you still suggest against my endeavor, I will heed your advice, however it does leave me with a couple more questions:
- What is the point of the Gatsby-Auth0 implementation to begin with - is it strictly a read-only thing, or to prevent functionality?
- How would you use the client side protected routes from your article and Jason’s video in a real world scenario?
- Would Next.JS be a better fit for this project?
Apologies in advance for the long post. I greatly appreciate you taking the time - It really helps me out getting insight from a pro!
Cheers,
Sal