diff --git a/.firebase/hosting.ZGlzdA.cache b/.firebase/hosting.ZGlzdA.cache new file mode 100644 index 0000000..73f5753 --- /dev/null +++ b/.firebase/hosting.ZGlzdA.cache @@ -0,0 +1,3 @@ +index.html,1560533560462,fa9408ee2ea0507f332000434f6fb46e19a32119d1f1e02ab7dc25468ef9368e +under-cover.js,1560533560470,bb1e24b7a2a350e3fc658379f8310fc693225f0d226f796a6d08194eb2a0481b +under-cover.js.map,1560533560469,a8ad9bee1c45a5d158042cc5500dd84aba0d7eb2f1acf5d47c37c9b4fd59b15f diff --git a/.firebaserc b/.firebaserc new file mode 100644 index 0000000..3c6653e --- /dev/null +++ b/.firebaserc @@ -0,0 +1,5 @@ +{ + "projects": { + "default": "undercover-1" + } +} diff --git a/.gitignore b/.gitignore index 3c3629e..e1799a6 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ node_modules +firebase-debug.log +dist \ No newline at end of file diff --git a/database.rules.json b/database.rules.json new file mode 100644 index 0000000..c0aa595 --- /dev/null +++ b/database.rules.json @@ -0,0 +1,6 @@ +{ + "rules": { + ".read": "auth != null", + ".write": "auth != null" + } +} \ No newline at end of file diff --git a/firebase.json b/firebase.json new file mode 100644 index 0000000..3b87f8c --- /dev/null +++ b/firebase.json @@ -0,0 +1,26 @@ +{ + "firestore": { + "rules": "firestore.rules", + "indexes": "firestore.indexes.json" + }, + "functions": { + "predeploy": [ + "npm --prefix \"$RESOURCE_DIR\" run lint" + ], + "source": "functions" + }, + "hosting": { + "public": "dist", + "ignore": [ + "firebase.json", + "**/.*", + "**/node_modules/**" + ] + }, + "storage": { + "rules": "storage.rules" + }, + "database": { + "rules": "database.rules.json" + } +} diff --git a/firestore.indexes.json b/firestore.indexes.json new file mode 100644 index 0000000..4ff4fab --- /dev/null +++ b/firestore.indexes.json @@ -0,0 +1,26 @@ +{ + // Example: + // + // "indexes": [ + // { + // "collectionGroup": "widgets", + // "queryScope": "COLLECTION", + // "fields": [ + // { "fieldPath": "foo", "arrayConfig": "CONTAINS" }, + // { "fieldPath": "bar", "mode": "DESCENDING" } + // ] + // }, + // + // "fieldOverrides": [ + // { + // "collectionGroup": "widgets", + // "fieldPath": "baz", + // "indexes": [ + // { "order": "ASCENDING", "queryScope": "COLLECTION" } + // ] + // }, + // ] + // ] + "indexes": [], + "fieldOverrides": [] +} \ No newline at end of file diff --git a/firestore.rules b/firestore.rules new file mode 100644 index 0000000..31eda17 --- /dev/null +++ b/firestore.rules @@ -0,0 +1,7 @@ +service cloud.firestore { + match /databases/{database}/documents { + match /{document=**} { + allow read, write; + } + } +} diff --git a/functions/.eslintrc.json b/functions/.eslintrc.json new file mode 100644 index 0000000..6b6beb6 --- /dev/null +++ b/functions/.eslintrc.json @@ -0,0 +1,123 @@ +{ + "parserOptions": { + // Required for certain syntax usages + "ecmaVersion": 2017 + }, + "plugins": [ + "promise" + ], + "extends": "eslint:recommended", + "rules": { + // Removed rule "disallow the use of console" from recommended eslint rules + "no-console": "off", + + // Removed rule "disallow multiple spaces in regular expressions" from recommended eslint rules + "no-regex-spaces": "off", + + // Removed rule "disallow the use of debugger" from recommended eslint rules + "no-debugger": "off", + + // Removed rule "disallow unused variables" from recommended eslint rules + "no-unused-vars": "off", + + // Removed rule "disallow mixed spaces and tabs for indentation" from recommended eslint rules + "no-mixed-spaces-and-tabs": "off", + + // Removed rule "disallow the use of undeclared variables unless mentioned in /*global */ comments" from recommended eslint rules + "no-undef": "off", + + // Warn against template literal placeholder syntax in regular strings + "no-template-curly-in-string": 1, + + // Warn if return statements do not either always or never specify values + "consistent-return": 1, + + // Warn if no return statements in callbacks of array methods + "array-callback-return": 1, + + // Require the use of === and !== + "eqeqeq": 2, + + // Disallow the use of alert, confirm, and prompt + "no-alert": 2, + + // Disallow the use of arguments.caller or arguments.callee + "no-caller": 2, + + // Disallow null comparisons without type-checking operators + "no-eq-null": 2, + + // Disallow the use of eval() + "no-eval": 2, + + // Warn against extending native types + "no-extend-native": 1, + + // Warn against unnecessary calls to .bind() + "no-extra-bind": 1, + + // Warn against unnecessary labels + "no-extra-label": 1, + + // Disallow leading or trailing decimal points in numeric literals + "no-floating-decimal": 2, + + // Warn against shorthand type conversions + "no-implicit-coercion": 1, + + // Warn against function declarations and expressions inside loop statements + "no-loop-func": 1, + + // Disallow new operators with the Function object + "no-new-func": 2, + + // Warn against new operators with the String, Number, and Boolean objects + "no-new-wrappers": 1, + + // Disallow throwing literals as exceptions + "no-throw-literal": 2, + + // Require using Error objects as Promise rejection reasons + "prefer-promise-reject-errors": 2, + + // Enforce β€œfor” loop update clause moving the counter in the right direction + "for-direction": 2, + + // Enforce return statements in getters + "getter-return": 2, + + // Disallow await inside of loops + "no-await-in-loop": 2, + + // Disallow comparing against -0 + "no-compare-neg-zero": 2, + + // Warn against catch clause parameters from shadowing variables in the outer scope + "no-catch-shadow": 1, + + // Disallow identifiers from shadowing restricted names + "no-shadow-restricted-names": 2, + + // Enforce return statements in callbacks of array methods + "callback-return": 2, + + // Require error handling in callbacks + "handle-callback-err": 2, + + // Warn against string concatenation with __dirname and __filename + "no-path-concat": 1, + + // Prefer using arrow functions for callbacks + "prefer-arrow-callback": 1, + + // Return inside each then() to create readable and reusable Promise chains. + // Forces developers to return console logs and http calls in promises. + "promise/always-return": 2, + + //Enforces the use of catch() on un-returned promises + "promise/catch-or-return": 2, + + // Warn against nested then() or catch() statements + "promise/no-nesting": 1 + } +} diff --git a/functions/.gitignore b/functions/.gitignore new file mode 100644 index 0000000..d1a7480 --- /dev/null +++ b/functions/.gitignore @@ -0,0 +1,2 @@ +node_modules/ +.firebase \ No newline at end of file diff --git a/functions/index.js b/functions/index.js new file mode 100644 index 0000000..bd698a2 --- /dev/null +++ b/functions/index.js @@ -0,0 +1,8 @@ +const functions = require('firebase-functions'); + +// // Create and Deploy Your First Cloud Functions +// // https://firebase.google.com/docs/functions/write-firebase-functions +// +// exports.helloWorld = functions.https.onRequest((request, response) => { +// response.send("Hello from Firebase!"); +// }); diff --git a/functions/package.json b/functions/package.json new file mode 100644 index 0000000..fa96a33 --- /dev/null +++ b/functions/package.json @@ -0,0 +1,25 @@ +{ + "name": "functions", + "description": "Cloud Functions for Firebase", + "scripts": { + "lint": "eslint .", + "serve": "firebase serve --only functions", + "shell": "firebase functions:shell", + "start": "npm run shell", + "deploy": "firebase deploy --only functions", + "logs": "firebase functions:log" + }, + "engines": { + "node": "8" + }, + "dependencies": { + "firebase-admin": "^8.0.0", + "firebase-functions": "^3.0.0" + }, + "devDependencies": { + "eslint": "^5.12.0", + "eslint-plugin-promise": "^4.0.1", + "firebase-functions-test": "^0.1.6" + }, + "private": true +} diff --git a/index.html.firebase b/index.html.firebase new file mode 100644 index 0000000..c1fe368 --- /dev/null +++ b/index.html.firebase @@ -0,0 +1,65 @@ + + + + + + Welcome to Firebase Hosting + + + + + + + + + + + + + + +
+

Welcome

+

Firebase Hosting Setup Complete

+

You're seeing this because you've successfully setup Firebase Hosting. Now it's time to go build something extraordinary!

+ Open Hosting Documentation +
+

Firebase SDK Loading…

+ + + + diff --git a/storage.rules b/storage.rules new file mode 100644 index 0000000..d494542 --- /dev/null +++ b/storage.rules @@ -0,0 +1,7 @@ +service firebase.storage { + match /b/{bucket}/o { + match /{allPaths=**} { + allow read, write: if request.auth!=null; + } + } +}