GithubHelp home page GithubHelp logo

anthrax3 / converter-react Goto Github PK

View Code? Open in Web Editor NEW

This project forked from formidablelabs/converter-react

0.0 1.0 0.0 184 KB

Sample React + Flux app w/ server-side rendering / data bootstrap and more!

Home Page: http://converter-react.formidablelabs.com/

JavaScript 93.06% CSS 2.69% HTML 4.26%

converter-react's Introduction

Converter - React

Build Status Appveyor Status Coverage Status

A simple app written using React and CommonJS, built with Webpack. Based on full-stack-testing.formidablelabs.com/app/ from our "Full. Stack. Testing" training project.

Overview

The converter app has a simple Express-based REST backend that serves string conversions. The frontend app is a React app, crafted with the following:

See the app hard at work!

Notes

Size

To test out how optimized the build is, here are some useful curl commands:

# Run production build
$ npm run build

# Minified size
$ wc -c dist/js/*.js
  286748 dist/js/bundle.d3749f460563cd1b0884.js

# Minified gzipped size
$ gzip -c dist/js/*.js | wc -c
   77748

Development

For a deeper dive, see: DEVELOPMENT

Dev Mode

Install, setup.

$ npm install           # Install dependencies
$ npm run install-dev   # Install dev. environment (selenium, etc.).

Run the watchers, dev and source maps servers for the real production build:

$ npm run prod

Run the watchers and the Webpack dev server:

$ npm run dev

Run the watchers and the Webpack dev server w/ React hot loader:

$ npm run hot

Ports various servers run on:

  • 2992: Webpack dev server for dev. server.
  • 3000: Development application server.
  • 3001: Sourcemaps static server / test (in-browser) server.
  • 3010: Webpack dev server for ephemeral client Karma tests run one-off with full build.
  • 3020: Ephemeral app server for REST server tests. Override via TEST_REST_PORT environment variable.
  • 3030: Ephemeral app server for functional tests. Override via TEST_FUNC_PORT environment variable.
  • 3031: Webpack dev server for ephemeral functional tests run one-off with full build. Override via TEST_FUNC_WDS_PORT environment variable.

URLS to test things out:

  • 127.0.0.1:3000/: Server-side bootstrap, then JS.
  • 127.0.0.1:3000/?__mode=noss: Pure JS.
  • 127.0.0.1:3000/?__mode=nojs: Pure server-side. Note that while some links may work (e.g. clicking on a note title in list), many things do not since there are absolutely no JS libraries. This is intended to just be a small demo of SEO / "crawlable" content. This mode is incompatible with the React hot loader mode because in hot mode JS is used to load CSS. If you want to run a development server while using nojs, use npm run dev.

Bootstrapped Data

As a development helper, we allow a querystring injection of data to bootstrap the application off of. Normally, you wouldn't allow users to add this, and instead would choose how to best bootstrap your app.

Production

Install, setup.

$ npm install --production
$ npm run build

Run the server.

$ NODE_ENV=production node server/index.js

Contributing

Please see CONTRIBUTING

converter-react's People

Contributors

alexlande avatar baer avatar kenwheeler avatar mukundgoel avatar ryan-roemer avatar

Watchers

 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.