Code Monkey home page Code Monkey logo

boilerplate's Introduction

Boilerplate

Build Status

This is a boilerplate for React apps. It uses React and Redux with Redux Observables on the client side and is Express on the server. The application is built using Webpack, and it has Hot Module Replacement to allow changes without refreshing in development. For styling, the app uses CSS Modules with Sass.

Usage

First off, clone the repository.

git clone https://github.com/MrPickles/boilerplate
cd boilerplate/
npm install

You then want to configure environment variables for the app. The app uses dotenv to set up environment variables, so you should put any environment variables needed at runtime in the .env file. There is a .env.example file provided for guidance.

cp .env.example .env

Running a production build

To run the server in production, you'll want to build the bundled JavaScript and CSS that will be used in the client. Then you can start the server. There is a build and prod script to build the app and start the server in production, respectively. Alternatively, you can just run npm start.

npm run build
npm run prod
# or
npm start

Running a development build

When developing, there is a development build that has development-specific advantages over the production build, such as automatic module replacement, server restarting, and source maps for debugging. To use the development build, run the webpack script in the background or in a separate terminal to have Webpack compile the development build and watch for any changes in the code. The assets will be served by webpack-dev-server. Then run the development server.

npm run webpack # run this in the background or in a separate terminal
npm run dev

Linting and Testing

This repository uses ESLint and Jest for linting and testing, respectively. To lint the code base, simply run the lint script. You can change the lint rules in .eslintrc.json based on your style preferences.

npm run lint

All tests must have .spec.js as its file extension. The testing script will search for all files with this extension and treat them as tests.

npm run test

boilerplate's People

Contributors

mrpickles avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

boilerplate's Issues

Write test for the dynamic imports

The follow directories use require.context to dynamically fetch modules.

  • app/actions
  • app/components
  • app/containers
  • app/epics
  • app/middleware
  • app/reducers

The regular expressions used to get the modules should be exported and tested.

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.