The Number26 ATM challenge
A small web based prototype of an ATM.
It is built on JavaScript using React and Redux. It is developed with webpack and postcss.
- Clone this repo using
git clone git@github.com:agudulin/atm.git
- Run
npm install
to install dependencies - Run
npm start
to see the app athttp://localhost:8080
- Run
npm run lint
to lint the codebase with standradjs - Run
npm test
to run specs.
├── server.js // webpack dev server with hot reloading
├── webpack.config.js // config file for webpack
└── src
├── app // main SPA container
│ ├── index.css
│ └── index.js
├── common
│ ├── general // general redux state
│ │ ├── actions.js
│ │ ├── reducer.js // initial state description and state's reducers
│ │ └── steps.js // reusable string constants
│ └── reducer.js // combination of all possible reducers
├── components // small parts of the app
│ ├── error-pane
│ ├── footer
│ ├── header
│ └── screens
│ ├── enter-pin
│ ├── goodbye
│ ├── withdrawal
│ └── withdrawal-other-amount
└── index.js // entry point of the app, mounts the app to DOM
- ATM works as a state machine. That's why I decided to use React for this application: it thinks of UIs as simple state machines.
- Redux helps to operate with the state using simple pure functions.
- All components except one (
<App />
) are stateless.
- Add a production config with hot reloading disabled, minification enabled, and styles exctracted.
- Use dumb-bem to produce atomic reusable components.
- Use immutable to be sure the state is an immutable structure.
MIT © Alexander Gudulin