Git Product home page Git Product logo

codingfriend1 / feathers-vue Goto Github PK

View Code? Open in Web Editor NEW
199.0 9.0 48.0 22.36 MB

A boiler plate template using Feathers with Email Verification, Vue 2 with Server Side Rendering, stylus, scss, jade, babel, webpack, ES 6-8, login form, user authorization, and SEO

License: MIT License

JavaScript 75.19% HTML 4.59% CSS 6.45% Vue 13.77%
vuejs2 feathersjs lodash bootstrap email-verification authentication authorization docker jade stylus

feathers-vue's Introduction

Feathers-Vue

A Vue 2 and FeathersJS 2 fullstack app with authentication, email verification, and email support."

About

This project uses Feathers. An open source web framework for building modern real-time applications and Vue 2 with Server Side Rendering.

This project is not finished but if you are can be ready to use if you are content with what it offers.

Features

  • SASS
  • Stylus
  • Pug
  • ES6, ES7, and ES8
  • Webpack
  • Vue Stash - For Redux Store
  • Bootstrap
  • Lodash
  • jQuery
  • FontAwesome
  • Validate client side data with mongoose schemas

Getting Started

Getting up and running is as easy as 1, 2, 3, 4.

There are multiple ways to start/develop the app.

Develop with docker

Don't install node_modules locally

  1. Create a environment-dev.env and environment.env file to hold your environment variables. These files are ignored by git. You'll want a DATABASE_URL and you gmail info for email verification
DATABASE_URL=mongodb://db/feathersvuedevelopment
[email protected]
[email protected]
GMAIL_PASSWORD=your_pass_password

See How to set an app password

  1. Run npm start
npm start
  1. To see production build locally
npm run build-qa
npm run qa
  1. To switch back to development use
npm run build-dev
npm start

Switching contexts between production and development requires a full docker build with no cache.

Develop without docker

  1. Make sure you have NodeJS and npm installed.

  2. Install your dependencies

    cd path/to/Feathers-Vue; npm install
    
  3. Start your app locally

    mongod
    
    npm run dev
    
  4. In production run

    npm run build
    npm run production
    

If you want emails to work using gmail add the following environment variables

export [email protected]
export GMAIL_PASS=yourpassword or app-password

See How to set an app password

Testing

Simply run npm test and all your tests in the test/ directory to run server side unit test or run npm run integration to run client side side tests.

Scaffolding

Feathers has a powerful command line interface. Here are a few things it can do:

$ npm install -g feathers-cli             # Install Feathers CLI

$ feathers generate service               # Generate a new Service
$ feathers generate hook                  # Generate a new Hook
$ feathers generate model                 # Generate a new Model
$ feathers help                           # Show all commands

Help

For more information on all the things you can do with Feathers visit docs.feathersjs.com.

Looking for mobile?

I'm working on a cordova starter with feathers 2, Vue 2, and Framework 7. Visit the cordova branch of this repo.

Cordova Branch

Gitlab Auto Deployment

  1. Create a digitalocean instance from using the one-click docker instance.
  2. ssh into the instance and run
  sudo apt-get update
  sudo apt-get upgrade
  sudo apt-get -y install python-pip
  sudo pip install docker-compose
  1. Edit sshd_config
  nano /etc/ssh/sshd_config
  1. At the bottom of the file change PasswordAuthentication
  PasswordAuthentication yes
  1. Run reload ssh
  2. Set the secret environment variables in gitlab
  DATABASE_URL=mongodb://db/feathersvue
  DEPLOYMENT_SERVER_IP=your_ip_address
  DEPLOYMENT_SERVER_PASS=your_user_password
  DEPLOYMENT_SERVER_USER=your_server_user
  1. Update docker-compose.autodeploy.yml web image to point to your hosted image.
  2. Update gitlab-ci.yml in the only sections to only run on the branches you want to deploy from.
  3. Push changes in git to gitlab.

