1. Exchange API
Using FastAPI1 (or other framework) on Python , create a REST API that allows the user to convert between currencies. The API should have the following endpoints:
GET /exchange/{from}/{to}
Get the current of a coin from one currency to another. E.g. GET /coin/USD/EUR
.
The API should use a third-party API to get the exchange rates. You can use the free tier of the API, 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.
Attention
To consume the API, the user must be authenticated.
Gateway
This API should be consumed through the Gateway of the platform.
flowchart LR
subgraph api [Trusted Layer]
direction TB
gateway --> account
gateway --> auth
account --> db@{ shape: cyl, label: "Database" }
auth --> account
gateway e1@==> exchange:::red
e1@{ animate: true }
end
exchange e2@==> 3partyapi@{label: "3rd-party API"}
internet e3@==>|request| gateway
e2@{ animate: true }
e3@{ animate: true }
classDef red fill:#fcc
click exchange "#exchange-api" "Exchange 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.