Currency Converter

Requirements

The project requires Python 3.12 or higher and the Poetry package manager.

Description

The project is a simple currency converter that uses the Exchange Rates API to convert currencies. Each conversion transaction is stored in a SQLite database.

Endpoints

Access the API documentation at /docs.

Useful Python commands

Installation

After installing poetry, install the project dependencies with:

poetry install --with ci,tests,development

Also, install poetry-plugin-dotenv to load environment variables from a .env file:

poetry self add poetry-plugin-dotenv

Please, refer to .env.example in order to know which environment variables should be defined for the project.

Pre-commit hooks

The project is offering pre-commit hooks, please install them via

pre-commit install

GitHub Actions

Each commit in the main branch will trigger a pipeline which will run unit tests and different linting tools. When successful it will also containerize the application, finally its scans the docker image for vulnerabilities with Trivy.

Migrate

To run the migrations, use:

poetry run task manage migrate

Development

To run the application in development mode, use:

poetry run task manage runserver

You can, also, run the containerized application:

docker-compose up

Testing

To run the tests, use:

poetry run task test