Skip to content

Frontend part for our catastrophe aid tool. Written in JavaScript (React), HTML and CSS.

License

Notifications You must be signed in to change notification settings

caTUstrophy/frontend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Dependency Status Coverage Status

CaTUstrophy frontend

Frontend part for our catastrophe aid tool.

Setup

We assume you run a reasonable sort of Linux or OS X with node.js 6.x (use nvm!) and npm 3.x.

  1. Clone this repo

    git clone https://github.com/caTUstrophy/frontend.git

  2. Change into folder

    cd frontend

  3. Install packages

    npm i

  4. Configure your environment. Start by cloning the example configuration and adapt to your needs.

    cp environment.js.example environment.js

  5. (Optional: Fire up the backend)

  6. Start development server

    npm start

  7. Open spawned website: http://localhost:3000/

Changes you make to the code are applied immediately and hot-loaded. Hit CTRL+H to show/hide the Redux DevTools, CTRL+M to move them around and CTRL+SHIFT+M to switch between the available monitors:

Technology overview

All new code should be written in ES7/JSX. And embrace the ecosystem!

Core technologies

Implied remarkable packages

Tooling

  • webpack (module bundling etc.)
  • babel (transpiler)
  • express (development server)
  • obviously relies on node.js / npm

Design

CSS

We use Foundation Sites. Write SASS, only. Use their mixins et cetera wherever possible. Don't use prefixes, we have autoprefixer set up (aggressively i.e. > 1%).

We should eventually use extract-text-webpack-plugin to generate a CSS file, but for now it doesn't seem strictly necessary.

Testing

  • Write tests for everything.
  • Put your tests in test/.
    • Put them in a matching subfolder, replicating the project structure. (E.g. forms located in forms/ are to be tested in test/forms/)
  • Start the tests with npm test (calls mocha-webpack --webpack-config webpack.config.js --recursive test internally)
  • Configure your IDE to run tests while you develop.

Tooling

Code coverage

Code coverage is assessed with nyc which is built on top of istanbul. It is monitored and published with coveralls. You can see the current details at coveralls.io or with this fancy badge: Coverage Status

Deploying

Run npm run-script bundle to create a webpack build in dist/. The command internally runs

webpack -p --progress --config webpack.production.config.js

Read webpack.production.config.js for the details.

Currently there is no HTML generated, an index.html should be derived manually.

There are no CSS files for now, it is inlined with the JS sources by webpack.

Resources to familiarize yourself with the technologies

About

Frontend part for our catastrophe aid tool. Written in JavaScript (React), HTML and CSS.

Resources

License

Stars

Watchers

Forks

Packages

No packages published