This is an application of showing available products on the warehouse and registering user sales
- Show the list of available products
- Show what articles are included in the product
- Create Sales list
- Sales items are sorted by creation date descending
- Calculate products amount based on all available articles
- add possibility to buy (register sale) a product => update sales list
- decrease the amount of available articles when products are sold
- show notification to user on successful sale
- still product in the list if he's unavailable to sale, but prohibit its sale
- not to be able to buy more products that are available in the list
- Cover components with unit tests
- Business and tech documentation
- Meta tags for better SEO
- prettier for code formatting
- Responsive Design
yarn install
yarn start
- open
http://localhost:3000
yarn run test
- Framework: React
- Language: TypeScript
- Styles: scss modules for styles encapsulation In real world scenario I'd choose either Material-UI components library, or Tailwind with Headless-UI. But in sake of simplicity and to show the way I manage css, in this solution I'll focus in own css implementation
- add "Husky" and "Commitizen" dependencies for ensuring PR process
- add Jenkinsfile with pipeline for CI/CD
- Cypress e2e tests to ensure complete user flows
- Store approach, decrease the amount of request to server
- Decrease bundle size: separation of devDependencies
- static files are stored in
src
folder that's managed by webpack optimization - swap loading of fonts
- disable user click
Sell
button twice, while the request is being processed by the server - Send second request to server for
products
,articles
andsales
if first one has failed - Data caching for reducing our reliance on server stable responses
- useMemo and useCallback for memoization
- Cover the rest of components with Unit tests
POST Sale
request to server has to go together withPATCH Articles
bulk update. In case of failure of the last -> all changes have to be either reverted, or second retry toPATCH Articles
has to be done- When sale is confirmed - the refresh of available articles takes approximately 2 seconds. THis should be improved
- Virtual scrolling or pagination for Sales list