icebob / vue-express-mongo-boilerplate

:star: MEVN Full stack JS web app boilerplate with NodeJS, Express, Mongo and VueJS
http://vemapp.moleculer.services/
2.84k stars 757 forks source link
boilerplate express fullstack fullstack-boilerplate graphql mongo nodejs vue vuejs webpack

Vue, Express, MongoDB full-stack JS Boilerplate

Known Vulnerabilities Node 10 VueJS 2 Webpack 4

This is a full stack webapp boilerplate project with VueJS + ExpressJS + MongoDB. It is NOT an out-of-box project. I make it in order to create an up-to-date starter repo which contains all important functions (user signup, login, oauth, profile, ...etc) except the business-logic. So when neccessary I can create a new webapp and only need to develop the business logic.

This is just my personal boilerplate, it may or may not be a good fit for your project(s). Inspired by dstroot/skeleton and sahat/hackathon-starter

If you like my work, please donate. Thank you!

Live Demo (login: test/test1234 or sign-up)

Features

Server-side

Client-side

Supported remote logging services

Usage

Install dependencies

$ npm install

or

yarn

For development

$ npm run dev

Build web app scripts and styles:

$ npm run build

For production

$ npm start

Docker

Building the images for the first time

$ docker-compose build

Starting the images

$ docker-compose up

Screenshots

Login screen

Login screen

Index page after login

Index page

Devices page

Devices module

Directory structure

+---build
+---client
|   +---app
|   |   +---core
|   |   +---modules
|   |       +---demo
|   |       +---devices
|   |       +---home
|   |       +---posts
|   |       +---session
|   |                   
|   +---frontend
|   +---images
|   +---scss
|                   
+---data
+---logs
+---server
|   |   bundle.js
|   |   dev.js
|   |   index.js
|   +---applogic
|   |   +---libs
|   |   +---modules
|   |       +---counter
|   |       +---devices
|   |       +---posts
|   |       +---session
|   +---config
|   |       default.js
|   |       index.js
|   |       prod.js
|   |       test.js
|   |       
|   +---core
|   +---libs
|   +---locales
|   |   +---en
|   |   +---hu
|   +---models
|   |       user.js
|   +---public
|   +---routes
|   +---schema
|   +---services
|   +---views
+---tests
|
|   package.json
|   secrets.json

Bundled server-side

If you want to bundle your NodeJS server-side code run webpack on server code with npm run build && npm run build:server command. It if was success, run the server: npm run start:bundle

If you want to export bundled version copy these folders & files to the new place:

- server
    - locales
    - public
    - views
    - bundle.js
- package.json
- config.js (optional)

Before start, you have to install production dependencies with npm: npm install --production

Obtaining API keys for social signup/login

Google Logo

These are the instructions for Google:

Facebook Logo

These are the instructions for Facebook:

Note: After a successful sign in with Facebook, a user will be redirected back to home page with appended hash #_=_ in the URL. It is not a bug. See this Stack Overflow discussion for ways to handle it.

Update: Added a commented workaround to App.vue, otherwise the FB users may end up on a blank page on redirect.

GitHub Logo

These are the instructions for GitHub:

Twitter Logo

These are the instructions for Twitter:

License

vue-express-mongo-boilerplate is available under the MIT license.

Contact

Copyright (C) 2016 Icebob

@icebob @icebob