An exchange convertor application which converts the value from base currency to multiple currencies.
- User Authentication and Authorization
- Add countries (using https://restcountries.eu) and convert currencies (using https://fixer.io) to base currency
- Rate limiting using redis
- Caching the response of external API calls
- Node.js
v12.16.1or above - PostgreSQL
12.2or above - Redis
v5.0.7or above
- Change the default configs to your needs by changing the
lib/config/config.jsonfile.
Use this postman collection to test the server endpoints https://www.getpostman.com/collections/b02cbee204c78e2b6c36
- clone the project locally
- Run
npm installin the main folder to install server side dependencies cd clientand then again runnpm installto install client side dependencies- Start Postgres and Redis
- Execute the SQL statements in
migrations/migrate-db.sqlfile to create the required databases for Dev, Test and Prod. - Execute the SQL statements in
migrations/migrate-tables.sqlfile to create the required tables. This must be executed seperately in all the environment databases. - Set up the value for jwt private key by typing the following command in shell
export JWT_PRIVATE_KEY={Put your jwt private key here} - Now you can any of the following,
npm run build- To compile the ts filesnpm run server- To compile and start the servernpm run client- To start the only the clientnpm run dev- To start both the client and server inDevelopmentmodenpm run client-build- To build the client filesnpm run prod- To build both client and server files and start both concurrentlynpm run unit-test- To run the unit testsnpm run unit-test-report- To run the unit tests and generate a html reportnpm run integ-test- To run the integration testsnpm run integ-test-report- To run the integration tests and generate a html report
You can pull the docker image from the hub and you can easily start the application in a container
docker pull karthickram286/exchange-convertor:latestto pull the imagedocker run karthickram286/exchange-convertor:latestto run the image in a container in dev mode
Note: The client binds with server on port 5000(the port on which the server runs on dev mode). So, while running both the server and client in production mode(using npm run prod), change the port in client/package.json in proxy field to 7000.
https://github.com/karthickram286/exchange-convertor/issues
- Run the project locally in Development mode
- Make changes
- Raise a PR