Display customer’s available products
As a customer, I want to select the products that are available to me, based on the location of my home.
Build & Run
Catalogue Service
First start up the Catalogue Service.
- Change into the
catalogue-service
directory - Install dependencies with
npm install
- Start the service with
npm start
Product Selection Client
In another terminal, start the client.
- Change into the project root directory
- Install dependencies with
npm install
- Start the client with
npm start
- If it does not open automatically, open http://localhost:3000 in a web browser
- Change location by editing the
customerID
cookie
Testing
Simply run npm test
in either the project root directory or in the catalogue-service
directory.
Future Improvements
Catalogue Service
- Contract testing to ensure that the service complies with the agreed-upon schema
- Setup Docker to run this and any future services
- GraphQL would be nice, probably overkill though
Product Selection Client
- Behavioural tests using CasperJS would automate testing of user journeys
- Do something about Unhandled Rejection Errors
- Rejected promises dispatch
GET_LOCATIONID_REJECTED
orFETCH_PRODUCTS_REJECTED
actions which update the state with the given error, but the actual promise rejection is not handled, leading to errors in the developer console - Generally better error handling when making service calls would be good, including showing something to the user
- Rejected promises dispatch
- Dynamically generate product lists based off category, rather than having hard-coded News and Sports lists