This repo contains the source for the Dunelm pairing exercise. Here's some useful information to get you started.
- This is a monorepo containing the following services:
api
- a node service written using ExpressJS and responsible for retrieving and returning product dataaggregator
- a GraphQL node service written using ExpressJS and Apollo responsible for aggregating services (the api service)app
- a web application written using React
- You can find these services within the
packages
folder. - The architecture of these services is as follows.
+---------------+ +---------------+ +---------------+
| | | | | |
| | | | | |
| | http | | http | |
| app +------->+ aggregator +------->+ api |
| (React) | | (GraphQL) | | (Express) |
| | | | | |
| | | | | |
+---------------+ +---------------+ +---------------+
- If you don't have any experience with GraphQL please feel free to bypass the
aggregator
and call theapi
directly. You can find instructions on how to achieve this inpackages/app/src/App.jsx
.
- NodeJS 12 (https://nodejs.org/en/)
- Yarn 1 (https://classic.yarnpkg.com/en/docs/install)
- Git (https://git-scm.com/downloads)
- Run
yarn
to install all dependencies - Run
yarn start
to run all services - Run
yarn test
to execute tests - Navigate to a specific package (e.g. packages/app) and run
yarn test:watch
to execute tests which re-run after code changes.
Running the application will start all the services and open your browser at http://localhost:3000. All services are watched using webpack
or nodemon
respectively so whilst developing there should be no need to restart.
- Please approach the exercise in the same way you would when writing software commercially.
- Write tests if you feel they're required.
- Use all your tools (git etc.) appropriately.
- Feel free to google if you need additional information.
- Feel free to install any npm dependencies you need (
yarn add dependency-name
). - If you're unsure about anything during the exercise then please ask for clarification.
Epic:
As a Dunelm customer
I want to view all products
So that I can choose which ones to buy
Given I have accessed the Dunelm website
When I visit the home page
Then I must be presented with a list of all products
Notes:
-
A list of products can be found in
packages/api/products.json
. This should be treated as the data source for the api. -
Display the following properties for all products
- name
- description
- category
- color
- price
- inStock
Given I have accessed the Dunelm website
When I visit the home page
And I choose to view buyable products only
Then I must be presented with a list of products available to purchase
Notes: buyable products are those which have their inStock
property set to true
.
What are the top three things you could do to improve your solution?