├── .gitignore ├── .DS_Store ├── .firebaserc ├── src ├── static │ ├── favicon.ico │ └── README.md ├── .gitignore ├── components │ ├── README.md │ └── Logo.vue ├── .editorconfig ├── layouts │ ├── README.md │ └── default.vue ├── .eslintrc.js ├── pages │ ├── README.md │ └── index.vue ├── assets │ └── README.md ├── plugins │ └── README.md ├── middleware │ └── README.md ├── store │ └── README.md ├── README.md ├── package.json └── nuxt.config.js ├── firebase.json └── functions ├── package.json └── index.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | public 3 | functions/nuxt 4 | -------------------------------------------------------------------------------- /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davideast/nuxt-firebase/HEAD/.DS_Store -------------------------------------------------------------------------------- /.firebaserc: -------------------------------------------------------------------------------- 1 | { 2 | "projects": { 3 | "default": "nuxt-ssr" 4 | } 5 | } -------------------------------------------------------------------------------- /src/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davideast/nuxt-firebase/HEAD/src/static/favicon.ico -------------------------------------------------------------------------------- /src/.gitignore: -------------------------------------------------------------------------------- 1 | # dependencies 2 | node_modules 3 | 4 | # logs 5 | npm-debug.log 6 | 7 | # Nuxt build 8 | .nuxt 9 | 10 | # Nuxt generate 11 | dist 12 | -------------------------------------------------------------------------------- /src/components/README.md: -------------------------------------------------------------------------------- 1 | # COMPONENTS 2 | 3 | The components directory contains your Vue.js Components. 4 | Nuxt.js doesn't supercharge these components. 5 | 6 | **This directory is not required, you can delete it if you don't want to use it.** 7 | -------------------------------------------------------------------------------- /src/.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_size = 2 6 | indent_style = space 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [*.md] 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /src/layouts/README.md: -------------------------------------------------------------------------------- 1 | # LAYOUTS 2 | 3 | This directory contains your Application Layouts. 4 | 5 | More information about the usage of this directory in the documentation: 6 | https://nuxtjs.org/guide/views#layouts 7 | 8 | **This directory is not required, you can delete it if you don't want to use it.** 9 | -------------------------------------------------------------------------------- /firebase.json: -------------------------------------------------------------------------------- 1 | { 2 | "hosting": { 3 | "public": "public", 4 | "ignore": [ 5 | "firebase.json", 6 | "**/.*", 7 | "**/node_modules/**" 8 | ], 9 | "rewrites": [ 10 | { 11 | "source": "**", 12 | "function": "ssrapp" 13 | } 14 | ] 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | parser: 'babel-eslint', 4 | env: { 5 | browser: true, 6 | node: true 7 | }, 8 | // required to lint *.vue files 9 | plugins: [ 10 | 'html' 11 | ], 12 | // add your custom rules here 13 | rules: {}, 14 | globals: {} 15 | } 16 | -------------------------------------------------------------------------------- /src/pages/README.md: -------------------------------------------------------------------------------- 1 | # PAGES 2 | 3 | This directory contains your Application Views and Routes. 4 | The framework reads all the .vue files inside this directory and create the router of your application. 5 | 6 | More information about the usage of this directory in the documentation: 7 | https://nuxtjs.org/guide/routing 8 | -------------------------------------------------------------------------------- /src/assets/README.md: -------------------------------------------------------------------------------- 1 | # ASSETS 2 | 3 | This directory contains your un-compiled assets such as LESS, SASS, or JavaScript. 4 | 5 | More information about the usage of this directory in the documentation: 6 | https://nuxtjs.org/guide/assets#webpacked 7 | 8 | **This directory is not required, you can delete it if you don't want to use it.** 9 | -------------------------------------------------------------------------------- /src/plugins/README.md: -------------------------------------------------------------------------------- 1 | # PLUGINS 2 | 3 | This directory contains your Javascript plugins that you want to run before instantiating the root vue.js application. 4 | 5 | More information about the usage of this directory in the documentation: 6 | https://nuxtjs.org/guide/plugins 7 | 8 | **This directory is not required, you can delete it if you don't want to use it.** 9 | -------------------------------------------------------------------------------- /src/static/README.md: -------------------------------------------------------------------------------- 1 | # STATIC 2 | 3 | This directory contains your static files. 4 | Each file inside this directory is mapped to /. 5 | 6 | Example: /static/robots.txt is mapped as /robots.txt. 7 | 8 | More information about the usage of this directory in the documentation: 9 | https://nuxtjs.org/guide/assets#static 10 | 11 | **This directory is not required, you can delete it if you don't want to use it.** 12 | -------------------------------------------------------------------------------- /src/middleware/README.md: -------------------------------------------------------------------------------- 1 | # MIDDLEWARE 2 | 3 | This directory contains your Application Middleware. 4 | The middleware lets you define custom function to be ran before rendering a page or a group of pages (layouts). 5 | 6 | More information about the usage of this directory in the documentation: 7 | https://nuxtjs.org/guide/routing#middleware 8 | 9 | **This directory is not required, you can delete it if you don't want to use it.** 10 | -------------------------------------------------------------------------------- /src/store/README.md: -------------------------------------------------------------------------------- 1 | # STORE 2 | 3 | This directory contains your Vuex Store files. 4 | Vuex Store option is implemented in the Nuxt.js framework. 5 | Creating a index.js file in this directory activate the option in the framework automatically. 6 | 7 | More information about the usage of this directory in the documentation: 8 | https://nuxtjs.org/guide/vuex-store 9 | 10 | **This directory is not required, you can delete it if you don't want to use it.** 11 | -------------------------------------------------------------------------------- /src/README.md: -------------------------------------------------------------------------------- 1 | # first 2 | 3 | > Nuxt.js project 4 | 5 | ## Build Setup 6 | 7 | ``` bash 8 | # install dependencies 9 | $ npm install # Or yarn install 10 | 11 | # serve with hot reload at localhost:3000 12 | $ npm run dev 13 | 14 | # build for production and launch server 15 | $ npm run build 16 | $ npm start 17 | 18 | # generate static project 19 | $ npm run generate 20 | ``` 21 | 22 | For detailed explanation on how things work, checkout the [Nuxt.js docs](https://github.com/nuxt/nuxt.js). 23 | -------------------------------------------------------------------------------- /functions/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "functions", 3 | "description": "Cloud Functions for Firebase", 4 | "dependencies": { 5 | "babel-plugin-transform-runtime": "^6.23.0", 6 | "babel-preset-stage-0": "^6.24.1", 7 | "babel-runtime": "^6.23.0", 8 | "clone": "^2.1.1", 9 | "debug": "^3.1.0", 10 | "es6-promise": "^4.1.1", 11 | "express": "^4.15.4", 12 | "firebase-admin": "^5.0.1", 13 | "firebase-functions": "^0.6.1", 14 | "isomorphic-fetch": "^2.2.1", 15 | "lodash": "^4.17.4", 16 | "nuxt": "1.0.0-rc11", 17 | "vue": "~2.4.2", 18 | "vue-meta": "^1.2.0", 19 | "vue-router": "^3.0.1", 20 | "vuex": "^3.0.0" 21 | }, 22 | "private": true 23 | } 24 | -------------------------------------------------------------------------------- /functions/index.js: -------------------------------------------------------------------------------- 1 | const functions = require('firebase-functions'); 2 | const { Nuxt } = require('nuxt') 3 | const express = require('express'); 4 | 5 | const app = express(); 6 | 7 | const config = { 8 | dev: false, 9 | buildDir: 'nuxt', 10 | build: { 11 | publicPath: '/public/' 12 | } 13 | }; 14 | const nuxt = new Nuxt(config); 15 | 16 | function handleRequest(req, res) { 17 | res.set('Cache-Control', 'public, max-age=150, s-maxage=300'); 18 | nuxt.renderRoute('/').then(result => { 19 | console.log(result.html); 20 | res.send(result.html); 21 | }).catch(e => { console.log(e); res.send(e); }); 22 | } 23 | 24 | app.get('**', handleRequest); 25 | 26 | exports.ssrapp = functions.https.onRequest(app); 27 | -------------------------------------------------------------------------------- /src/pages/index.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 20 | 21 | 48 | -------------------------------------------------------------------------------- /src/layouts/default.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 53 | -------------------------------------------------------------------------------- /src/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "first", 3 | "version": "1.0.0", 4 | "description": "Nuxt.js project", 5 | "author": "David East ", 6 | "private": true, 7 | "scripts": { 8 | "dev": "nuxt", 9 | "build": "nuxt build", 10 | "start": "nuxt start", 11 | "fix": "nuxt --fix", 12 | "generate": "nuxt generate", 13 | "lint": "eslint --ext .js,.vue --ignore-path .gitignore .", 14 | "precommit": "npm run lint" 15 | }, 16 | "dependencies": { 17 | "@firebase/app": "^0.1.1", 18 | "@firebase/database": "^0.1.1", 19 | "babel-plugin-module-resolver": "^2.7.1", 20 | "babel-plugin-transform-runtime": "^6.23.0", 21 | "babel-preset-es2015": "^6.24.1", 22 | "babel-preset-stage-0": "^6.24.1", 23 | "isomorphic-fetch": "^2.2.1", 24 | "nuxt": "^1.0.0-rc11" 25 | }, 26 | "devDependencies": { 27 | "babel-eslint": "^7.2.3", 28 | "babel-plugin-transform-runtime": "^6.23.0", 29 | "eslint": "^4.3.0", 30 | "eslint-config-standard": "^10.2.1", 31 | "eslint-loader": "^1.9.0", 32 | "eslint-plugin-html": "^3.1.1", 33 | "eslint-plugin-import": "^2.7.0", 34 | "eslint-plugin-node": "^5.1.1", 35 | "eslint-plugin-promise": "^3.5.0", 36 | "eslint-plugin-standard": "^3.0.1" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/nuxt.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | /* 3 | ** Headers of the page 4 | */ 5 | head: { 6 | title: 'first', 7 | meta: [ 8 | { charset: 'utf-8' }, 9 | { name: 'viewport', content: 'width=device-width, initial-scale=1' }, 10 | { hid: 'description', name: 'description', content: 'Nuxt.js project' } 11 | ], 12 | link: [ 13 | { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' } 14 | ] 15 | }, 16 | /* 17 | ** Customize the progress bar color 18 | */ 19 | loading: { color: '#3B8070' }, 20 | /* 21 | ** Build configuration 22 | */ 23 | buildDir: '../functions/nuxt', 24 | build: { 25 | publicPath: '/public/', 26 | vendor: ['isomorphic-fetch'], 27 | extractCSS: true, 28 | babel: { 29 | presets: [ 30 | 'es2015', 31 | 'stage-0' 32 | ], 33 | plugins: [ 34 | ["transform-runtime", { 35 | "polyfill": true, 36 | "regenerator": true 37 | }], 38 | ] 39 | }, 40 | /* 41 | ** Run ESLint on save 42 | */ 43 | extend (config, ctx) { 44 | if (ctx.dev && ctx.isClient) { 45 | config.module.rules.push({ 46 | enforce: 'pre', 47 | test: /\.(js|vue)$/, 48 | loader: 'eslint-loader', 49 | exclude: /(node_modules)/ 50 | }) 51 | } 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/components/Logo.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 80 | --------------------------------------------------------------------------------