Skip to content

Latest commit

 

History

History
59 lines (48 loc) · 1.97 KB

README.md

File metadata and controls

59 lines (48 loc) · 1.97 KB

Robot Factory App

A small application that features react, react-redux, redux, redux-thunk.

Installation

  1. Clone the repo.
git clone https://github.com/azamanaza/react-robot-factory.git
  1. Install dependencies
npm i
  1. Run build. This builds both server and client app.
npm run build
  1. Run theapp
npm run start:server

From here you should be able to open the app at http://localhost:3000 on your browser.

Test

Jest is configured to generate coverage under /coverage.

npm test

Architecture and Design

Tech choices

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

Client App ( Robot Factory )

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.