Technical test for Collective.Work using NestJS and ReactJS.
This project is composed of two parts:
The backend has the following features:
- Endpoint to fetch the top 150 cryptos, it also allows us to search by keyword.
- A caching system to store the data in memory, so we don't have to fetch it every time.
- A scheduled task to fetch the data every 5 seconds and cache it to stay up to date.
- Swagger documentation.
- It also contains tests for the cryptos service.
The frontend has the following features:
- A simple search bar to search by keyword. The input is debounced in order to avoid unnecessary api calls.
- A DataGrid to display the cryptos. it also supports features like sorting by columns and pagination.
- The data is fetched from the backend dynamically every 5 seconds in order to stay up to date.
- The table is animated with colors when the data changes.
- We use snackbars to display errors.
- Docker 20.10.7+
- docker-compose 1.29.2+
in order to run the project without Docker, please follow the instructions in both folders:
Start by setting the environment variables:
- cp
.env_exampleto.envusing the following command:cp .env_example .env
Once the environment variables are set, you can build the project by running the following command:
docker-compose buildto run the project, you can run the following command:
docker-compose up -d in order to stop the containers, you can run the following command:
docker-compose down- The Swagger documentation is available at: http://localhost:3000/
- The SPA s are available at: http://localhost:3001/
I would suggest that we collect the data more frequently, and send it to the frontend using sockets in order to avoid fetching it every time and to stay always up to date.