Breaking Changes

  • Removed mongoose validation from client side and replaced with Yup.
  • Reconstructed server-side rendering to use updated instructions in vuejs.
  • Moved server-entry file into app.

License

Copyright (c) 2016

Licensed under the MIT license.

feathers-vue's People

Contributors

codingfriend1 avatar zacaytion avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

feathers-vue's Issues

pug is not a loader error, new routes not generating

hi,
on a fresh install, it throws this error

npm run dev

> [email protected] dev /Users/jacc/Sites/feathersjs-projects/feathers-vue-template
> npm-run-all --parallel watch serve


> [email protected] watch /Users/jacc/Sites/feathersjs-projects/feathers-vue-template
> gulp && webpack -w


> [email protected] serve /Users/jacc/Sites/feathersjs-projects/feathers-vue-template
> nodemon --watch server --watch config server/

[nodemon] 1.12.1
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: /Users/jacc/Sites/feathersjs-projects/feathers-vue-template/server/**/* /Users/jacc/Sites/feathersjs-projects/feathers-vue-template/config/**/*
[nodemon] starting `node server/`
[03:41:16] Using gulpfile ~/Sites/feathersjs-projects/feathers-vue-template/gulpfile.js
[03:41:16] Starting 'default'...
[03:41:16] Starting 'inject-css'...
inject-css
[03:41:16] gulp-inject 1 file into app.styl.
[03:41:16] Finished 'inject-css' after 158 ms
[03:41:16] Starting 'inject-schemas'...
[03:41:16] gulp-inject 4 files into index.js.
[03:41:16] Finished 'inject-schemas' after 56 ms
[03:41:16] Starting 'inject-component-js'...
[03:41:16] gulp-inject Nothing to inject into index.js.
[03:41:16] Finished 'inject-component-js' after 13 ms
[03:41:16] Starting 'inject-vue'...
[03:41:16] gulp-inject 3 files into index.js.
[03:41:16] Finished 'inject-vue' after 19 ms
[03:41:16] Starting 'inject-views'...
[03:41:16] gulp-inject 3 files into routes.js.
[03:41:16] Finished 'inject-views' after 15 ms
[03:41:16] Starting 'inject-hooks'...
[03:41:16] gulp-inject 16 files into index.js.
[03:41:16] Finished 'inject-hooks' after 30 ms
[03:41:16] Starting 'globalize-vue-components'...
[nodemon] restarting due to changes...
[03:41:16] gulp-inject 6 files into index.js.
[03:41:16] Finished 'globalize-vue-components' after 148 ms
[03:41:16] Finished 'default' after 451 ms
[nodemon] starting `node server/`
You are using the default filter for the users service. For more information about event filters see https://docs.feathersjs.com/api/events.html#event-filtering
You are using the default filter for the settings service. For more information about event filters see https://docs.feathersjs.com/api/events.html#event-filtering
You are using the default filter for the roles service. For more information about event filters see https://docs.feathersjs.com/api/events.html#event-filtering
You are using the default filter for the message service. For more information about event filters see https://docs.feathersjs.com/api/events.html#event-filtering

Webpack is watching the files…

port 3030
[==                  ] 10% (building modules)info: Feathers application started on localhost:3030
mlab connected
(node:49229) DeprecationWarning: loaderUtils.parseQuery() received a non-string value which can be problematic, see https://github.com/webpack/loader-utils/issues/56
parseQuery() will be replaced with getOptions() in the next major version of loader-utils.
[===                 ] 15% (building modules)/Users/jacc/Sites/feathersjs-projects/feathers-vue-template/node_modules/loader-runner/lib/loadLoader.js:35
     throw new Error("Module '" + loader.path + "' is not a loader (must have normal or pitch function)");
     ^

