Giter Site home page Giter Site logo

armour / express-webpack-react-redux-typescript-boilerplate Goto Github PK

View Code? Open in Web Editor NEW
164.0 8.0 45.0 16.71 MB

:tada: A full-stack boilerplate that using express with webpack, react and typescirpt!

Home Page: https://express-react-typescript.herokuapp.com/

License: MIT License

JavaScript 20.61% CSS 4.00% TypeScript 71.34% HTML 2.76% Dockerfile 0.28% HCL 1.00%
express react react-router react-redux react-hot-reload yarn eslint tslint typescript stylelint babel jest es6 heroku docker materialize-css webpack circleci react-saga github-actions

express-webpack-react-redux-typescript-boilerplate's Introduction

express-webpack-react-redux-typescript-boilerplate

Dependency Status CircleCI Appveyor Coverage Status PRs Welcome Tested with jest License: MIT Template from jarvis

Example

  • Demo Page - contains classic todo list, async server call, and 404 page with random moe images. (Support multi-language, currently English, Chinese, and Japanese)

    Home Page

    React Page

    404 Page

Stack

How to run the sample code

Prerequisite

  • yarn or npm
  • (optional) docker with docker-compose

Quickest way

The easiest way to run the example project is to use docker-compose:

docker-compose up --build

that's it :)

You can also follow instructions below if you want to customize it.

Install project dependencies

Go to project root directory:

yarn install

If you find permission problem when trying to install yarn globally, check this out.

Setup database and session store

You can either

  • setup postgresql and redis using docker images:
docker-compose up -d postgres redis

or

  • maintain it by yourself, if so, make sure you set the right config in backend/config.json.

Build & Run

On development (with hot reload):

yarn dev

On production (with terser and other optimazitions):

yarn prod

Profile assets bundle

Thanks to webpack-bundle-analyzer, assets bundle can be analyzed and optimized through DLL Plugin.

yarn profile

Run test

yarn test

Code coverage

yarn coverage

Deployment

Every push on master branch will trigger Github Actions for heroku deployment.

Contributing

See CONTRIBUTING.md

License

MIT License

express-webpack-react-redux-typescript-boilerplate's People

Contributors

armour avatar dependabot-support avatar dependabot[bot] avatar felipegtx avatar pichotm avatar takashil avatar zzwdbs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

express-webpack-react-redux-typescript-boilerplate's Issues

Insecure dependency: event-stream 3.3.6

