All Projects → petervmeijgaard → Vue 2 Boilerplate

petervmeijgaard / Vue 2 Boilerplate

Vue 2 boilerplate for developing medium to large single page applications.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Vue 2 Boilerplate

Vue Enterprise Boilerplate
An ever-evolving, very opinionated architecture and dev environment for new Vue SPA projects using Vue CLI.
Stars: ✭ 7,354 (+749.19%)
Mutual labels:  boilerplate, frontend
Koa Vue Notes Web
🤓 This is a simple SPA built using Koa as the backend, Vue as the first frontend, and React as the second frontend. Features MySQL integration, user authentication, CRUD note actions, and Vuex store modules.
Stars: ✭ 200 (-76.91%)
Mutual labels:  boilerplate, frontend
Mern Authentication
MERN stack authentication boilerplate: password reset, email verification, server sessions, redux, hooks and docker for dev and prod.
Stars: ✭ 129 (-85.1%)
Mutual labels:  boilerplate, frontend
Fast
Develop, build, deploy, redeploy, and teardown frontend projects fast.
Stars: ✭ 126 (-85.45%)
Mutual labels:  boilerplate, frontend
Gulp Front
Frontend boilerplate and framework based on gulp, pug, stylus and babel
Stars: ✭ 237 (-72.63%)
Mutual labels:  boilerplate, frontend
Webpack Starter
✨ A lightweight foundation for your next webpack based frontend project.
Stars: ✭ 1,745 (+101.5%)
Mutual labels:  boilerplate, frontend
Yii2 Angular Boilerplate
Yii2 REST API + Angular10 Boilerplate (Frontend/Backend)
Stars: ✭ 194 (-77.6%)
Mutual labels:  boilerplate, frontend
Baumeister
👷 The aim of this project is to help you to build your things. From Bootstrap themes over static websites to single page applications.
Stars: ✭ 171 (-80.25%)
Mutual labels:  boilerplate, frontend
React Landing Page Template
A simple react one page landing page templates for startups/companies
Stars: ✭ 224 (-74.13%)
Mutual labels:  boilerplate, frontend
Appy
🚀 A full stack boilerplate web app
Stars: ✭ 225 (-74.02%)
Mutual labels:  boilerplate, frontend
Pwa Boilerplate
✨ PWA Boilerplate is highly scalable and is designed to help you kick-start your next project 🔭.
Stars: ✭ 82 (-90.53%)
Mutual labels:  boilerplate, frontend
Aws Boilerplate
Opinionated full stack web app's boilerplate, ready to be deployed to AWS platform.
Stars: ✭ 682 (-21.25%)
Mutual labels:  boilerplate, frontend
Expo Three Demo
🍎👩‍🏫 Collection of Demos for THREE.js in Expo!
Stars: ✭ 76 (-91.22%)
Mutual labels:  boilerplate, frontend
Laravel6 Frontend Boilerplate
A Vue.js Frontend starter project kit template/boilerplate with Laravel 6 Backend API support.
Stars: ✭ 26 (-97%)
Mutual labels:  boilerplate, frontend
Js Boilerplate
Boilerplate for any javascript frontend project
Stars: ✭ 36 (-95.84%)
Mutual labels:  boilerplate, frontend
Frontend Boilerplate
An ES20XX starter with common frontend tasks using Webpack 4 as module bundler and npm scripts as task runner.
Stars: ✭ 224 (-74.13%)
Mutual labels:  boilerplate, frontend
Frontend Boilerplates
Collection of Boilerplates with ES6, Vue, React, Nuxt, TypeScript, SCSS, Nodejs. Using good practices and file structures to inspire your real projects.
Stars: ✭ 269 (-68.94%)
Mutual labels:  boilerplate, frontend
Primitive
⛏️ ‎ A front-end design toolkit for developing web apps.
Stars: ✭ 783 (-9.58%)
Mutual labels:  boilerplate, frontend
Vue Stack
Minimalistic Boilerplate for FullStack Express and Vue.js applications
Stars: ✭ 26 (-97%)
Mutual labels:  boilerplate
Frontend React
Open sourced front end application for codecorgi.
Stars: ✭ 9 (-98.96%)
Mutual labels:  frontend

vue-2-boilerplate

A boilerplate for building medium to large Vue 2 single-page applications

This boilerplate is based on the Vue webpack template. Common topics are discussed in the VueJS docs. Make sure to read it!

Usage

