Generic TS (REST + GraphQL) based service to provide exchange rates between currencies with low latency It hydrates the cache every 1 hour with certain chosen currencies
$ git clone <this-repo>
$ npm install
$ docker build -t xanpool-assignment .
$ docker-compose up
$ docker pull irajwani/xanpool-assignment:latest
Then proceed to usage section
Alternatively, if you would like to run the app locally, and node_modules fail to install, it might be a node version issue (I used node 12.18.1) In this case, install nvm with:
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
Then follow the instructions provided to make 'nvm' command available within your terminal Then,
$ nvm install 12.18.1
$ nvm use 12.18.1
$ npm i
$ npm run dev
and run a redis container within docker
Simply visit the swagger documentation to see all available endpoints and their required parameters
Sample query:
query {
rates(from: USD, to: [SGD, GBP]) {
pair
rate
date
}
}
# Unit/Integration tests
$ npm run test
# End to End tests
$ npm run test:e2e
# Coverage report
$ npm run test:cov