GithubHelp home page GithubHelp logo

sylar / project-viper Goto Github PK

View Code? Open in Web Editor NEW
3.0 0.0 0.0 674 KB

Yet another react boilerplate... with a twist.

License: MIT License

JavaScript 98.71% HTML 0.86% CSS 0.43%
react webpack reactotron seed tachyons css-modules redux redux-saga react-router

project-viper's Introduction

Project viper.

This is a seed for React projects that uses most of the bleeding edge tools and techniques. This seed offers the opportunity to see the latest packages and integration of various tools and techniques that revolve around the React and Webpack ecosystems.

Prerequisites.

I recommend using yarn, but the classic npm will do just fine. Reactotron, in any flavour, must be running before the dev server is ran, check the instructions.

How to use.

  1. clone the project somewhere.
> git clone https://github.com/andreiconstantinescu/project-viper
  1. Make it yours.
> rm -rf .git && git init
  1. move to the previously cloned location and install dependencies.
> cd project-viper
> yarn
  1. start reactotron cli (if you have installed it).
> reactotron

or open the App.

  1. start the dev server.
> yarn run dev
  1. open localhost:3000 in your browser.

  2. Head over to an editor and start hacking.

Project structure.

.
├── client
│   ├── Root.js
│   ├── api
│   │   ├── common.js
│   │   ├── foo.js
│   │   └── index.js
│   ├── assets
│   │   ├── images
│   │   │   ├── congruent_outline.png
│   │   │   └── crossword.png
│   │   └── template.html
│   ├── components
│   │   ├── MainLayout
│   │   │   ├── index.js
│   │   │   └── style.css
│   │   ├── RandomNumber
│   │   │   ├── index.js
│   │   │   └── style.css
│   │   ├── RoundImage
│   │   │   └── index.js
│   │   ├── WelcomeNote
│   │   │   └── index.js
│   │   └── index.js
│   ├── config.js
│   ├── containers
│   │   └── App
│   │       └── index.js
│   ├── index.js
│   ├── reactotron.config.js
│   ├── redux
│   │   ├── Message.redux.js
│   │   ├── RandomNumber.redux.js
│   │   ├── StarWars.redux.js
│   │   ├── common.redux.js
│   │   ├── rootReducer.js
│   │   └── store.js
│   ├── referenciallyEqualRootRoute.js
│   ├── routes.js
│   └── sagas
│       ├── actions.js
│       ├── index.js
│       └── starWarsSaga.js
├── config
│   ├── webpack
│   │   ├── webpack.config.dev.js
│   │   └── webpack.config.prod.js
│   └── webpack.config.js
├── license
├── package.json
├── postcss.config.js
├── readme.md
└── server
    ├── index.js
    └── routers
        ├── foo.js
        └── index.js

Each component can have it's own .css file that is required in the component's exported .js file. Because of using css modules the style is scoped in the component and there are no global selectors exposed.

This project uses tachyons, being the only global classes available throughout the project. For overriding variables, at the moment, just rewrite them in the .css file for each component.

Contents of the assets folder are linked on dev env and optimised when building for production.

This seed uses Redux for state management along with the HMR for reducers.

Run for production.

Build the assets and serve them locally.

> yarn start

Build the assets and serve them in a prodlike env, using node-foreman.

> yarn run serve

Just build.

> yarn run build

The public folder will appear in the project root having the following structure.

public/
├── assets
│   └── images
│       ├── 1Zaf1.png
│       └── TQJIR.png
├── css
│   ├── style.css
│   ├── style.css.map
│   └── tachyons.css
├── index.html
└── js
    ├── 0.js
    ├── 0.js.map
    ├── 1.js
    ├── 1.js.map
    ├── main.js
    ├── main.js.map
    ├── vendor.bundle.js
    └── vendor.bundle.js.map

Seen a problem?

If you find a better way to do something or simply want to add a new feature, just PR. Every little bit of help is welcomed 😀

Other features.

  • tree shaking.
  • css modules.
  • tachyons.
  • hot module realoading (while maintaining the state).
  • webpack2.
  • webpack dashboard.
  • redux.
  • reactotron.
  • code splitting.
  • production ready.
  • react-router.
  • redux-saga.

TO DO.

  • Add redux.
  • Discard unused css classes.
  • Testing.
  • SSR.
  • Create wiki.
  • Add serve for production build testing.
  • Create NPM package for auto-scaffold.
  • Reactotron API monitor.
  • Add redux-saga.

License.

MIT.

project-viper's People

Contributors

sylar avatar

Stargazers

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