The Crypto Portfolio Tracker is a powerful tool designed to help you manage and track your cryptocurrency investments across multiple blockchains and exchanges. With support for Ethereum and Solana, this tracker evaluates current prices using Coingecko, providing you with up-to-date portfolio values. Stay on top of your crypto investments with the Crypto Portfolio Tracker, your all-in-one solution for managing and visualizing your digital assets.
This project leverages a modern technology stack to ensure robust performance, scalability, and maintainability. Below is an overview of the key technologies used:
Click to expand!
Node.js is the runtime environment for executing JavaScript code server-side. It provides an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for building scalable network applications.
TypeScript is a statically typed superset of JavaScript that enhances code quality and developer productivity. By using TypeScript, we benefit from type checking, improved refactoring, and better tooling support.
Express is a minimal and flexible Node.js web application framework that provides a robust set of features for building web and mobile applications. It is used to handle HTTP requests, routing, and middleware in this project.
Viem is a JavaScript library for interacting with Ethereum smart contracts. It simplifies the process of connecting to Ethereum nodes, sending transactions, and calling smart contract methods. Viem is used in this project to facilitate communication with Ethereum smart contracts.
Solana Web3.js is a JavaScript library for interacting with the Solana blockchain. It provides tools for sending transactions, querying blockchain data, and interacting with Solana smart contracts. This library is essential for integrating Solana support into the project.
Mocha is a feature-rich JavaScript test framework running on Node.js, making asynchronous testing simple and fun. Mocha tests run serially, allowing for flexible and accurate reporting, while mapping uncaught exceptions to the correct test cases. It is used in this project to write and execute unit and integration tests, ensuring the reliability of the codebase.
The project is organized into the following directories:
Click to expand!
Contains the main source code for the Crypto Portfolio Tracker, including modules for exchange and wallet integrations, blockchain support, and portfolio calculations. The source code is using a simple form of clean architecture for its organization with:
Containing business logic like entities and use cases.
Containing logic responsible for receiving requests, validating, starting it processing and preparing the proper response.
Utility code like drivers that knows how to communicate with each blockchain.
Includes unit and integration tests to ensure the reliability and correctness of the project's functionality.
Holds configuration files for setting up and managing different environments and dependencies.
Includes documentation files, such as user guides, API references, and developer notes.
This directory contains the Application Binary Interface (ABI) files for the smart contracts used in the project. ABIs are essential for interacting with the smart contracts from the TypeScript code, as they define the methods and events available in the contracts. Each ABI file is typically generated when the smart contract is compiled and is used by viem.js
to facilitate communication with the blockchain.
This directory contains various assets used in the project, such as images, logos, and other media files.
This folder includes logos for the blockchains and stablecoins supported by the project. The logos are in SVG format to ensure high quality and scalability.
To get started with the Crypto Portfolio Tracker, follow these steps:
Ensure you have the following installed on your machine:
- Node.js (v14.x or higher)
- npm (v6.x or higher)
- Clone the repository:
git clone https://github.com/johngodoi/personal_crypto_portfolio_tracker
cd personal_crypto_portfolio_tracker
- Install the dependencies:
npm install
To run the project in development mode, use the following command:
npm run dev
This will start the server and watch for any changes in the source files, automatically restarting the server when changes are detected.
To execute the unit and integration tests, use the following command:
npm run test
This will run all the tests defined in the /tests
directory and provide a summary of the test results.
To build the project for production, use the following command:
npm run build
This will compile the TypeScript code into JavaScript and output the result in the /dist
directory.
To start the project after it has been built, use the following command:
npm run start
This will launch the server using the compiled JavaScript code from the /dist
directory, allowing you to run the project in a production environment.
The Crypto Portfolio Tracker backend provides a set of RESTful API endpoints to interact with the system. Below is a list of available endpoints and their descriptions:
Click to expand!
- GET /blockchains/{blockchain}/balances/{address}
- Description: Get the balances, of native currency and fungible tokens, of an address on a blockchain (e.g. Ethereum, Tron, etc.)
- Parameters:
- blockchain: The name of the blockchain (e.g. ethereum, tron, ripple and solana.)
- address: The address on the blockchain
- Response:
{ "trxBalance": "string", "tokenBalances": [ { "balance": "string", "symbol": "string", "contractAddress": "string", "decimals": "number" } ] }
- GET /blockchains/{blockchain}/prices/{symbol}
- Description: Get the price of a token on a blockchain (e.g. Ethereum, Tron, etc.)
- Parameters:
- blockchain: The name of the blockchain (e.g. ethereum, tron, ripple and solana.)
- symbol: The symbol of the token on a blockchain
- Response:
{ "symbol": "string", "price": "number", "currency": "string" }
- GET /blockchains/{blockchain}/portfolio/{address}
- Description: Get the portfolio of an address on a blockchain (e.g. Ethereum, Tron, etc.)
- Parameters:
- blockchain: The name of the blockchain (e.g. ethereum, tron, ripple and solana.)
- address: The address on the blockchain
- Response:
{ "address": "string", "nativeBalance": "string", "nativeBalanceValue": "string", "tokenBalanceValues": [ { "balance": "string", "symbol": "string", "contractAddress": "string", "decimals": "number", "value": "number" } ] }
- GET /api-docs
- Description: Swagger documentation of all endpoints for crypto portfolio tracker backend
Click to expand!
- Connect to crypto exchanges
- crypto.com
- Connect to wallets
- Metamask
- Ethereum
- Solana
- Ripple
- Tron
- Load blockchain information
- Define addresses for specific blockchains
- Define tokens of interest for each address
- USD
- BRL
- USD
- BRL
- View transaction history
- USD
- BRL
- Create and manage a watchlist of tokens
We welcome contributions from the crypto community! If you're interested in helping develop this project, feel free to reach out.
MIT License
name | John Henrique Teixeira de Godoi |
https://www.linkedin.com/in/johngodoi | |
@john_godoi | |
ens | johngodoi.eth |