Error: Module '/Users/jacc/Sites/feathersjs-projects/feathers-vue-template/node_modules/pug/lib/index.js' is not a loader (must have normal or pitch function)
   at loadLoader (/Users/jacc/Sites/feathersjs-projects/feathers-vue-template/node_modules/loader-runner/lib/loadLoader.js:35:10)
   at iteratePitchingLoaders (/Users/jacc/Sites/feathersjs-projects/feathers-vue-template/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
   at iteratePitchingLoaders (/Users/jacc/Sites/feathersjs-projects/feathers-vue-template/node_modules/loader-runner/lib/LoaderRunner.js:165:10)
   at /Users/jacc/Sites/feathersjs-projects/feathers-vue-template/node_modules/loader-runner/lib/LoaderRunner.js:173:18
   at loadLoader (/Users/jacc/Sites/feathersjs-projects/feathers-vue-template/node_modules/loader-runner/lib/loadLoader.js:36:3)
   at iteratePitchingLoaders (/Users/jacc/Sites/feathersjs-projects/feathers-vue-template/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
   at runLoaders (/Users/jacc/Sites/feathersjs-projects/feathers-vue-template/node_modules/loader-runner/lib/LoaderRunner.js:362:2)
   at NormalModule.doBuild (/Users/jacc/Sites/feathersjs-projects/feathers-vue-template/node_modules/webpack/lib/NormalModule.js:182:3)
   at NormalModule.build (/Users/jacc/Sites/feathersjs-projects/feathers-vue-template/node_modules/webpack/lib/NormalModule.js:275:15)
   at Compilation.buildModule (/Users/jacc/Sites/feathersjs-projects/feathers-vue-template/node_modules/webpack/lib/Compilation.js:151:10)
   at factoryCallback (/Users/jacc/Sites/feathersjs-projects/feathers-vue-template/node_modules/webpack/lib/Compilation.js:344:12)
   at factory (/Users/jacc/Sites/feathersjs-projects/feathers-vue-template/node_modules/webpack/lib/NormalModuleFactory.js:241:5)
   at applyPluginsAsyncWaterfall (/Users/jacc/Sites/feathersjs-projects/feathers-vue-template/node_modules/webpack/lib/NormalModuleFactory.js:94:13)
   at /Users/jacc/Sites/feathersjs-projects/feathers-vue-template/node_modules/tapable/lib/Tapable.js:268:11
   at NormalModuleFactory.params.normalModuleFactory.plugin (/Users/jacc/Sites/feathersjs-projects/feathers-vue-template/node_modules/webpack/lib/CompatibilityPlugin.js:52:5)
   at NormalModuleFactory.applyPluginsAsyncWaterfall (/Users/jacc/Sites/feathersjs-projects/feathers-vue-template/node_modules/tapable/lib/Tapable.js:272:13)
   at resolver (/Users/jacc/Sites/feathersjs-projects/feathers-vue-template/node_modules/webpack/lib/NormalModuleFactory.js:69:10)
   at process.nextTick (/Users/jacc/Sites/feathersjs-projects/feathers-vue-template/node_modules/webpack/lib/NormalModuleFactory.js:194:7)
   at _combinedTickCallback (internal/process/next_tick.js:131:7)
   at process._tickCallback (internal/process/next_tick.js:180:9)

I also was inspecting webpack.config.js trying to trace the root of the issue and see that the loaders only include folders.app but there are also .pug files in folders.server for the email templates.

I am not entirely sure if this is also why my main.js and ssr files are not generating on builds. I can tell they aren't because I've added new routes and they aren't showing there. If unrelated, happy to open up a second issue.

Sorry if I am getting any of this wrong - am new to feathers/vue.

Thanks for a great boilerplate!

Couldn't find env file

This is a great project, with a lot of awesome functionality. Thanks!

I was interested in being able to stand this up using docker so I ran the

docker-compose up command.

This threw an error:
"Couldn't find env file"

Make the cordova branch framework agnostic

The cordova branch is very interesting, too, however I would not recommend to use a garbage framework, instead make it framework agnostic or use the existing alternatives that are already well integrated with vuejs, like e.g. quasar or weex.

REST services documentation

Is there a documentation on how to use the REST services? I'm stuck on Logout and Forget Password requests.

realtime

It's possible change to a realtime application?
how can I change to connect in feathers to use socket api ?

Please make it possible to use with other DB backends

Hi, feathers is a great project - what makes it so great is the fact that it is database agnostic.
This project looks also very interesting - however, you drop one of the main selling points for feathers by fixating on one backend DB. It would be a great step towards more "featherness" if you tried to implement this boilerplate in a DB agnostic way!
Thank you very much!

FYI install and yarn dev warnings

Hi on a fresh install, node v8.6.0

on yarn

yarn install v1.1.0
warning package.json: "dependencies" has dependency "request" with range "^2.81.0" that collides with a dependency in "devDependencies" of the same name with version "^2.79.0"
warning [email protected]: "dependencies" has dependency "request" with range "^2.81.0" that collides with a dependency in "devDependencies" of the same name with version "^2.79.0"

on yarn dev

`WARNING in ./~/ws/lib/Validation.js
Module not found: Error: Cannot resolve module 'utf-8-validate' in /Users/Tektango/nodetomic/Feathers-Vue/node_modules/ws/lib
 @ ./~/ws/lib/Validation.js 10:22-47`

`WARNING in ./~/ws/lib/BufferUtil.js
Module not found: Error: Cannot resolve module 'bufferutil' in /Users/Tektango/nodetomic/Feathers-Vue/node_modules/ws/lib
 @ ./~/ws/lib/BufferUtil.js 35:21-42`

Just FYI - Server / client boot up fine.

Authentication via REST?

I am attempting to login via REST service (I'm using Postman for this but just converted it's request to a CURL request for sharing here),

curl -X POST \
  http://localhost:3030/api/auth/local \
  -H 'accept: application/json' \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/x-www-form-urlencoded' \
  -H 'postman-token: 24a2aa66-e4ca-b4a3-402c-f129f110a619' \
  -d 'email=johndoe%40gmail.com&password=123456&strategy=local'

But the server returns the following response,
{"name":"NotFound","message":"Page not found","code":404,"className":"not-found","errors":{}}

I am able to create users, get messages, get users all by REST. But authentication just isn't working for me. What am I doing wrong?

Unverified user is able to login

I found this project very helpful. Thanks for the effort.
I'm currently still exploring the project and might have missed it, but shouldn't users be unable to login if their email is unverified?
If there's no support for this, kindly share some hints on how I can implement this.

Thanks

Npm run serve Failed

Hello I can't start OSX npm -v
3.10.10
Thanks

Cannot read property 'type' of undefined
[Vue warn]: Error in beforeCreate hook:
(found in <SimpleInput>)
Error rendering to string:
TypeError: Cannot read property 'type' of undefined
    at VueComponent.proxyGetter [as type] (__vue_ssr_bundle__:10857:28)
    at VueComponent.beforeCreate (__vue_ssr_bundle__:76226:22)
    at callHook (__vue_ssr_bundle__:10483:22)
    at VueComponent.Vue._init (__vue_ssr_bundle__:11923:6)
    at new VueComponent (__vue_ssr_bundle__:12091:13)
    at createComponentInstanceForVnode (/Users/insidebox/Desktop/insidebox-v2/node_modules/vue-server-renderer/build.js:5143:10)
    at renderComponent (/Users/insidebox/Desktop/insidebox-v2/node_modules/vue-server-renderer/build.js:6637:40)
    at RenderContext.renderNode (/Users/insidebox/Desktop/insidebox-v2/node_modules/vue-server-renderer/build.js:6622:7)
    at RenderContext.next (/Users/insidebox/Desktop/insidebox-v2/node_modules/vue-server-renderer/build.js:169:14)
    at cachedWrite (/Users/insidebox/Desktop/insidebox-v2/node_modules/vue-server-renderer/build.js:30:9)
Cannot read property 'type' of undefined

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.