Giter VIP home page Giter VIP logo

hare's Introduction

Logo Application boilerplate based on Vue.js 2.x, Koa 2.x, Element-UI and Nuxt.js

CircleCI Windows Vulnerabilities JavaScript Style Guide ESLint Issues Stars License

Installation

$ git clone [email protected]:clarkdo/hare.git
$ cd hare
# install dependencies
$ yarn

Usage

Development

# serve with hot reloading at localhost:3000
$ yarn dev

Go to http://localhost:3000

Testing

# configure ESLint as a tool to keep codes clean
$ yarn lint
# use ava as testing framework, mixed with jsdom
$ yarn test

Production

# build for production and launch the server
$ yarn build
$ yarn start

Generate

# generate a static project
$ yarn generate

Analyze

# build and launch the bundle analyze
$ yarn analyze

Use PM

Further more features refer: PM2

# install pm2 globally
$ yarn global add pm2
# launch development server
$ yarn dev:pm2
# launch production server
$ yarn start:pm2
# Display all processes status
$ pm2 ls
# Show all information about app
$ pm2 show hare
# Display memory and cpu usage of each app
$ pm2 monit
# Display logs
$ pm2 logs
# Stop
$ pm2 stop hare
# Kill and delete
$ pm2 delete hare

Docker Dev

# build image
$ docker build -t hare-dev -f Dockerfile.dev ./
$ docker run -d -p 8888:3000 -e HOST=0.0.0.0 hare-dev

Go to http://localhost:8888

Docker Production

# build bundle
$ export NODE_ENV=''
$ yarn
$ yarn build
# install production dependencies (remove devDependencies)
$ yarn --prod
# build image
$ docker build -t hare-prod -f Dockerfile ./
$ docker run -d -p 8889:3000 -e HOST=0.0.0.0 hare-prod

Go to http://localhost:8889

Documentation

Vue.js documentation: https://vuejs.org/

Nuxt.js documentation: https://nuxtjs.org

Element-UI documentation: http://element.eleme.io

Koa documentation: https://github.com/koajs/koa

hare's People

Contributors

clarkdo avatar dependabot-support avatar dependabot[bot] avatar renoirb avatar renovate-bot 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

hare's Issues

support ant-design-vue

What problem does this feature solve?

Add more Ui framework options is always good

What does the proposed changes look like?

Add ant-design-vue Ui framework