To get up and running run:

$ yarn
$ yarn serve

Yes, that's it. Only two commands!

If you still think that's too much effort, you could also run:

$ yarn && yarn serve

But yeah, this will basically do the same as yarn. If even this is too much of a deal, try creating an alias and bind yarn && yarn serve to yarn:serve.

Configuration

Wait a minute, you just said that I only need to run yarn? What's this? Do I need to do more?

Yeah, to get up and running real quick, yarn is enough. But if you want to, let's say, connect to an external API, there's a little bit more involved. You need to configure your application a bit more, explained below:

Environment variables

In the root of the boilerplate is a predefined environment file. Copy the file and name it .env or a configuration specific file like .env.dev. For more information, visit the docs.

What's included

  • yarn serve: first-in-class development experience.
  • yarn build: production-ready build.
  • yarn unit: start the Karma Test Runner.
  • yarn e2e: start the Nightwatch Test Runner.
  • yarn lint: lint the files using ESLint.

Important Files

So there are two important files that need to be addressed:

main.js

This file will load your single page application and bootstrap all the plugins that are used. It will also serve as the entry point which will be loaded and compiled using webpack.

App.vue

The main Vue file. This file will load the page inside the router-view-component. It will check if the user is authenticated and load the resources accordingly.

Directory Structure

Inside the src-directory, are a couple of directories that need to be addressed:

Assets

The assets that you want to use are placed inside this directory. This can be images, stylesheets, videos... you name it.

Components

Your components will be placed inside this directory. As you can see, this boilerplate comes already shipped with a pre-made card component.

Layouts

Your layout files will be placed inside this directory. When you are building a large single page application, you will be using different layouts. For instance, your login-page or register-page will have a different layout than your account-page.

The boilerplate comes out of the box with two layouts included. A minimal layout, used for the login and register page, and a default layout, used for the home and account page.

Locale

The Vue I18n plugin is used for localization. In the locale directory, you'll find an example for internalization. This boilerplate comes with examples for English and Dutch out of the box, but feel free to add more!

Mixins

The mixins you want to use with Vue will be placed inside this directory.

Inside the mixins directory is a slot-mixin. This mixin will add the hasSlot()-method to all the components it is used in.

Plugins

This boilerplate comes with a couple of plugins you can use. It will load and configure:

  • axios
  • bootstrap
  • font-awesome
  • vue-i18n
  • vue-router
  • vuex
  • vuex-router-sync

Don't like one of those plugins? Just remove the file from the plugins-directory and remove the entry from the main.js-file. Also, make sure to remove the package and dependencies from the package.json-file.

Proxies

Proxies are used to perform AJAX-requests. This boilerplate comes with a base proxy which can be used to make performing AJAX-requests fairly easy. Create a new proxy, for example, UserProxy, and extend the Proxy. This way you've got access to the all, find, update, create and destroy methods. The boilerplate comes with an AccountProxy and AuthProxy by default.

Routes

In this directory, you can specify the routes that are used by this application. Vue Router loads the routes located in this directory.

Store

As mentioned before, Vuex is used as a single point of truth. To learn more about Vuex, visit the documentation

Transformers

Transformers are used to transform the incoming and outgoing requests. If you have an API where you can retrieve posts from, a post will look something like this:

{
  "id" : 1,
  "title" : "Hello World!",
  "content" : "Lorem Ipsum",
  "created_at" : "today"
}

However, it feels weird to use snake_cased variables inside your camelCased application. This is where transformers come in. So given the previous example, using a transformer, it will look something like this:

{
  "id" : 1,
  "title" : "Hello World!",
  "content" : "Lorem Ipsum",
  "createdAt" : "today"
}

Utils

Here you can place handy utils you want to use inside your application.

Views

The pages are placed inside this directory. By default it comes with an Account/Index.vue, Home/Index.vue, Login/Index.vue and a Register/Index.vue page, but feel free to add more.

Test

Both the Unit Tests and the End-2-End Tests are within the test/ folder. Unit Tests should go inside the test/unit/specs folder. E2e Tests should go inside the test/e2e/specs folder. You can read more about both tests on the Webpack Boilerplate Testing Session.

Got questions or improvements?

Feel free to hit me up on:

Or create an issue

Fork It And Make Your Own

What are you waiting for?! Make something awesome!

License

The MIT License (MIT)

Copyright (c) 2016 - 2020 Peter van Meijgaard

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].