Exchange API
The next step is to create an API that allows users to convert between currencies. The API must use a third-party service to fetch exchange rates. Note that this microservice must be implemented in Python.
flowchart LR
subgraph api [Trusted Layer]
direction TB
gateway --> account
gateway --> auth
account --> db@{ shape: cyl, label: "Database" }
auth --> account
gateway e1@==> exchange:::red
gateway --> product
gateway --> order
product --> db
order --> db
order --> product
end
exchange e3@==> 3partyapi:::green@{label: "3rd-party API"}
internet e2@==>|request| gateway
e1@{ animate: true }
e2@{ animate: true }
e3@{ animate: true }
classDef red fill:#fcc
classDef green fill:#cfc
click product "#product-api" "Product API" Attention
To consume the API, the user must be authenticated.
Using FastAPI1 (or another framework) on Python , create a REST API that allows users to convert between currencies. The API should expose the following endpoint:
GET /exchange/{from}/{to}
Get the current exchange rate from one currency to another. E.g. GET /exchange/USD/EUR.
The API should rely on a third-party service to fetch exchange rates. You can use the free tier of any of the following, e.g.:
- AwesomeAPI;
- ExchangeRate-API;
- Open Exchange Rates;
- CurrencyLayer;
- any other API.
Or, you can scrape the data from a website.
Hint
You can use the requests library to make HTTP requests to the third-party API.
Entrega
Individualmente, cada aluno deve criar um repositório no GitHub, com a documentação em MkDocs dos exercícios realizados e também com o projeto e entrega o link via BlabkBoard. Na documentação publicada deve constar:
- Nome do aluno e grupo;
- Documentação das atividades realizadas;
- Código fonte das atividades realizadas;
- Documentação do projeto;
- Código fonte do projeto;
- Link para todos os repositórios utilizados;
- Destaques para os bottlenecks implementados (ao menos 2 por indivíduo);
- Apresentação do projeto;
- Vídeo de apresentação do projeto (2-3 minutos);
Um template de documentação pode ser encontrado em Template de Documentação.