This feature request is available on Nuxt community (#c103)

preserveWhitespace=false not work in Nuxt2

Steps to reproduce

Yesterday ,I update my project to Nuxt2.0 from Nuxt1.0.
I found the space between dom element has changed.
So , I set preserveWhitespace:false to vue-loader. But it's not working ?

Does someone konw the reason?
46240725-781b2100-c3de-11e8-80d1-e837c0c94798.png

What is expected ?

WX20180929-120230.png

What is actually happening?

WX20180929-120241.png

This bug report is available on Nuxt community (#c101)

Head components

What problem does this feature solve?

Just for better code organization, it would be nice to be able to define as a Vue component in nuxt.config.js, similarly to what is done with loading.

What does the proposed changes look like?

Just something like:

head: '~/components/Head'
This feature request is available on Nuxt community (#c45)

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Repository problems

These problems occurred while renovating this repository. View logs.

  • WARN: Using npm packages for Renovate presets is now deprecated. Please migrate to repository-based presets instead.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): replace devdependency babel-eslint with @babel/eslint-parser ^7.11.0
  • chore(deps): replace devdependency cpx with cpx2 ^2.0.0
  • chore(deps): update dependency jwt-decode to v4
  • chore(deps): update dependency koa-body to v6
  • chore(deps): update dependency koa-router to v12
  • chore(deps): update dependency mkdirp to v3
  • chore(deps): update dependency nuxt to v3
  • chore(deps): update dependency vue-chartjs to v5
  • chore(deps): update dependency vue-i18n to v9
  • chore(deps): update devdependency @nuxtjs/eslint-config to v12
  • chore(deps): update devdependency ava to v6
  • chore(deps): update devdependency eslint to v9
  • chore(deps): update devdependency lint-staged to v15
  • chore(deps): update devdependency nodemon to v3
  • chore(deps): update devdependency rimraf to v5
  • chore(deps): update devdependency sass-loader to v14
  • chore(deps): update node.js to v20
  • chore(deps): update npm to v10
  • 🔐 Create all rate-limited PRs at once 🔐

Edited/Blocked

These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

circleci
.circleci/config.yml
dockerfile
Dockerfile
  • node 8-alpine
Dockerfile.dev
  • node 8-alpine
npm
package.json
  • @nuxtjs/axios ^5.5.4
  • bunyan ^1.8.12
  • chart.js ^2.8.0
  • js-cookie ^2.2.0
  • js-yaml ^3.13.1
  • jwt-decode ^2.2.0
  • koa ^2.7.0
  • koa-body ^4.1.0
  • koa-bunyan ^1.0.2
  • koa-bunyan-logger ^2.1.0
  • koa-compress ^3.0.0
  • koa-proxies ^0.8.1
  • koa-router ^7.4.0
  • koa-session ^5.12.2
  • mkdirp ^0.5.1
  • negotiator ^0.6.2
  • normalize.css ^8.0.1
  • nuxt ^2.8.1
  • nuxt-property-decorator ^2.3.0
  • svg-captcha ^1.4.0
  • vue-chartjs ^3.4.2
  • vue-clipboard2 ^0.3.0
  • vue-i18n ^8.12.0
  • xmlify ^1.1.0
  • @nuxtjs/eslint-config ^1.0.1
  • ava ^2.2.0
  • babel-eslint ^10.0.2
  • cpx ^1.5.0
  • cross-env ^5.2.0
  • eslint ^6.1.0
  • eslint-plugin-nuxt ^0.4.3
  • husky ^3.0.2
  • lint-staged ^9.2.1
  • lodash ^4.17.15
  • moxios ^0.4.0
  • node-sass ^4.12.0
  • nodemon ^1.19.1
  • rimraf ^2.6.3
  • sass-loader ^7.1.0
  • node >=8.0.0 <12
  • npm >=5.0.0

  • Check this box to trigger a request for Renovate to run again on this repository

baseURL does not take effect

Version

v0.4.0

Reproduction link

https://github.com/begueradj/nuxt-axios-baseurl-bug

Steps to reproduce

  1. Clone my repo and change to the resulted directory
  2. Intall the dependencites: yarn install
  3. Launch the server: yarn run dev

What is expected ?

I expect the number of displayed posts to be 100.

This means in pages/index.vue, when I have this code:

mounted() {
    axios.get('/posts')
    .then(response => {
      this.posts = response.data
    })
    .catch(e => {
      this.errors.push(e)
    })
  }

axios should recoginize the baseURL configuration key I set in nuxt.config.js and thus fetch data from http://jsonplaceholder.typicode.com/posts

Here is my nuxt.config.js file content related to axios module:

modules: [
    // Doc: https://github.com/nuxt-community/axios-module#usage
    ['@nuxtjs/axios', {
      baseURL: 'http://jsonplaceholder.typicode.com'
    }]
  ],
  /*
  ** Axios module configuration
  */
  axios: {
    // See https://github.com/nuxt-community/axios-module#options
  },

What is actually happening?

The number of displayed posts is 0
axios is trying to send a get request to http://localhost/posts instead of http://jsonplaceholder.typicode.com/posts

Additional comments?

I checked similar posts but nothing worked for me.

Thanks,
Billal Begueradj

This bug report is available on Nuxt community (#c109)

Document how to use

Hi, this looks promising and this got my attention because it is said being an application boilerplate.

I've tried to run in development, but I cannot see how to setup.

Is there a document about using it?

This question is available on Nuxt.js community (#c2)

Can no longer stage & push create-nuxt-app create projects that are new

Version

v0.4.0

Reproduction link

https://github.com/nuxt-community/create-nuxt-app

Steps to reproduce

Create nuxt project through terminal with npx create-nuxt-app and follow steps.

What is expected ?

When you stage project you should be able to stage and push to github repo.

What is actually happening?

You can not stage project at all, let alone push. Gitkraken and source tree both throw errors stating they can not find master head. There were no issues with this repo prior to the last commit in the last 20 hours.

This bug report is available on Nuxt community (#c64)

Wrong routes with /_nuxt/ prefix in sitemap

Version

v0.4.0

Reproduction link

https://alexanderbarton.de/sitemap.xml

Steps to reproduce

Just generate the sitemap with the config. :)

What is expected ?

Routes in sitemap without the /_nuxt/ prefix

What is actually happening?

Routes in sitemap with /_nuxt/ prefix

Additional comments?

This is my nuxt.config.js:

const pkg = require('./package');
const dotenv = require('dotenv');

dotenv.config();

module.exports = {
mode: 'universal',

/*
** Headers of the page
*/
head: {
title: pkg.name,
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: pkg.description }
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
]
},

/*
** Customize the progress-bar color
*/
loading: false,

/*
** Global CSS
*/
css: [
'~assets/scss/style.scss',
],

/*
** Plugins to load before mounting the App
*/
plugins: [
{src: '~plugins/bootstrap-native', ssr: false},
{src: '~plugins/tiny-slider', ssr: false}
],

/*
** Nuxt.js modules
*/
modules: [
'@nuxtjs/dotenv',
'@nuxtjs/axios',
'@nuxtjs/redirect-module',
['@nuxtjs/google-tag-manager', {
id: process.env.GTM_CONTAINER_ID
}],
['nuxt-i18n', {
strategy: 'prefix_except_default',
defaultLocale: 'de',
lazy: true,
langDir: 'translations/',
locales: [
{
code: 'de',
file: 'de.json'
}
],
}],
'@nuxtjs/sitemap'
],

axios: {
// proxyHeaders: false
},

redirect: [
{ from: '^/datenschutz-erklaerung', to: '/datenschutz' }
],

/*
** Build configuration
*/
build: {
extend(config) {
config.module.rules.push({
test: /bootstrap.native/,
use: {
loader: 'bootstrap.native-loader',
options: {
only: ['collapse', 'modal']
}
}
});
}
}
};

This bug report is available on Nuxt community (#c124)

Add github issue template

What problem does this feature solve?

When creating my first issue for this project I was not informed on how to do it properly.
Since there's no clean sign about using cmty.io.

So, for future contributors it would be very nice to add a template that states, that issues must be created on cmty.io.
Or they will be closed otherwise.

This feature request is available on Nuxt.js community (#c11)

Add function to nuxt.config that passes current instance to enable access to URL path

What problem does this feature solve?

I want to try to add a canonical URL declaration like so:

link: [
    { rel: 'canonical', href: `https://www.mysite.com/${this.$route.path}` },
],

but it doesn't seem that there's anyway to access this.$route from within nuxt.config

@manniL suggested in Discord that creating a function that passes the current instance would enable this.

Having a single place in the config to declare a canonical URL structure would prevent having to declare it on every individual page component.

What does the proposed changes look like?

Add a function to nuxt.config to allow access to the router (path).

Perhaps something like this.$instance.$route.path ?

This feature request is available on Nuxt community (#c111)

Unable to set cookie when process.server is true

What problem does this feature solve?

I have a serverMiddleware with a cookie parser with an internal API (with express).
// Export the server middleware

export default {
  path: '/api',
  handler: app
}

All work fine client side but when axios request is trigerred server side, axios doesn't add set-cookie. I have to do:

$axios.onResponse((resp) => {
        if(resp.headers['set-cookie'] && process.server){
            try{
                res.setHeader('Set-Cookie', [ resp.headers['set-cookie'] ])
            }catch(e) {}
        }
        return resp
    })

Why ?

This feature request is available on Nuxt community (#c131)

Nuxt-link-active is added as a class multiple times, even when it shouldn't really be

Version

v0.4.0

Reproduction link

http://178.128.44.34

Steps to reproduce

Go to workshops > traditional barbering and inspect element on the navigation section.

What is expected ?

Only that workshops tab is active

What is actually happening?

Its setting active on / when in a child view /workshops

Additional comments?

Any idea why this is?
My project structure follows just like in docs

This bug report is available on Nuxt community (#c52)

[edge] [nuxt] Error while initializing app DOMException

Version

2

Reproduction link

https://test.twist.moe/a/07-ghost/1

Steps to reproduce

  1. Go to the reproduction link
  2. Login with username: public and password: not
  3. Check Dev-Tools console

What is expected ?

The website should render fine and it should play the video.

What is actually happening?

It throws an error in the console.

Additional comments?

I tried to upgrade my nuxt version to 2.0 and I get the following error:

[nuxt] Error while initializing app DOMException: Failed to execute 'appendChild' on 'Node': This node type does not support this method.

I've updated the Nuxt version to nuxt-edge and I also updated other node modules version to work with nuxt-edge and webpack 4. I freshly installed the node_modules so I removed the folder and ran a fresh npm i. When I run the dev version of the build, it works fine. It only fails with the production build. All the unit test pass just like they did before I only started getting this error after the nuxt-edge and webpack 4 upgrade. The website works fine and everything builds without a error, there were no issues until I upgraded my project to nuxt-edge and started the nuxt server in production.

I can give you access to the repository the project is very easy to setup, the dev version of the project works without internet, it uses mock network requests for the API. Just ask and I can give you access.

This bug report is available on Nuxt community (#c61)

don't execute asyncData in the vue router beforeEach。

What problem does this feature solve?

cache !
i need realize forward refresh and backward do not refresh

now the asyncData is called every time before loading the component。

i need a configuration that sets the asyncData life cycle

thanks

This feature request is available on Nuxt community (#c54)

debug does not work

Thanks for the detailed example!

When trying to launch vscode with Hare Dev it just opens regular nuxt app.
Breakpoints do not work. debugger does not work to. They are just ignored.

2018-05-10 0 35 19

When trying to launch Hare Prod it fails with this exception:
2018-05-10 0 35 36

I am using:

Thanks!

This question is available on Nuxt.js community (#c6)

[docs] Example of how to use Koa's ctx.state within a vue

Or rather some more notes about how to make Koa/Nuxt collaborate outside of using an HTTP axios request.

I see we can use ctx.session and use have it passed back when we do this.$axios from a page asyncData/fetch method.

But mostly this is about hinting and/or leaving notes to show how one thing is done (or called) in this stack

  • "Flash" messages... to client side from a Koa route
  • How to send log messages (ctx.log.info from a router?)
  • how one route is protected compared to another
  • How is this different from using Nuxt's serverMiddleware
  • a model implementation sample, can be a plain js object like I've done for translation
  • finish up examples written in TypeScript with full async/await implementation and full use of Vuex
  • What else...?
This question is available on Nuxt.js community (#c4)

Integrate Jest for testing

What problem does this feature solve?

Suggest Integrates unit testing through Jest during the scaffolding process.
This template ignores totally software testing concepts as it does not suggest any tool to run unit tests, for example.

What does the proposed changes look like?

During the scaffolding process, Jest should be selectable to run unit tests.

This feature request is available on Nuxt community (#c106)

Refresh page on when clicking same page router link.

What problem does this feature solve?

Hello,

I have tried to fight with this issue couple of times for now.

I have a page running on default layout.
The page contains a form that will switch form with success page after filling.

Sometimes users would like to refresh the page by clicking the logo/router-link.

But when current page is active the router wont refresh the page.
How could i do that?

I have tried to add :key to everywhere.
I found this but not working => nuxt/nuxt#2285

What does the proposed changes look like?

I think it would be good to have a option for template. That by default wont allow refreshing/reloading and when re clicking it reloads.

This feature request is available on Nuxt community (#c119)

Nuxt.js: message: 'This page could not be found' (nuxt-i18n)

Version

v0.4.0

Reproduction link

https://nuxt-community.github.io/nuxt-i18n/setup.html

Steps to reproduce

In my Nuxt application, I installed the nuxt-i18n plugin as described on the official documentation.
I then modified nuxt.config.js as recommended:

{
  modules: [
    ['nuxt-i18n', {
      // Options
    }]
  ]
}

What is expected ?

I expected my Nuxt application to run as before.

What is actually happening?

I am getting this error (in the console of the Development tools):



app.js:247 [nuxt] Error while initializing app TypeError: parentVal.concat is not a function
    at mergeHook (commons.app.js:10224)
    at mergeField (commons.app.js:10485)
    at mergeOptions (commons.app.js:10476)
    at Vue._init (commons.app.js:13601)
    at new Vue (commons.app.js:13719)
    at _callee5$ (app.js:1109)
    at tryCatch (commons.app.js:4154)
    at Generator.invoke [as _invoke] (commons.app.js:4388)
    at Generator.prototype.(:3000/anonymous function) [as next] (http://localhost:3000/_nuxt/commons.app.js:4206:21)
    at asyncGeneratorStep (commons.app.js:33)

Additional comments?

If I remove nuxt-i18n from the nuxt.config.js file, my Nuxt application works fine.

This bug report is available on Nuxt community (#c97)

'debug' should be an explicit dependency

It seems (unless I've not looked in the right place) that debug is being used, but it isn't specified in the package dependencies.

It likely still works since several dependencies list it as a sub-dependency, but this means its version can't be controlled for.

This question is available on Nuxt.js community (#c9)

process.env available in generate: route function

What problem does this feature solve?

there is no access to the process.env inside the functions inside generate::route. This means that one must commit secrets to the github repo if they are needed to make a call during the generation of static pages. Not a real world example below but is relavant to my situation.

Like:

generate: {
    routes: function() {
      const secretURL = process.env.API_URL + '?API_KEY=' + process.env.API_KEY;   // process =.env here won't work here like in the 

      return axios.get(secretURL)
        .then(res => { 

What does the proposed changes look like?

  generate: {
    routes: function(contect or env) {

or just have generate run route functions somewhere where process.env is visible to the functions.

This feature request is available on Nuxt.js community (#c22)

Getting Error on yarn run generate

Hi there

When i run yarn run generate i get this error for each route :

Route: '/'
TypeError: Cannot read property 'headers' of undefined at Negotiator.languages

Any other command works fine but generate

This question is available on Nuxt.js community (#c1)

Manully setting up user token setToken()

What problem does this feature solve?

When a token is added manually Axios doesn't attach the token. As for my auth flow it is required.

What does the proposed changes look like?

When setting a token manually using $auth.setToken calling this.$auth.ctx.app.$axios.setHeader(this.options.tokenName, token) this would solves the manual login problem.

This feature request is available on Nuxt community (#c68)

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.