Project can be viewed live at https://cube-assignment-psi.vercel.app/
- In the root directory:
npm install
- Run the development server:
npm run dev
Open http://localhost:3000 with your browser to see the result.
- Dog API has been used to generate random images.
- Tech stack - NextJS, Tailwind CSS, Typescript
- The portal has a list of customers on the left side and upon clicking a card on the left the details of the customer are shown on the right side.
- Click on a card to highlight it and see the corresponding details on the right
- The card in the list shows the name of the customer and his title.
- Images update everytime a new card is chosen and every 10 seconds.
- 10 users are shown initially. Lazy loading with infinite scroll has been implemented to show more users. The json used contains a 100 users.
- When the end of the user list is reached, it starts again from the beginning.
- The Dog API sometimes throws a 404 when searching for a random image. In that case the 'alt' text is shown ("Image of a random dog").
- When the list reaches the end and a new iteration starts, the card in the older and newer list may get highlighted at once due to having the same ID. In a real world scenario, pagination will be handled at the backend and this issue won't occur. In this project, there is no way to tell if the pagination limit has been reached except hardcoding the value, which is not scalable. This is why the list starts from beginning instead.
![image](https://private-user-images.githubusercontent.com/58350132/291004654-cc34940b-132c-4b0c-a650-6fbb552034c7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU3MzI2ODgsIm5iZiI6MTcyNTczMjM4OCwicGF0aCI6Ii81ODM1MDEzMi8yOTEwMDQ2NTQtY2MzNDk0MGItMTMyYy00YjBjLWE2NTAtNmZiYjU1MjAzNGM3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTA3VDE4MDYyOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWZhMjBhMjc0ZjlhMTMxMGY2ZT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