Giter VIP home page Giter VIP logo

dr.na_resultfront's Introduction

Dr.NA_ResultFront

name : Masakatsu Shibata

こちらは開発者向けのREADME になります。
アプリケーションの使用方法に関しては、README を参照してください。

■ 準備

ローカル開発マシンにNode 8.16.0またはNode 10.16.0以降のバージョンが必要

$ npx create-react-app my-app
$ cd my-app

不要なファイルの削除はここでは省略。

■ インストール

  • Sass

    $ npm i -D node-sass
  • Saas をモジュールする

    • ejectせずに、webpack, babel, estlintなどの設定を上書きするツールと、css moduleを有効にするプラグインを使って実現

      $ npm i -D react-app-rewired codebandits/react-app-rewire-css-modules
    • プラグインがsass-loaderとnode-sassに依存してるのでこれも追加

      $ npm i -D sass-loader node-sass 
  • ルーティング

    $ npm i -S react-router-dom
  • Redux

    $ npm i -S Redux
  • React + Redux

    $ npm i -S react-redux
  • Redux 非同期

    $ npm i -S redux-thunk
  • Redux 開発用ログ

    $ npm i -S redux-logger
  • REST API

    $ npm i -S axios
  • GitHub Pages

    $ npm i -D gh-pages

■ 設定

  • Saas Module

    • config-overrides.js を作って、設定を記述

      $ touch config-overrides.js
    • package.json のscriptsを変更

      {
        "scripts": {
          "start": "react-app-rewired start",
          "build": "react-app-rewired build",
          "test": "react-app-rewired test --env=jsdom"
        }
      }
    • css moduleを有効にしたいsassファイルの拡張子を .sassから .module.sassに変える

      import style from 'style.module.sass'
  • 環境変数

  • 絶対パスでimport する

    • .env に記述

      NODE_PATH=.
    • VSCode の補完 【 jsconfig.json

      $ touch jsconfig.json
  • ポート番号指定

    • .env に記述

      PORT=ポート番号

■ ディレクトリ構成

  • src/
    • components/ => JSX を扱っている
      • layouts => レイアウトのみを行うJSX
      • pages => 個々のページのJSX
      • ui => UI部品のJSX
    • config/ => components 内で使用する設定(定数など)
    • containers => Reduxのstoreに格納されているデータをComponentに紐付ける
    • images/ => 画像ファイル等
    • redux/ => Redux
      • reducers => Reducers
    • stylesheet => Sass(CSS)ファイル

■ 運用

  • 開発モードで実行

    $ npm run start
  • テスト

    $ npm run test
  • 本番用にビルド

    $ npm run build
  • GitHub Pages

    $ npm run deploy

©2020 Dr.NA_ResultFront

dr.na_resultfront's People

Contributors

s-masakatsu avatar

Watchers

James Cloos avatar

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.