- Clone the repo.
git clone https://github.com/azamanaza/react-robot-factory.git
- Install dependencies
npm i
- Run build. This builds both server and client app.
npm run build
- Run theapp
npm run start:server
From here you should be able to open the app at http://localhost:3000 on your browser.
Jest is configured to generate coverage under /coverage.
npm test
-
Redux Thunk over Redux Saga
Redux, by itself is very straightforward. Constant action-types, action creators that define actions, and reducers that determine the state, all in plain javascript.
Redux middlewears, are opinionated. I chose redux-thunk as a middlewear due to it's declarative approach with the least side-effects, which also makes use of native js.
- Lodash
The library provides a lot of type checks and gotchas on top of native js' functions. This helps filtering, mapping data a breeze and catches possible type-errors easier to catch.
- Express
A quick and portable service that can easily be setup on any node app.
The client app folder structure is designed modular, to provide better scalability. Modules contains it's own components, and redux related files, since actions and how they are consumed/bound to components.
A connection object is abstracted for a situation when we want to switch libraries (native fetch or whatever). This connection is used by api related services. These services can then map responses to designated formats. For future implementations, a cache layer would idealy implemented here.
The thunks then dispatch according to whatever responses the api services have. Actions dispatched will then be reduced to render error messages or silently and just show an empty app.