Code Monkey home page Code Monkey logo

nuxt-boilerplate's Introduction

nuxt-boilerplate

CircleCI

Nuxt.js Boilerplate用プロジェクトです。

Getting Started

以下の通りに実行して下さい。

developmentモードでアプリケーションが起動します。

ホットリロードが有効な状態です。

$ yarn install

$ yarn run dev

productionモードで実行する際は以下を実行して下さい。

$ yarn run build
$ yarn start

development、productionどちらのモードでもURLは下記になります。

http://127.0.0.1:3000

環境変数の登録

最低限以下の環境変数を登録して下さい。

direnv を利用すると良いでしょう。

export APP_URL=http://127.0.0.1:3000

デモ用の機能としてQiitaアカウントでログインを行い、Qiitaのプロフィール情報を取得する機能が実装されています。

これらを動作させる為には以下の手順でQiitaにアプリケーションを登録する必要があります。

1. 「設定」に遷移します

qiitaCreateApp1

2. 「アプリケーション」から「アプリケーションを登録する」に遷移します

qiitaCreateApp2

3. アプリケーションの情報を入力します

以下の2つは任意で構いません。

  • アプリケーションの名前
  • アプリケーションの説明

以下の2項目は必ず以下の値を入れて下さい。

qiitaCreateApp3

4. 「Client ID」と「Client Secret」をメモする

qiitaCreateApp4

それぞれの環境変数を以下のように登録して下さい。

export QIITA_CLIENT_ID=あなたのClient ID
export QIITA_CLIENT_SECRET=あなたのClient Secret

テストの実行

ユニットテスト

以下のコマンドでテストが実行されます。

yarn run test

コードカバレッジを出力する場合は以下のコマンドを実行して下さい。

yarn run test:coverage

カバレッジレポートは coverage に出力されます。

E2Eテスト

以下のコマンドを実行します。

テスト用のブラウザとしてGoogle Chromeが利用されますのでインストールされていない場合は動作しません。

yarn run test:e2e

またテストシナリオの中にはQiitaのアカウントでログインを行うシナリオがあります。

その為、以下の環境変数を設定しておく必要があります。

export TEST_QIITA_LOGIN_ID=あなたのQiitaアカウントのユーザーIDかメールアドレス
export TEST_QIITA_LOGIN_PASSWORD=あなたのQiitaアカウントのパスワード
export TEST_QIITA_PROFILE_IMAGE_URL=あなたのQiitaアカウントのプロフィール画像URL

Qiitaで二段階認証を設定している場合、テストに失敗するので事前に解除しておく必要があります。

Storybookの起動

yarn run storybook を実行します。

以下のURLでアクセスが可能です。

http://localhost:6006/

nuxt-boilerplate's People

Contributors

dependabot[bot] avatar keitakn 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

Watchers

 avatar  avatar

nuxt-boilerplate's Issues

npm packageを最新に更新する

Doneの定義

  • Nuxt.js を含めた各npm packageが最新に更新されていること

補足情報

Nuxtの更新に手間がかかりそうなので、ストーリーポイントは多め

CIの設定を行う

Doneの定義

  • CIが設定されコミットの度に動作するようになっている事

FATAL Cannot find module './src/server/bff'

概要

yarn build 実行時に以下のエラーが発生する。

FATAL Cannot find module './src/server/bff'

再現手順

  1. 最新のmasterブランチをgit cloneする
  2. yarn install を実行
  3. yarn build を実行

再現環境

  • Node.js v12.14.0
  • yarn --version1.21.1

このバグによって引き起こされる問題

アプリケーションが起動出来ない。

E2Eテストを導入する

Doneの定義

  • E2Eテストが導入され、1件テストケースが書かれている事

補足情報

全てのケースを網羅する必要はない。

コアな機能に絞り正常系のテストケースのみ網羅されていれば問題はない。

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.