-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
0 parents
commit 2894fab
Showing
140 changed files
with
89,587 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"presets": ["latest"], | ||
"plugins": ["transform-regenerator"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# http://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Logs | ||
logs | ||
*.log | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directory | ||
# Commenting this out is preferred by some people, see | ||
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git- | ||
node_modules | ||
|
||
# Users Environment Variables | ||
.lock-wscript | ||
environment.env | ||
data/ | ||
public/admin/ | ||
public/app/ | ||
lib/email-templates/ | ||
lib/hooks/ | ||
lib/services/ | ||
lib/middleware/ | ||
lib/app.js | ||
lib/index.js | ||
lib/routes.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"node": true, | ||
"esnext": true, | ||
"bitwise": true, | ||
"camelcase": true, | ||
"curly": true, | ||
"eqeqeq": true, | ||
"immed": true, | ||
"indent": 2, | ||
"latedef": "nofunc", | ||
"newcap": false, | ||
"noarg": true, | ||
"quotmark": "single", | ||
"regexp": true, | ||
"undef": true, | ||
"unused": false, | ||
"strict": false, | ||
"trailing": true, | ||
"smarttabs": true, | ||
"white": false, | ||
"globals": { | ||
"it": true, | ||
"describe": true, | ||
"before": true, | ||
"beforeEach": true, | ||
"after": true, | ||
"afterEach": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Logs | ||
logs | ||
*.log | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directory | ||
# Commenting this out is preferred by some people, see | ||
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git- | ||
node_modules | ||
|
||
# Users Environment Variables | ||
.lock-wscript | ||
|
||
data/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
FROM codingfriend/meanbase | ||
|
||
################## ESTABLISH DIRECTORIES ###################### | ||
RUN rm -rf /var/www/ | ||
WORKDIR /var/www/ | ||
COPY package.json /var/www/ | ||
ENV NODE_ENV=production | ||
RUN npm install | ||
COPY public/ /var/www/public | ||
COPY lib/ /var/www/lib | ||
COPY config/ /var/www/config | ||
# RUN chmod -R 755 /var/www | ||
################## END DIRECTORIES ###################### | ||
|
||
# Expose the default port | ||
EXPOSE 3030 | ||
VOLUME /var/www | ||
|
||
CMD ["pm2", "start", "lib", "--no-daemon"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2015 Feathers | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
# Feathers-Vue | ||
|
||
> A Vue and FeathersJS fullstack app with authentication, email verification, and email support." | ||
## About | ||
|
||
This project uses [Feathers](http://feathersjs.com). 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 | ||
- Jade | ||
- ES6, ES7, and ES8 | ||
- Webpack | ||
- Vue Stash - For Redux Store | ||
- Jasmine with Karma for client side and mocha server side | ||
- Bootstrap | ||
- Lodash | ||
- jQuery | ||
- FontAwesome | ||
- Separate admin and app | ||
|
||
## Getting Started | ||
|
||
Getting up and running is as easy as 1, 2, 3, 4. | ||
|
||
1. Make sure you have [NodeJS](https://nodejs.org/) and [npm](https://www.npmjs.com/) installed. | ||
2. Install your dependencies | ||
|
||
``` | ||
cd path/to/Feathers-Vue; npm install | ||
``` | ||
3. Run your build or watch | ||
``` | ||
npm run build | ||
``` | ||
``` | ||
npm run watch | ||
``` | ||
4. Start your app locally | ||
``` | ||
mongod | ||
``` | ||
``` | ||
npm run serve | ||
``` | ||
In production run | ||
``` | ||
npm run production | ||
npm start | ||
``` | ||
If you want emails to work using gmail add the following environment variables | ||
``` | ||
export GMAIL=[email protected] | ||
export GMAIL_PASS=yourpassword or app-password | ||
``` | ||
_See [How to set an app password](https://support.google.com/accounts/answer/185833)_ | ||
## Testing | ||
Simply run `npm test` and all your tests in the `test/` directory to run server side unit test or run `npm test-client` to run client 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 | ||
``` | ||
## Schemas go in shared/schemas | ||
If you want the same schema to validate both client and server side put the schema in ./shared/schemas as it's own file with the file name being the name of the schema and resulting model. | ||
You can use `pattern` and `patternMessage` directly in the schema and it will be converted to | ||
``` | ||
validate: { | ||
validator: function(v) { | ||
return pattern.test(v) | ||
}, | ||
message: patternMessage | ||
} | ||
``` | ||
for you. | ||
## Docker-compose | ||
You may run | ||
``` | ||
docker-compose up | ||
``` | ||
to build a docker-virtual machine instance. | ||
## Help | ||
For more information on all the things you can do with Feathers visit [docs.feathersjs.com](http://docs.feathersjs.com). | ||
## License | ||
Copyright (c) 2016 | ||
Licensed under the [MIT license](LICENSE). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import '../shared/services/auth.service' | ||
import './vendor' | ||
|
||
// remount vue app from client because the server makes a one time static render that's not interactable and will cause full page reloads when navigating | ||
import './boot' | ||
|
||
// We import app.styl last because it has a style that hides the #cover over the app to hide the style flicker. This was a better option then creating a second styles bundle that would have almost doubled the code size due to needing to load babel again for the .vue files. | ||
import './css/app.styl' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import Vue from 'vue' | ||
import store from './store-reconciliation' | ||
import router from '../../shared/boot/router' | ||
|
||
import prepareSyncList from '../../shared/services/sync-list.service' | ||
import '../../shared/services/api.service' | ||
import '../../shared/services/notification.service' | ||
import '../../shared/services/helpers.service' | ||
|
||
import '../../shared/components' | ||
import '../components' | ||
import '../views' | ||
import App from '../views/app.vue' | ||
|
||
import * as filters from '../filters' | ||
|
||
const app = new Vue(Object.assign({ | ||
router, | ||
data: { store } | ||
}, App)) | ||
|
||
prepareSyncList(app.store) | ||
prepareConfirm(app.store) | ||
|
||
if(Vue.prototype.$isServer) { | ||
app.$mount('#app') | ||
} else { | ||
auth.isLoggedIn() | ||
.then(res => app.$mount('#app')) | ||
.catch(err => app.$mount('#app')) | ||
} | ||
|
||
|
||
export { app, router, store } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// The server may have made changes to the store before rendering the initial html. It writes those changes to window.__INITIAL_STATE__. We need to set out local store to be the same as the server so vue does not throw an hydration error (server and client html out of sync) | ||
import Vue from 'vue' | ||
import VueStash from 'vue-stash' | ||
import defaultStore from '../store' | ||
|
||
Vue.use(VueStash) | ||
|
||
let store = defaultStore | ||
|
||
try { | ||
if(window && window.__INITIAL_STATE__ && window.__INITIAL_STATE__ !== "init_state") { | ||
store = window.__INITIAL_STATE__ | ||
} | ||
} catch(err) {} | ||
|
||
export default store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// inject component js | ||
import "./user-row/user-row.js" | ||
// end inject component js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
div.user-row | ||
div(@click="showDetails = !showDetails").user-row-header | ||
div.icon(:style="{ backgroundColor: modifiedUser.color }", :title="modifiedUser.name") | ||
div.initials {{initials}} | ||
div.user | ||
div.title {{modifiedUser.email}} | ||
div.role {{modifiedUser.role || 'admin'}} | ||
div.user-settings(v-if="modifiedUser._id !== currentUser._id && showDetails") | ||
.form-input-group.four.h-4.m-4.padding-right-1.v-top | ||
label.form-check-label Account | ||
div.enabled-toggle | ||
.checkbox.no-top-margin | ||
label | ||
input(type='checkbox', @change="changeIsEnabled(user)", v-model="user.newIsEnabled", :disabled="modifiedUser.role === 'admin'") | ||
| Enabled | ||
.form-input-group.four.h-4.m-4.padding-right-1.v-top | ||
label Role | ||
div.role | ||
select(@change="changeUserRole(user)", v-model="modifiedUser.newRole").form-control | ||
option(v-for="role in roles", :value="role.role") {{role.role}} | ||
div.drop-down | ||
i.fa.icon-ellipsis-vertical | ||
.four.h-4.m-4.v-center.margin-top-1 | ||
button.btn.btn-danger.delete-user-btn(@click="removeUser(modifiedUser)") Delete User |
Oops, something went wrong.