GithubHelp home page GithubHelp logo

pos-react's Introduction

React/Redux-Offline point of sale application

As a proof of concept this application will function as a progressive offline first app.

How does it work?

  • Service worker (production build only) will cache all assets on first load and prioritise the use of them on subsequent page loads
  • Product details and stock levels from the API are stored using rt2zz/redux-persist and re-hydrated if they can't be collected
  • redux-offline/redux-offline monitors the online/offline status of the app and will queue up any requests that fail to be processed once the app goes back online

Installation:

  1. git clone https://github.com/chriscornford/pos-react.git
  2. cd pos-react && yarn
  3. Ensure to add correct domain depending on your setup to API_URL inside config.js
  4. Run development build yarn start and navigate to given local URL
Running production build
  1. Follow installation steps
  2. yarn build
  3. yarn add global serve
  4. serve -s build

Potential issues to consider:

  • Item stock levels aren't real time, could run into issues if a product goes out of stock (using sockets would help solve this).
  • Product API won't be able to handle pulling down thousands of products at a time.
  • On refresh cart overrides its contents with the default state, this would cause issues as stock still appears to have decreased (redux-persist is being greedy and persisting changes to stock levels).
  • If the API comes back with an error due to an item being out of stock the app doesn't handle it.

As this is a rough prototype here are the ways I would improve it:

  • Add spec tests
  • Ensure all components and containers have correct prop types
  • Use immutable.js and reselect to clean up nasty code
  • Use sockets to get more accurate real time data!!
  • Use Eslint to ensure consistent code

References:

This project was bootstrapped with Create React App, which provides a simple way to start React projects with no build configuration needed.

pos-react's People

Contributors

chriscornford avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

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.