diff --git a/README.md b/README.md index 35271eb..423c360 100644 --- a/README.md +++ b/README.md @@ -32,11 +32,13 @@ By completing the Vue.js Master Class, you will be able to land any Vue related Convinced? [Enroll now](https://vueschool.io/the-vuejs-master-class) - ## Build Setup ``` bash # install dependencies +npm install + +# if you've installed yarn instead yarn # serve with hot reload at localhost:8080 @@ -50,3 +52,26 @@ npm run build --report ``` For a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader). + +## Firebase +Later master classes shou how to move past read-only, to your own writeable +database. + +- Create a free account at https://firebase.google.com/ +- Install firebase-cli + - Mac Homebrew: `brew install firebase-cli` + - (ToDo: community support for other OSes) +- `npm install -g firebase-tools` # optional +- Log into your Firebase account +- Create a Firebase project, as needed +- Grab the project configuration + - Click the project, to open its dashboard + - Click the ( ) properties icon +- Edit .env with your settings (in project root folder) +- Edit .firebaserc + +`firebase login` +`npm run db:seed` + +Follow steps in *Build Setup* to run / build +Your empty page awaits! diff --git a/build/setup.js b/build/setup.js new file mode 100644 index 0000000..1a46fae --- /dev/null +++ b/build/setup.js @@ -0,0 +1,6 @@ +"use strict"; + +const fs = require('fs'); +if (! fs.existsSync('.env')) { + fs.createReadStream('.env.example').pipe(fs.createWriteStream('.env')); +} diff --git a/database.rules.json b/database.rules.json index d2b8268..4ff5dd4 100644 --- a/database.rules.json +++ b/database.rules.json @@ -1,6 +1,9 @@ { "rules": { ".read": true, - ".write": true + ".write": true, + "users": { + ".indexOn": ["usernameLower", "email"] + } } } diff --git a/package.json b/package.json index 84d7d31..185f3c3 100644 --- a/package.json +++ b/package.json @@ -8,13 +8,16 @@ "dev": "node build/dev-server.js", "start": "npm run dev", "build": "node build/build.js", + "postinstall": "node build/setup.js", "lint": "eslint --ext .js,.vue src", "db:seed": "firebase database:set / src/data.json -y" }, "dependencies": { + "@firebase/app": "^0.3.4", "dotenv": "^5.0.1", - "firebase": "^4.12.1", + "firebase": "^5.5.8", "moment": "^2.19.3", + "node-gyp": "^3.8.0", "nprogress": "^0.2.0", "vue": "^2.5.2", "vue-router": "^3.0.1", @@ -55,9 +58,9 @@ "ora": "^1.2.0", "portfinder": "^1.0.13", "rimraf": "^2.6.0", - "semver": "^5.3.0", + "semver": "^5.6.0", "shelljs": "^0.7.6", - "url-loader": "^0.5.8", + "url-loader": "^1.1.2", "vue-loader": "^13.3.0", "vue-style-loader": "^3.0.1", "vue-template-compiler": "^2.5.2",