== Project outline

Yubico Authenticator is a Qt5 application written in QML that uses the plugin PyOtherSide to enable 
the backend logic to be written in Python 3. The python library yubikey-manager is needed to communicate with the YubiKey,
and may be installed from pip or other package managers. If a specific version, (or branch or commit) is needed for development,
point to that version in requirements.txt.


== Build requirements

Yubico Authenticator currently requires Qt version 5.12 or higher.

== Working with the code

=== Install dependencies

It's assumed a Python environment with pip is installed.

==== Windows
Install https://www.qt.io/download[Qt5]. Build and install the Qt5 plugin http://pyotherside.readthedocs.io/en/latest/#building-pyotherside[PyOtherSide].
Make sure the http://www.swig.org/[swig] executable is in your PATH. Add http://libusb.info/[libusb] and https://developers.yubico.com/yubikey-personalization/[ykpers] DLLs to
the root of the repository of ykman (after setting up the project).

==== macOS

    $ brew install python3 swig ykpers libusb qt
    # Allow access to qmake - see https://superuser.com/a/1153338/104372
    $ brew link qt --force

Build and install the Qt5 plugin http://pyotherside.readthedocs.io/en/latest/#building-pyotherside[PyOtherSide].

==== Linux (Debian-based distributions)

    $ sudo add-apt-repository -y ppa:yubico/stable
    $ sudo apt update
    $ sudo apt install python3-yubikey-manager

Install Qt 5.12+ with offical installer.
Build and install the Qt5 plugin http://pyotherside.readthedocs.io/en/latest/#building-pyotherside[PyOtherSide]

=== Setup the repository

    $ git clone https://github.com/Yubico/yubioath-desktop.git
    $ cd yubioath-desktop

=== Compile the app

    $ qmake && make

=== Run the app:

    $ yubioath-desktop

== Code Style & Linting

This project uses http://flake8.pycqa.org/[Flake8] (for the python parts) and qmllint 
(for the QML parts) for code style with a http://pre-commit.com/[pre-commit] hook.

To use these:

    $ pip install pre-commit flake8
    $ pre-commit install
	
== QR decoder

The third party library QZXing, based on commit https://github.com/ftylitak/qzxing/commit/4715b242cc08582a0c31aad94d74251b77821a29[4715b24], is needed to decode QR codes found in images.
The library is already included in the repo.
