Giter Site home page Giter Site logo

react-quickstart's Introduction

react-quickstart

A minimal React project template which combines:

  • react-router-component to provide HTML5 History routing and navigation

  • react-async to create "asynchronous" React components

  • express to serve pre-rendered React components, assets and provide API

  • browserify to provide module system for a browser

  • npm to install and manage server-side and client-side dependencies

Every "page" in the application is pre-rendered on server so the user can see the UI before the client code is shipped to a browser. After that application starts functioning like a single page application, navigating between "pages" without reloads.

Project structure

Project structure is really minimal, you'd probably like to customize it for your specific needs and taste:

.
├── assets
├── client.js
├── package.json
└── server.js

Directory assets is served under /assets URL, client.js module contains UI code while server.js — HTTP server which serves pre-rendered React components, assets and provide a stub for a REST API.

Development workflow

After cloning a git repo, run:

% npm install

to install all needed dependencies and then:

% npm run start

to start a development server.

Now you can start edit the source code — on changes, server will be reloaded and client code bundle will be rebuilt.

Going "production"

To build an optimized bundle of client code run:

% npm run build

which will produce assets/bundle.js build, then:

% npm run start-prod

to start server in "production" mode (no source code watching and serving optmized bundle to browser).

react-quickstart's People

Contributors

andreypopp avatar paramaggarwal avatar pieterv avatar

Stargazers

 avatar

Watchers

 avatar  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.