The Crypto Serverless is a Serverless API, made with Node.js and Serverless Framework, using the AWS Lambda and others AWS functions. Your job is to keep track of some cryptocoins exchange rate to $(Dollar), and the evolution rate in % since the last iteration. It keep tracks the Crypto by a given array, and can return a history of the recent rates.
Before we start, check the following prerequisites:
- Instaled the most recent version of JavaScript and Node.
- Created and Account on Amazon and have IAM for this application
- Installed the Amazon CLI
To run this project you need to connect your own IAM keys:
# start the configuration
$ aws configure [--profile profile-name]
# this is the following options to configure
$ aws configure
AWS Access Key ID [None]: accesskey
AWS Secret Access Key [None]: secretkey
Default region name [None]: us-east-1
Default output format [None]:
The Stack used in this Project was :
- NodeJs
- Serverless Framework
- AWS Lambda
- AWS API Gateway
- AWS DynamoDB
- AWS EventBridge
- Jest
- Axios
# Clone this repository
$ git clone https://github.com/igfeitall/Crypto_Serverless.git
# Go into the repository
$ cd Crypto_Serverless
# Install dependencies
$ npm install
This is a list of some Configurations needed:
The configuration of the API can be done altering the serverless.yml archive.
- UPDATE_TIMER (in Minutes), is the minutes to trigger the update via AWS EventBridge,
- HISTORIC_LIMIT, number of rows that will apear when use GET /tokens endpoint
- COINLAYER_KEY, the key of yout acount on cointlayer website
You need to create an acount on coinLayer to be able to use this API : https://coinlayer.com/login
To run the Project you only need to deploy it:
# running the server
$ serverless deploy
# rollback the server
$ serverless remove
The Project was tested with Jest. To run all the unit test, do the following code:
# testing the code
$ npm test
This is the URL for the application runing rigth now.
The Crypto Serverless use a 3rd Party Token API, this is the list of symbols : https://coinlayer.com/symbols.
// example
{
"body": ["BTC", "ETH", "DOGE"]
}
// example
/tokens/BTC
// example
/tokens/BTC
The updateToken function is running on the AWS EventBridge.
To import the collections of Routes on Insomniam use the Json : RoutesCollection
This project is using the MIT License. click to follow to the archive License.