Skip to content

Vaccine-Hunters-Canada/VaxFinder-backend

Repository files navigation

💉 🔍 VaxFinder - Backend

The backend for the Vaccine Hunters Finder tool.

Development

Prerequisites

  1. Python 3.8
  2. Poetry: A tool for dependency management and packaging.
  3. Access to VaxFinder's Microsoft SQL Server database hosted on Azure. Please message Patrick or Evan for access.

Installation

  1. Install the unixODBC library if you are on a linux environment as it's required for pyodbc (hence aioodbc). You can install it using your package manager, for example:

    $ sudo apt-get install unixodbc
    $ sudo apt-get install unixodbc-dev
  2. Install Microsoft ODBC Driver 17 for SQL Server: Windows | Mac | Linux

  3. Set up a VSCode MyPy Language Server (Optional)

    On macOS or Linux:

    $ python -m venv ~/.mypyls
    $ ~/.mypyls/bin/pip install "https://github.com/matangover/mypyls/archive/master.zip#egg=mypyls[default-mypy]"

    On Windows:

    $ python -m venv %USERPROFILE%\.mypyls
    $ %USERPROFILE%\.mypyls\Scripts\pip install "https://github.com/matangover/mypyls/archive/master.zip#egg=mypyls[default-mypy]"

    Install the mypy extension in VS Code (or reload the window if the extension is already installed).

  4. Install all python dependencies with Poetry.

    $ poetry install

Running the Server

  1. Spawn a shell within a virtual environment.

    $ poetry shell

    All python dependencies should be installed within the virtual environment from the previous step.

  2. Run the server on port 8007 from the root of the project within the shell.

    $ DB_URL={DATABASE_URL} python -m app.main

Pre-commit Hooks

Pre-commit hooks helps identify simple issues in code before it's committed into Git. At the moment, isort and black are the only hooks that are set up.

Install the git hook scripts

$ pre-commit install

Temporarily Disabling hooks

It's possible to disable hooks temporarily, but it isn't recommended.

$ SKIP=isort,black git commit -m <message>

Environments

Production

Please note that the production environment is currently not stable. ⚠️

The production environment, deployed after a staging build of the main branch is manually approved, can be accessed here: https://vax-availability-api.azurewebsites.net.

Staging

The staging environment, which is automatically deployed from the main branch, can be accessed here: https://vax-availability-api-staging.azurewebsites.net.

About

Backend for the Vaccine Hunters Finder tool.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published