diff --git a/.eslintignore b/.eslintignore index 0764943..7fd7758 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,2 +1,3 @@ build/*.js -config/*.js \ No newline at end of file +config/*.js +* \ No newline at end of file diff --git a/.gitignore b/.gitignore index be86a2b..fcddb7c 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,4 @@ dist/ npm-debug.log selenium-debug.log test/unit/coverage -test/e2e/reports +test/e2e/reports \ No newline at end of file diff --git a/README.md b/README.md index 032955c..b6e02a4 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,26 @@ -# incentify +# Incentify > Motivation app through financial consequences +By tracking metric based achievement sites (Fitbit/Duolingo), we can interface with their API and let users set a goal (5 miles per week) and a financial incentive ($10). If they fail to meet that weekly goal, they get charged through the Stripe API. + +## Technologies used +**NERV Stack** +Back End: Node/Express +Database: RethinkDB +Front End: Vue.js + +**APIs** +Stripe +Team Treehouse + +**CSS** +Bulma.io +Animate.css + ## Build Setup -``` bash +``` # install dependencies npm install @@ -13,15 +29,4 @@ npm run dev # build for production with minification npm run build - -# run unit tests -npm run unit - -# run e2e tests -npm run e2e - -# run all tests -npm test ``` - -For detailed explanation on how things work, checkout the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader). diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js index 78552fd..60f58cd 100644 --- a/build/webpack.base.conf.js +++ b/build/webpack.base.conf.js @@ -5,7 +5,7 @@ var projectRoot = path.resolve(__dirname, '../') module.exports = { entry: { - app: './src/main.js' + app: ['./src/main.js'] }, output: { path: config.build.assetsRoot, diff --git a/config/dev.env.js b/config/dev.env.js index efead7c..a499fad 100644 --- a/config/dev.env.js +++ b/config/dev.env.js @@ -2,5 +2,7 @@ var merge = require('webpack-merge') var prodEnv = require('./prod.env') module.exports = merge(prodEnv, { - NODE_ENV: '"development"' + DEBUG_MODE: true, + NODE_ENV: '"development"', + API_URL: '"http://localhost:3000"' }) diff --git a/config/index.js b/config/index.js index 1f608ad..83a084b 100644 --- a/config/index.js +++ b/config/index.js @@ -7,7 +7,8 @@ module.exports = { index: path.resolve(__dirname, '../dist/index.html'), assetsRoot: path.resolve(__dirname, '../dist'), assetsSubDirectory: 'static', - assetsPublicPath: '/', + // remove the dot below if you want it for webroot vs cordova + assetsPublicPath: './', productionSourceMap: true, // Gzip off by default as many popular static hosts such as // Surge or Netlify already gzip all static assets for you. diff --git a/config/prod.env.js b/config/prod.env.js index 773d263..6576b0b 100644 --- a/config/prod.env.js +++ b/config/prod.env.js @@ -1,3 +1,5 @@ module.exports = { - NODE_ENV: '"production"' + DEBUG_MODE: false, + NODE_ENV: '"production"', + API_URL: '"https://incentifyapi.herokuapp.com"' } diff --git a/index.html b/index.html index fa76497..b893a87 100644 --- a/index.html +++ b/index.html @@ -3,9 +3,11 @@ Incentify + + - + \ No newline at end of file diff --git a/package.json b/package.json index cf84ec2..125bb50 100644 --- a/package.json +++ b/package.json @@ -11,8 +11,14 @@ "lint": "eslint --ext .js,.vue src test/unit/specs test/e2e/specs" }, "dependencies": { + "animate.css": "^3.5.2", + "babel-runtime": "^6.0.0", + "font-awesome": "^4.6.3", + "lodash": "^4.16.4", + "stripe": "^4.12.0", + "sweetalert": "^1.1.3", "vue": "^1.0.21", - "babel-runtime": "^6.0.0" + "vue-sweetalert": "^0.1.15" }, "devDependencies": { "babel-core": "^6.0.0", @@ -34,24 +40,27 @@ "eventsource-polyfill": "^0.9.6", "express": "^4.13.3", "extract-text-webpack-plugin": "^1.0.1", + "fastclick": "^1.0.6", "file-loader": "^0.8.4", - "font-awesome": "^4.6.3", "function-bind": "^1.0.2", "html-webpack-plugin": "^2.8.1", "http-proxy-middleware": "^0.12.0", "json-loader": "^0.5.4", + "less-loader": "^2.2.3", "node-sass": "^3.10.1", "ora": "^0.2.0", "sass-loader": "^4.0.2", "shelljs": "^0.6.0", - "spectre.css": "^0.1.26", "style-loader": "^0.13.1", "url-loader": "^0.5.7", "vue-hot-reload-api": "^1.2.0", "vue-html-loader": "^1.0.0", "vue-loader": "^8.3.0", + "vue-moment": "^2.0.2", + "vue-resource": "^1.0.3", "vue-router": "^0.7.13", "vue-style-loader": "^1.0.0", + "vue-touch": "^1.1.0", "webpack": "^1.12.2", "webpack-dev-middleware": "^1.4.0", "webpack-hot-middleware": "^2.6.0", diff --git a/rethinkdb_data/log_file b/rethinkdb_data/log_file deleted file mode 100644 index 416f246..0000000 --- a/rethinkdb_data/log_file +++ /dev/null @@ -1,14 +0,0 @@ -2016-09-27T10:47:45.341989000 0.335478s notice: Recursively removing directory /Users/jasonland/Sites/Incentify1/rethinkdb_data/tmp -2016-09-27T10:47:45.343248000 0.336740s notice: Initializing directory /Users/jasonland/Sites/Incentify1/rethinkdb_data -2016-09-27T10:47:45.343308000 0.336797s info: Creating a default database for your convenience. (This is because you ran 'rethinkdb' without 'create', 'serve', or '--join', and the directory '/Users/jasonland/Sites/Incentify1/rethinkdb_data' did not already exist or is empty.) -2016-09-27T10:47:45.343326000 0.336815s notice: Running rethinkdb 2.2.2 (CLANG 4.2 (clang-425.0.28))... -2016-09-27T10:47:45.349054000 0.342544s notice: Running on Darwin 14.5.0 x86_64 -2016-09-27T10:47:45.349083000 0.342572s notice: Loading data from directory /Users/jasonland/Sites/Incentify1/rethinkdb_data -2016-09-27T10:47:45.424336000 0.417825s info: Automatically using cache size of 188 MB -2016-09-27T10:47:45.425168000 0.418657s notice: Listening for intracluster connections on port 29015 -2016-09-27T10:47:45.426724000 0.420213s notice: Listening for client driver connections on port 28015 -2016-09-27T10:47:45.426803000 0.420292s notice: Listening for administrative HTTP connections on port 8080 -2016-09-27T10:47:45.426806000 0.420295s notice: Listening on addresses: 127.0.0.1, ::1 -2016-09-27T10:47:45.426807000 0.420295s notice: To fully expose RethinkDB on the network, bind to all addresses by running rethinkdb with the `--bind all` command line option. -2016-09-27T10:47:45.426808000 0.420297s notice: Server ready, "jason_lands_macbook_pro_local_61w" a81b19a7-0d46-44a9-96d0-e0040d8b2023 -2016-09-27T10:47:46.312108000 1.305597s notice: A newer version of the RethinkDB server is available: 2.3.5. You can read the changelog at . diff --git a/rethinkdb_data/metadata b/rethinkdb_data/metadata deleted file mode 100644 index a4161a6..0000000 Binary files a/rethinkdb_data/metadata and /dev/null differ diff --git a/src/App.vue b/src/App.vue index c35cfc3..207316c 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,84 +1,75 @@ diff --git a/src/assets/incentify-logo-square_360.png b/src/assets/incentify-logo-square_360.png new file mode 100644 index 0000000..22b7847 Binary files /dev/null and b/src/assets/incentify-logo-square_360.png differ diff --git a/src/assets/incentify.logo.png b/src/assets/incentify.logo.png new file mode 100644 index 0000000..f2bea97 Binary files /dev/null and b/src/assets/incentify.logo.png differ diff --git a/src/assets/logo.png b/src/assets/logo.png deleted file mode 100644 index f3d2503..0000000 Binary files a/src/assets/logo.png and /dev/null differ diff --git a/src/assets/mountain.jpg b/src/assets/mountain.jpg new file mode 100644 index 0000000..5f9e782 Binary files /dev/null and b/src/assets/mountain.jpg differ diff --git a/src/assets/mountain.png b/src/assets/mountain.png new file mode 100644 index 0000000..4540ff1 Binary files /dev/null and b/src/assets/mountain.png differ diff --git a/src/auth/index.js b/src/auth/index.js new file mode 100644 index 0000000..1e81ddd --- /dev/null +++ b/src/auth/index.js @@ -0,0 +1,33 @@ +import {router} from '../main' + +export default { + + // User object will let us check authentication status + user: { + authenticated: false + }, + + // To log out, we just need to remove the token + logout() { + localStorage.removeItem('token') + this.user.authenticated = false; + state.go('/register'); + }, + + checkAuth() { + var jwt = localStorage.getItem('token') + if(jwt) { + this.user.authenticated = true + state.go('/dashboard') + } + else { + this.user.authenticated = false + state.go('/register') + } + }, + + getToken() { + return localStorage.getItem('token'); + } + +} \ No newline at end of file diff --git a/src/auth/interceptor.js b/src/auth/interceptor.js new file mode 100644 index 0000000..5fe7090 --- /dev/null +++ b/src/auth/interceptor.js @@ -0,0 +1,14 @@ +import Vue from 'vue'; +// import VueResource from 'vue-resource'; +import auth from './index.js'; + +export default{ + init(){ + Vue.http().interceptors.push((request, next) => { + if(!request.headers["Authorization"]) { + request.headers["Authorization"] = 'Bearer ' + auth.getToken() + } + next() + }) + } +} \ No newline at end of file diff --git a/src/components/Dashboard.vue b/src/components/Dashboard.vue index 2c6685f..8f4a2ae 100644 --- a/src/components/Dashboard.vue +++ b/src/components/Dashboard.vue @@ -1,58 +1,85 @@ \ No newline at end of file diff --git a/src/components/Goal.vue b/src/components/Goal.vue index c1003dc..580f6b1 100644 --- a/src/components/Goal.vue +++ b/src/components/Goal.vue @@ -1,147 +1,107 @@ + \ No newline at end of file diff --git a/src/components/Profile.vue b/src/components/Profile.vue index abd4afc..198fd95 100644 --- a/src/components/Profile.vue +++ b/src/components/Profile.vue @@ -1,41 +1,61 @@ \ No newline at end of file diff --git a/src/components/Register.vue b/src/components/Register.vue index 72e9d8b..3b02cf4 100644 --- a/src/components/Register.vue +++ b/src/components/Register.vue @@ -1,23 +1,249 @@ - \ No newline at end of file diff --git a/src/components/Settings.vue b/src/components/Settings.vue index 4f0e67f..9829f8d 100644 --- a/src/components/Settings.vue +++ b/src/components/Settings.vue @@ -1,19 +1,26 @@ + \ No newline at end of file diff --git a/src/components/add-goal.vue b/src/components/add-goal.vue new file mode 100644 index 0000000..1b9b550 --- /dev/null +++ b/src/components/add-goal.vue @@ -0,0 +1,147 @@ + + + + + + \ No newline at end of file diff --git a/src/components/header.vue b/src/components/header.vue deleted file mode 100644 index 6bb066d..0000000 --- a/src/components/header.vue +++ /dev/null @@ -1,18 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/components/navbar.vue b/src/components/navbar.vue index f01b932..a49dd1f 100644 --- a/src/components/navbar.vue +++ b/src/components/navbar.vue @@ -1,25 +1,65 @@ diff --git a/src/components/test.vue b/src/components/test.vue new file mode 100644 index 0000000..35d9fb0 --- /dev/null +++ b/src/components/test.vue @@ -0,0 +1,72 @@ + + + + + + + diff --git a/src/components/top-branding.vue b/src/components/top-branding.vue index a9bf1b2..257caf2 100644 --- a/src/components/top-branding.vue +++ b/src/components/top-branding.vue @@ -1,16 +1,13 @@ + \ No newline at end of file diff --git a/src/main.js b/src/main.js index d9aac58..c80b820 100644 --- a/src/main.js +++ b/src/main.js @@ -1,6 +1,12 @@ import Vue from 'vue'; import App from './App'; import VueRouter from 'vue-router'; +import VueResource from 'vue-resource'; +import FastClick from 'fastclick'; +import VueSweetAlert from 'vue-sweetalert'; +import vueMoment from 'vue-moment'; +// import Interceptor from './auth/interceptor.js'; + // routes import Register from './components/Register.vue'; import Profile from './components/Profile.vue'; @@ -8,10 +14,22 @@ import Settings from './components/Settings.vue'; import Dashboard from './components/Dashboard.vue'; import Goal from './components/Goal.vue'; +Vue.use(VueSweetAlert); +// global HTTP header interception +// Interceptor.init(); + +// instantiate vue-resource +Vue.use(VueResource); + // instantiate vue-router Vue.use(VueRouter); + +Vue.use(vueMoment); const router = new VueRouter(); +// get rid of 300ms tap delay +FastClick.attach(document.body); + router.map({ '/': { component: Register, @@ -31,6 +49,13 @@ router.map({ }); router.start(App, 'body'); +document.addEventListener("DOMContentLoaded", function(event) { + setTimeout(function() { + navigator.splashscreen.hide(); + }, 3000) + +}) + /* eslint-disable no-new */ new Vue({