We noticed this repo pulls in event-stream at version 3.3.6 as a dependency. This version has had malicious code injected into it (see dominictarr/event-stream#116 for more information) and we recommend that you either upgrade to 4.0.1 or downgrade to 3.3.4 as soon as possible. You can do this by setting a Yarn resolution in your package.json.

(Dependabot can't generate downgrade PRs for sub-dependencies at the moment, but we wanted to warn you about the issue all the same.)

Libpng error

StackTrace:

ERROR in ./frontend/src/image/parallax2.jpg
Module build failed: Error: dyld: Library not loaded: /usr/local/opt/libpng/lib/libpng16.16.dylib
  Referenced from: /Users/armour/Express-Webpack-React-Typescript-HMR-Boilerplate/node_modules/mozjpeg/vendor/cjpeg
  Reason: image not found

    at Promise.all.then.arr (/Users/armour/Express-Webpack-React-Typescript-HMR-Boilerplate/node_modules/execa/index.js:201:11)
    at process._tickDomainCallback (internal/process/next_tick.js:135:7)
 @ ./~/css-loader!./~/postcss-loader!./~/sass-loader/lib/loader.js!./frontend/src/sass/index.scss 6:109041-109074
 @ ./frontend/src/sass/index.scss
 @ ./frontend/src/App.tsx
 @ ./frontend/src/index.tsx
 @ multi react-hot-loader/patch webpack-hot-middleware/client ./frontend/src/index

lazy error

Error: Objects are not valid as a React child (found: object with keys {$$typeof, _ctor, _status, _result}). If you meant to render a collection of children, use an array instead.

Better immutable.js support

I'm submitting a

  • Bug report
  • Feature request
  • Performance issue
  • Regression (a behavior that used to work and stopped working in a new release)
  • Documentation issue or request
  • Other... Please describe:

Current behavior

Currently, the global state is not an Immutable Map or Record, only childrens are

Expected behavior

The global state should use Immutable.js and combine with redux-immutable

What is the motivation / use case for changing the behavior?

For better reducers!

Blocked

Bug in close dropdown

I'm submitting a bug report

Current behavior

when close the dropdown by clicking other area(it wouldn't happen if click on the dropdown button to close it), there would be an unexpected border on the dropdown button.

image

Expected behavior

image

Minimal reproduction of the problem with instructions

  • click the dropdown button to open it
  • click other area to close the dropdown list

Yarn error: event-stream

I'm submitting a

Bug Report

Temporary fix

As per this issue, I've added the following to the package.json file and now everything works. Maybe a PR with that is necessary?

"resolutions": {
    "**/event-stream": "^4.0.1"
  }

Current behavior

By running yarn on a fresh copy of this repo I get the following error: error https://registry.yarnpkg.com/event-stream/-/event-stream-3.3.6.tgz: Extracting tar content of undefined failed, the file appears to be corrupt: "Unexpected end of data"
image

Expected behavior

Yarn should run without any problems.

Minimal reproduction of the problem with instructions

  • Run yarn on a fresh copy of the main branch

What is the motivation / use case for changing the behavior

  • Using the boilerplate code.

Environment

  • any.

React-hot-loader v4 not working

I'm submitting a

Feature request

Current behavior

If upgrade react-hot-loader from v3 to v4, it will trigger a full-page reload instead of HMR

Expected behavior

Use react-hot-loader v4 without full-page reload

What is the motivation / use case for changing the behavior

Keep it up-to-date

use React Router 4

currently there is no typescript declaration files for react-router 4?
will upgrade my code to use react-router 4 later.

Add i18n support

I'm submitting a

feature request

Current behavior

no i18n support

Expected behavior

at least support en, zh and jp

What is the motivation / use case for changing the behavior

for easily adapting to specific local languages and cultures

References

react-i18next

Enable sourceMap in devMode without FOUC

I'm submitting a

  • Bug report
  • Feature request
  • Performance issue
  • Regression (a behavior that used to work and stopped working in a new release)
  • Documentation issue or request
  • Other... Please describe:

Current behavior

Enable css-loader sourceMap option will cause FOUC.

Expected behavior

No FOUC when sourceMap enabled for css-loader.

Minimal reproduction of the problem with instructions

In webpack.config.base.babel.js:

...
      // Use a list of loaders to load css files
      {
        test: /\.css$/,
        use: [
          devMode ? 'style-loader' : MiniCssExtractPlugin.loader,
          { loader: 'css-loader', options: { sourceMap: !devMode, importLoaders: 1 } }, // TODO: enable sourceMap in devMode without FOUC
          { loader: 'postcss-loader', options: { sourceMap: true, plugins: () => [postcssImport, postcssPresetEnv, cssnano] } },
        ],
      },
      // Use a list of loaders to load scss files
      {
        test: /\.scss$/,
        use: [
          devMode ? 'style-loader' : MiniCssExtractPlugin.loader,
          { loader: 'css-loader', options: { sourceMap: !devMode, importLoaders: 2 } }, // TODO: enable sourceMap in devMode without FOUC
          { loader: 'postcss-loader', options: { sourceMap: true, plugins: () => [postcssImport, postcssPresetEnv, cssnano] } },
          { loader: 'sass-loader', options: { sourceMap: true } },
        ],
      },
...

simply change !devMode to true will cause the FOUC.

What is the motivation / use case for changing the behavior?

SourceMap support in development.

Coverage support for typescript

Now the coverage line number seems to be matching compiled js file, properly need to find a way to remap it using sourcemap?

Add tests and mocks for backend

I'm submitting a

  • Bug report
  • Feature request
  • Performance issue
  • Regression (a behavior that used to work and stopped working in a new release)
  • Documentation issue or request
  • Other... Please describe:

Current behavior

No backend tests

Expected behavior

Add backend tests with mocks

What is the motivation / use case for changing the behavior?

Of course we need it. 😀

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.