Currency transaction is a simple project intend to convert an amount of money of some chosen currency to USD. It relies on Open Exchange Rates to get current rate of the chosen currency.
- Flask
- SQLAlchemy
- Alembic
- Redis
- Elasticsearch (APM)
- React JS
This project exposes two API's:
- POST /api/currency-transact
- GET /api/currency-transactions/last?limit=1¤cy=USD&page=1
- Query parameters are optional
For saving and retrieving data respectively.
On project root execute the following command:
docker-compose up -d
Note: The backend takes almost a minute to boot up in order to guarantee that MySQL is up and running.
This project uses the following ports:
- 5601, 8200, 9200, 5601, 6379, 8080 and 3000.
Those ports must available in order to run the project.
curl --location --request POST 'http://0.0.0.0:8080/api/currency-transaction' \
--header 'Content-Type: application/json' \
--data-raw '{
"amount": 0.25567801,
"currency": "BTC"
}'
curl --location --request GET 'http://0.0.0.0:8080/api/currency-transactions/last?currency=USD&limit=1&page=1'
Access http://localhost:3000
In order to see APM error logs it's necessary to configure elastic index, follow the steps bellow:
- Open kibana (localhost:5601)
- Click in discovery on left-side menu
- Kibana will redirect you to index creation.
- Type in "index pattern" "apm*" and click "next step"
- Select @timestaamp as date filter, click "create index". Now you're ready to go to discovery.