Skip to content

Commit

Permalink
corrected api key
Browse files Browse the repository at this point in the history
  • Loading branch information
vaibhavtomar04 committed Jul 3, 2024
1 parent 86bd527 commit 822014a
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 16 deletions.
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,20 @@ dist-ssr
*.njsproj
*.sln
*.sw?

# Misc
*.DS_Store
*.env
*.md
*.lock
*.json
*.yml
*.yaml
*.tgz
*.swp
*.zip
*.gz
*.tar
*.rar
*.bak
*.log
26 changes: 17 additions & 9 deletions firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,22 @@
"source": "**",
"destination": "/index.html"
}
],
"environment": {
"REACT_APP_FIREBASE_API_KEY": "your_api_key",
"REACT_APP_FIREBASE_AUTH_DOMAIN": "your_auth_domain",
"REACT_APP_FIREBASE_PROJECT_ID": "your_project_id",
"REACT_APP_FIREBASE_STORAGE_BUCKET": "your_storage_bucket",
"REACT_APP_FIREBASE_MESSAGING_SENDER_ID": "your_messaging_sender_id",
"REACT_APP_FIREBASE_APP_ID": "your_app_id"
]
},
"functions": [
{
"source": "functions",
"codebase": "default",
"ignore": [
"node_modules",
".git",
"firebase-debug.log",
"firebase-debug.*.log",
"*.local"
],
"predeploy": [
"npm --prefix \"$RESOURCE_DIR\" run lint"
]
}
}
]
}
28 changes: 28 additions & 0 deletions functions/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
module.exports = {
env: {
es6: true,
node: true,
},
parserOptions: {
"ecmaVersion": 2018,
},
extends: [
"eslint:recommended",
"google",
],
rules: {
"no-restricted-globals": ["error", "name", "length"],
"prefer-arrow-callback": "error",
"quotes": ["error", "double", {"allowTemplateLiterals": true}],
},
overrides: [
{
files: ["**/*.spec.*"],
env: {
mocha: true,
},
rules: {},
},
],
globals: {},
};
2 changes: 2 additions & 0 deletions functions/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
*.local
19 changes: 19 additions & 0 deletions functions/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* Import function triggers from their respective submodules:
*
* const {onCall} = require("firebase-functions/v2/https");
* const {onDocumentWritten} = require("firebase-functions/v2/firestore");
*
* See a full list of supported triggers at https://firebase.google.com/docs/functions
*/

const {onRequest} = require("firebase-functions/v2/https");
const logger = require("firebase-functions/logger");

// Create and deploy your first functions
// https://firebase.google.com/docs/functions/get-started

// exports.helloWorld = onRequest((request, response) => {
// logger.info("Hello logs!", {structuredData: true});
// response.send("Hello from Firebase!");
// });
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"deploy": "gh-pages -d build",
"build": "vite build",
"lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
"preview": "vite preview",
"start:prod": "serve -s dist"
},
"dependencies": {
"emoji-picker-react": "^4.9.2",
Expand Down
12 changes: 6 additions & 6 deletions src/lib/firebase.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import { getFirestore } from "firebase/firestore";
import { getStorage } from "firebase/storage";

const firebaseConfig = {
apiKey: process.env.REACT_APP_FIREBASE_API_KEY,
authDomain: process.env.REACT_APP_FIREBASE_AUTH_DOMAIN,
projectId: process.env.REACT_APP_FIREBASE_PROJECT_ID,
storageBucket: process.env.REACT_APP_FIREBASE_STORAGE_BUCKET,
messagingSenderId: process.env.REACT_APP_FIREBASE_MESSAGING_SENDER_ID,
appId: process.env.REACT_APP_FIREBASE_APP_ID
apiKey: import.meta.env.VITE_FIREBASE_API_KEY,
authDomain: import.meta.env.VITE_FIREBASE_AUTH_DOMAIN,
projectId: import.meta.env.VITE_FIREBASE_PROJECT_ID,
storageBucket: import.meta.env.VITE_FIREBASE_STORAGE_BUCKET,
messagingSenderId: import.meta.env.VITE_FIREBASE_MESSAGING_SENDER_ID,
appId: import.meta.env.VITE_FIREBASE_APP_ID,
};

export const app = initializeApp(firebaseConfig);
Expand Down

0 comments on commit 822014a

Please sign in to comment.