This project is a server-side application that allows users:
- To fetch all the Cryptocurrency lists from the Coingecko API :-
https://api.coingecko.com/api/v3/coins/list
- To facilitate the Price Conversion of one Crypto Currency to another Crypto Currency
- To fetch the List of Companies holding specific Cryptocurrencies Usin API :-
https://api.coingecko.com/api/v3/companies/public_treasury/${currency}
Project Demo Video Link | https://asset.cloudinary.com/arvindkumar/ab0493dbc217b32244ee32153eb75307 |
---|
Documentation.pdf Link | https://drive.google.com/file/d/10f-CJMNFoOYhdJ-j9CiXg49ACQ6u2XkS/view?usp=sharing |
---|
Project Hosted Link on Render | https://koinx-backend-assignment-ah3d.onrender.com/ |
---|
- Note:- Testing URL for POSTMAN for Task-1
Define PORT = 8000
http://localhost:8000/api/cryptocurrencylist
- Fetching The Cryptocurrencies data from the Coingecko API :-
https://api.coingecko.com/api/v3/coins/list
3. And After Fetching Data I am storing fetched data in MongoDB Database in the name and Id's format.
4. For updating the data at Every hour we are using “node-shedule” package . This package
provides a flexible and powerful way to define rules for scheduling tasks at specific times or intervals.
5. We are using “schedule.shedulejob” method to update the data at every hour
- Generated API that takes the Coingecko IDs of 2 cryptocurrencies and returns the price of one currency in another on a particular date.
(Price Conversion Logic is written in the
currencyConverter.controller.js
file undercontrollers
folder.
Define PORT = 8000
http://localhost:8000/api/currencyCoverter
- Request Schema:
{ "fromCurrency": "bitcoin", "toCurrency": "ethereum", "date": "12-01-2024" }
- Response:
{ "success": true, "data":{ "convertedPrice": 17.688510609605387 } }
- Converted Price in POSTMAN during the Testing Verification
- implemented an API that retrieves a list of companies holding a specific cryptocurrency.
Define PORT = 8000
http://localhost:8000/api/companies/public_treasury
- Implemented the
getListofCompanies
function in thelistofCompaniesData.controller.js
file undercontrollers
to handle the retrieval of company data. - Tested the API functionality using Postman.
- Request Schema:
{ "currency": "bitcoin" }
- Response:
{ "success": true, "List of Companies that holds bitcoin": [ "MicroStrategy Inc.", "Galaxy Digital Holdings", "Marathon Digital Holdings", "Tesla, Inc.", "Hut 8 Mining Corp", "Coinbase Global, Inc", "Block Inc.", "Riot Platforms, Inc", "Hive Blockchain", "CleanSpark Inc.", "NEXON Co Ltd", "Exodus Movement Inc", "Meitu Inc", "Bit Digital, Inc", "Bitfarms Limited", "NFT Investments PLC", "Cipher Mining", "DMG Blockchain Solutions Inc.", "Neptune Digital Assets Corp.", "BIGG Digital Assets Inc.", "Advanced Bitcoin Technologies AG", "FRMO Corp.", "The Brooker Group", "DigitalX", "LQwD Technologies Corp", "Cypherpunk Holdings Inc", "Core Scientific", "Mogo Inc." ] }
- Task-1: Get request to fetch All CryptoCurrency List
http://localhost:8000/api/cryptocurrencylist
- Task-2 : Post request to convert one Currency to another
http://localhost:8000/api/currencyCoverter
- Task-3 : Post request to fetch ListofCompanies
http://localhost:8000/api/companies/public_treasury
Or
- Task-1: Get request to fetch All CryptoCurrency List
https://koinx-backend-assignment-ah3d.onrender.com/api/cryptocurrencylist
- Task-2 : Post request to convert one Currency to another
https://koinx-backend-assignment-ah3d.onrender.com/api/currencyCoverter
- Task-3 : Post request to fetch ListofCompanies
https://koinx-backend-assignment-ah3d.onrender.com/api/companies/public_treasury
- Node.js
- Express.js
- MongoDB
- Coingecko API
- Render
- MongoDB Atlas
- POSTMAN
- Cors
- Axios
- Node-Schedule Package
- schedule.schedule job Method
- Download or Clone the repository:
git clone https://github.com/arvindk2025/KoinX_Backend_Assignment_.git
- Install all the required dependencies:
npm install
- Connect the MongoDB database by adding the Connection URL and PORT to the .env file (you can use MongoDB Atlas or Compass) :
MONGODB_URL = paste from connection string
PORT = 8000
- Finally, Run the project:
npm start
Or
npm run start