marcomelilli / gatsby-firebase-simple-auth Goto Github PK
View Code? Open in Web Editor NEWGatsby Starter with Firebase simple auth workflow and private routes
Home Page: https://gatsby-firebase-simple-auth.netlify.com/
License: MIT License
Gatsby Starter with Firebase simple auth workflow and private routes
Home Page: https://gatsby-firebase-simple-auth.netlify.com/
License: MIT License
If you're trying to use a package make sure that 'gatsby-react-router-scroll' is installed. If you're trying
to use a local file make sure that the path is correct.
File: .cache\gatsby-browser-entry.js
Using the single .env
file can save time, the only thing is adding either _DEV
or _PRODUCTION
suffix. This way, developers who use and fork your starter can use only one .env
file, they just needed to add some flags or suffixes to know which secrets should be used based on the type of deployment.
## Production-ready secrets
GATSBY_FIREBASE_API_KEY_PRODUCTION=<YOUR_FIREBASE_API_KEY>
GATSBY_FIREBASE_AUTH_DOMAIN_PRODUCTION=<YOUR_FIREBASE_AUTH_DOMAIN>
GATSBY_FIREBASE_DATABASE_URL_PRODUCTION=<YOUR_FIREBASE_DATABASE_URL>
GATSBY_FIREBASE_PROJECT_ID_PRODUCTION=<YOUR_FIREBASE_PROJECT_ID>
GATSBY_FIREBASE_STORAGE_BUCKET_PRODUCTION=<YOUR_FIREBASE_STORAGE_BUCKET>
GATSBY_FIREBASE_MESSAGING_SENDER_ID_PRODUCTION=<YOUR_FIREBASE_MESSAGING_SENDER_ID>
GATSBY_FIREBASE_APP_ID_PRODUCTION=<YOUR_FIREBASE_APP_ID>
GATSBY_FIREBASE_MEASUREMENT_ID_PRODUCTION=<YOUR_FIREBASE_ANALYTICS_TRACKING_ID>
## Development secrets
GATSBY_FIREBASE_API_KEY_DEV=<YOUR_FIREBASE_API_KEY>
GATSBY_FIREBASE_AUTH_DOMAIN_DEV=<YOUR_FIREBASE_AUTH_DOMAIN>
GATSBY_FIREBASE_DATABASE_URL_DEV=<YOUR_FIREBASE_DATABASE_URL>
GATSBY_FIREBASE_PROJECT_ID_DEV=<YOUR_FIREBASE_PROJECT_ID>
GATSBY_FIREBASE_STORAGE_BUCKET_DEV=<YOUR_FIREBASE_STORAGE_BUCKET>
GATSBY_FIREBASE_MESSAGING_SENDER_ID_DEV=<YOUR_FIREBASE_MESSAGING_SENDER_ID>
GATSBY_FIREBASE_APP_ID_DEV=<YOUR_FIREBASE_APP_ID>
GATSBY_FIREBASE_MEASUREMENT_ID_DEV=<YOUR_FIREBASE_ANALYTICS_TRACKING_ID>
## Flag to use dev secrets instead: Set to true to continue
USE_DEV_SECRETS_ON_PROD=true
## Flag to use prod secrets on dev servers: Set true to continue.
## When both of these flags are enabled, they'll be used based on what deployment type does an dev used.
USE_PROD_SECRETS_ON_DEV=true
The route will stay at https://gatsby-firebase-simple-auth.netlify.app/app/login.
Great starter. It does exactly one thing and it works.
I had minor problems getting started because I had barely any firebase experience. I propose the following changes to enable a smooth dev experience:
.env.sample
with sample environment variablesGetting firebase up and running
into the README
These links helped me and should be added to the README:
Should I go ahead and make a pull request?
Hi Marco.
your gatsby starter looks really useful and works just fine, however I'm using it to learn how authentication works with firebase and gatsby. I'm trying to update the use of gatsby-plugin-firebase to the v0.2 (using useEffect instead of useFirebase in the login component) but the browser returns this error in .../app/login:
TypeError: gatsby_plugin_firebase__WEBPACK_IMPORTED_MODULE_5__.default.database is not a function
It seems like I need to create a react context to use firebase functions, but I don't really understand how it would work in your starter.
I hope you can help me, maybe this plugin update usage could be a nice upgrade to your starter.
Thanks!
--
note: I'm a designer learning how to code so I apologize if this is not the kind of issue you were expecting.
Would be reassuring to see this working, because I tried adding Apple to @epilande's theme in this file but it turned out that firebase.auth.AppleAuthProvider()
doesn't exist.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.