From b9bedd314a1119efb3b1bf403e284c6507422aae Mon Sep 17 00:00:00 2001 From: Kyle Gill Date: Wed, 15 May 2019 23:08:47 -0600 Subject: [PATCH] fix: updated env vars for Netlify --- .env.sample | 14 +++++++------- README.md | 21 +++++++++++---------- src/components/firebase/fire.js | 12 ++++++------ 3 files changed, 24 insertions(+), 23 deletions(-) diff --git a/.env.sample b/.env.sample index 68e50ae..6b1bff5 100644 --- a/.env.sample +++ b/.env.sample @@ -1,8 +1,8 @@ -REACT_APP_FIREBASE_API_KEY= -REACT_APP_DEV_AUTH_DOMAIN=.firebaseapp.com -REACT_APP_DEV_DATABASE_URL=https://.firebaseio.com -REACT_APP_DEV_PROJECT_ID= -REACT_APP_DEV_STORAGE_BUCKET=.appspot.com -REACT_APP_DEV_MESSAGING_SENDER_ID=############ +GATSBY_FIREBASE_API_KEY= +GATSBY_DEV_AUTH_DOMAIN=.firebaseapp.com +GATSBY_DEV_DATABASE_URL=https://.firebaseio.com +GATSBY_DEV_PROJECT_ID= +GATSBY_DEV_STORAGE_BUCKET=.appspot.com +GATSBY_DEV_MESSAGING_SENDER_ID=############ -REACT_APP_CONFIRMATION_EMAIL_REDIRECT=https://.firebaseapp.com \ No newline at end of file +GATSBY_CONFIRMATION_EMAIL_REDIRECT=https://.firebaseapp.com \ No newline at end of file diff --git a/README.md b/README.md index 2fb3c54..2af9a89 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Personal Journaling Platform -Sol Journal is a simple, minimal, journaling platform that works offline and across all devices. It can be self-hosted through Firebase and then installed as a PWA, on mobile devices for easy access on a phone, or on Desktops. +Sol Journal is a simple, minimal, journaling platform that works offline and across all devices. It can be self-hosted through Firebase and then installed as a PWA, on mobile devices for easy access on a phone, or on Desktops.

preview of page @@ -35,7 +35,7 @@ In the spirit of minimalism, key features are what are in place for a quick, lig - 🔍 Search: full-text search of a user's entries stored in Firestore for quick access to past entries - 🖥 Mobile Friendly: designed to look great on mobile as well as desktop, with easy navigation on both - 💡 PWA: being a progressive web app makes it installable from Chrome/Safari on desktop, or be added to the homescreen on iOS/Android -- 🔌 Offline Support: read/write when you're offline and let the updates happen when your connection is restored +- 🔌 Offline Support: read/write when you're offline and let the updates happen when your connection is restored - 🗄 Export: backup all of your entries at any time to save your data ## Developing @@ -59,15 +59,16 @@ yarn ``` Then configure a file in a new `.env` file (using the `.env.sample` file as a reference) with the following keys from the firebase console: -```env -REACT_APP_FIREBASE_API_KEY= -REACT_APP_DEV_AUTH_DOMAIN=.firebaseapp.com -REACT_APP_DEV_DATABASE_URL=https://.firebaseio.com -REACT_APP_DEV_PROJECT_ID= -REACT_APP_DEV_STORAGE_BUCKET=.appspot.com -REACT_APP_DEV_MESSAGING_SENDER_ID=############ -REACT_APP_CONFIRMATION_EMAIL_REDIRECT=https://.firebaseapp.com +```env +GATSBY_FIREBASE_API_KEY= +GATSBY_DEV_AUTH_DOMAIN=.firebaseapp.com +GATSBY_DEV_DATABASE_URL=https://.firebaseio.com +GATSBY_DEV_PROJECT_ID= +GATSBY_DEV_STORAGE_BUCKET=.appspot.com +GATSBY_DEV_MESSAGING_SENDER_ID=############ + +GATSBY_CONFIRMATION_EMAIL_REDIRECT=https://.firebaseapp.com ``` Navigate into the project directory, and then launch the site with this command: diff --git a/src/components/firebase/fire.js b/src/components/firebase/fire.js index 1a588e9..194bc6e 100644 --- a/src/components/firebase/fire.js +++ b/src/components/firebase/fire.js @@ -3,12 +3,12 @@ import "firebase/auth" import "firebase/firestore" const config = { - apiKey: process.env.REACT_APP_FIREBASE_API_KEY, - authDomain: process.env.REACT_APP_DEV_AUTH_DOMAIN, - databaseURL: process.env.REACT_APP_DEV_DATABASE_URL, - projectId: process.env.REACT_APP_DEV_PROJECT_ID, - storageBucket: process.env.REACT_APP_DEV_STORAGE_BUCKET, - messagingSenderId: process.env.REACT_APP_DEV_MESSAGING_SENDER_ID, + apiKey: process.env.GATSBY_FIREBASE_API_KEY, + authDomain: process.env.GATSBY_DEV_AUTH_DOMAIN, + databaseURL: process.env.GATSBY_DEV_DATABASE_URL, + projectId: process.env.GATSBY_DEV_PROJECT_ID, + storageBucket: process.env.GATSBY_DEV_STORAGE_BUCKET, + messagingSenderId: process.env.GATSBY_DEV_MESSAGING_SENDER_ID, } class Firebase {