/taxclear-ui

Taxonomic Clearing House React UI

Primary LanguageJavaScript

Taxonomic Clearing House UI

UI driven by the taxclear-ws API using React and the following core technologies:

Tech Description Learn More
React Fast, composable client-side components. Pluralsight Course
Redux Enforces unidirectional data flows and immutable, hot reloadable store. Supports time-travel debugging. Lean alternative to Facebook's Flux. Getting Started with Redux, Building React Applications with Idiomatic Redux, Pluralsight Course
React Router A complete routing library for React v3 docs
Babel Compiles ES6 to ES5. Enjoy the new version of JavaScript today. ES6 REPL, ES6 vs ES5, ES6 Katas, Pluralsight course
Webpack2 Bundles npm packages and our JS into a single file. Includes hot reloading via react-transform-hmr. Quick Webpack How-to Pluralsight Course
Browsersync Lightweight development HTTP server that supports synchronized testing and debugging on multiple devices. Intro vid
Jest Automated tests with built-in expect assertions and Enzyme for DOM testing without a browser using Node. Pluralsight Course
TrackJS JavaScript error tracking. Free trial
ESLint Lint JS. Reports syntax and style issues. Using eslint-plugin-react for additional React specific linting rules.
SASS Compiled CSS styles with variables, functions, and more. Pluralsight Course
PostCSS Transform styles with JS plugins. Used to autoprefix CSS
Editor Config Enforce consistent editor settings (spaces vs tabs, etc). IDE Plugins
npm Scripts Glues all this together in a handy automated build. Pluralsight course, Why not Gulp?

Running the webapp

Requirements

  1. Node 6.0 or greater
  2. yarn
  3. Disable safe write in your editor to assure hot reloading works properly.

Install and start dev

yarn install npm start -s This will run the automated build process, start up a webserver, and open the application in your default browser. When doing development with this kit, this command will continue watching all your files. Every time you hit save the code is rebuilt, linting runs, and tests run automatically.

Note: The -s flag is optional. It enables silent mode which suppresses unnecessary messages during the build.

Build and deploy to production

npm run build

This will build the project for production. It does the following:

  • Minifies all JS
  • Sets NODE_ENV to prod so that React is built in production mode
  • Places the resulting built project files into /dist. (This is the folder you'll expose to the world).

Development guidelines

Project structure

Follow a fractal project structure underneath the primary routes that allows webpack's code splitting to be applied.

├── .babelrc                    # Configures Babel
├── .editorconfig               # Configures editor rules
├── .eslintrc                   # Configures ESLint
├── .gitignore                  # Tells git which files to ignore
├── .istanbul.yml               # Configure istanbul code coverage
├── .npmrc                      # Configures npm to save exact by default
├── .travis.yml                 # 
├── appveyor.yml                # 
├── package.json                # yarn/npm Dependencies
├── yarn.lock                   # yarn state, don't touch
├── webpack.config.dev.js       # Configures webpack for development builds
├── webpack.config.prod.js      # Configures webpack for production builds
├── dist                        # Folder where the build script places the built app. Use this in prod.
├── src                         # Application source code
│   ├── index.html              # Main HTML page container for app
│   ├── index.js                # Application bootstrap and rendering
│   ├── components              # Global Reusable Presentational Components
│   ├── containers              # Global Reusable Container Components
│   ├── layouts                 # Components that dictate major page structure
│   │   └── Layout.js           # CoreLayout which receives children for each route
│   │   └── Layout.scss         # Styles related to the CoreLayout
│   │   └── index.js            # Main file for layout
│   ├── routes                  # Main route definitions and async split points
│   │   ├── routes.js           # Bootstrap main application routes with store
│   │   ├── Home                # Fractal route
│   │   │   ├── index.js        # Route definitions and async split points
│   │   │   ├── assets          # Assets required to render components
│   │   │   ├── components      # Presentational React Components
│   │   │   └── routes **       # Fractal sub-routes (** optional)
│   │   ├── About               # Fractal route
│   │   │   ├── index.js        # Route definitions and async split points
│   │   │   ├── assets          # Assets required to render components
│   │   │   ├── components      # Presentational React Components
│   │   │   └── routes **       # Fractal sub-routes (** optional)
│   │   └── Name                # Fractal route
│   │       ├── index.js        # Counter route definition
│   │       ├── container       # Connect components to actions and store
│   │       ├── actions         # Collections of reducers/constants/actions
│   │       └── routes **       # Fractal sub-routes (** optional)
│   ├── store                   # Redux-specific pieces
│   │   ├── createStore.js      # Create and instrument redux store
│   │   └── reducers.js         # Reducer registry and injection
│   ├── styles                  # Application-wide styles, typically written in Sass
│   └── utils                   # Plain old JS objects. No framework specific code here.
└── tools                       # Node scripts that run build related tools
    ├── analyzeBundle.js        # Analyzes the webpack bundle
    ├── build.js                # Runs the production build
    ├── chalkConfig.js          # Centralized configuration for chalk (adds color to console statements)
    ├── distServer.js           # Starts webserver and opens final built app that's in dist in your default browser
    ├── nodeVersionCheck.js     # Confirm supported Node version is installed
    ├── srcServer.js            # Starts dev webserver with hot reloading and opens your app in your default browser
    ├── startMessage.js         # Display message when development build starts
    └── testCli.js              #