What it does

Currency Compare uses the public Currency API hosted on GitHub using the GBP as the base currency and comparing it to the 9 other major worldwide currencies and Bitcoin. The aforementioned currencies are as follows:

  1. USD
  2. CAD
  3. AUD
  4. JPY
  5. CNY
  6. BTC
  7. HKD
  8. CHF
  9. NZD
  10. EUR

Additionally, the endpoint keeps track of previous days' values of each of these currencies and remarks on the percent change between the current day's and the previous day of record.

How we built it

The initial web server was created with Quart/Flask, which is a web framework for Python. With that framework, we were able to use the library SQLAlchemy to interface with a local Postgres database, which we use to keep a hold of historical currency value data. Additionally, to improve subsequent load times, we use Redis as a cache to prevent from repeat queries to the Postgres database. The Postgres database and the Redis cache database are both ran using Docker/Podman containers. The web server can also be run within a Docker container for easier deployment.

Challenges we ran into

Initially, we tried to speed up the web server by making the requests asynchronous, but we ran into issues with Python's lack of typing system and seemingly incorrect error messages which prevented the entire server from functioning when functions were made async and were awaited upon. We decided not to make the entirety of the codebase async, but we did move from Flask to Quart as a speed-up was noticed.

Additionally, during deployment, the Docker networking between the main web server container and the Postgres container was causing issues with the web server container not being able to communicate with the database container despite being on the same Docker network and using the Docker container name as the hostname in the web server container. To fix this, the containers were migrated over to Podman which worked without issue out of the box.

Accomplishments that we're proud of

It works.

What we learned

  • Reagan learnt what a REST API is.
  • The team learnt about time management, and moral support.
  • According to the given problem it helps us to sharpen our technical skill in particular domain such as Docker, Flask, SQL, etc.
  • Better communication across world timezones, BST to IST and HKT.
  • We have gained confidence, inspiration and motivation by working together as a team.

Built With

Share this project:

Updates