This web application accumulates different information about crypto currencies using CryptoRank API.
Here you can:
- convert crypto currencies,
- see extensive list of crypto currencies with prices and other information.
It is deployed to Vercel and is available at https://crypto-converter-and-watchlist.vercel.app/
- Retrieves information about crypto currencies via CryptoRank API;
- Allows to choose crypto currencies and input the number you want to convert;
- Allows to quickly switch left-hand and right-hand currencies.
- Retrieves information about crypto currencies via CryptoRank API;
- Allows to see following information about crypto currencies in a table format: Name, Price (USD), Circulating supply, Market cap (USD), Category, and Historical price (USD) from 24 hours / 7 days / 30 days / 3 months / 6 months ago;
- Pagination is implemented using
limit
andoffset
parameters from CryptoRank API.
calculateHistoricalPrice function
- Accepts current
price
andpercentChange
as its arguments and returnshistoricalPrice
; - Price and Percent change from 24 hours / 7 days / 30 days / 3 months / 6 months ago are received from CryptoRank API;
- Resulting Historical prices are displayed in separate columns in the Watchlist table.
- Integration & unit tests for React components;
- Unit tests for utility functions (including calculateHistoricalPrice).
- big.js library is used to save precision in arithmetical operations;
- Dropdown is searchable;
- Skeleton component is used as a placeholder in table cells for a loading state;
- For a nicer formatting of numbers,
formatNumberToSI
utility function is written.
- Next.js
- React
- TypeScript
- styled-components
- SWR
- big.js
- Jest & React Testing Library
- Eslint & Prettier
- npm & Node.js
- Vercel
-
Clone this repository to your computer.
If you are not familiar with cloning GitHub repositories, check GitHub Docs.
In the Terminal, go to the cloned project directory.
-
Sign up on Cryptorank website and generate API key.
-
Create
.env.local
file in the root folder of the project with following contents:NEXT_PUBLIC_CRYPTORANK_API_KEY='YOUR_API_KEY'
, whereYOUR_API_KEY
is the API key you generated in the previous step. -
Run following command to install all necessary dependencies:
If you don't have npm installed on your computer, follow npm Docs tutorial to install it.
npm i && npm run dev
-
After that, your browser should automatically open a new tab and display the application. If it didn't happen, type
http://localhost:3000/
in the address bar of your browser.
You are now ready to explore the application!
-
To run tests, first create
.env.test.local
file in the root folder of the project, and insert there the same contents as in your.env.local
file. -
After that, run
npm run test
to start tests and to see test coverage.