💉 🔍 VaxFinder - Backend The backend for the Vaccine Hunters Finder tool.

Overview

💉 🔍 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.

You might also like...
an opensourced roblox group finder writen in python 100% free and virus-free

Roblox-Group-Finder an opensourced roblox group finder writen in python 100% free and virus-free note : if you don't want install python or just use w

A country information finder module

A country information finder module

UniPD exam dates finder

UniPD exam dates finder Find dates for exams at UniPD Usage ./finder.py courses.csv It's suggested to save output to a file: ./finder.py courses.csv

A tool to flash .ofp files in bootloader mode without needing MSM Tool, an alternative to official realme tool
A tool to flash .ofp files in bootloader mode without needing MSM Tool, an alternative to official realme tool

Oppo/Realme Flash .OFP File on Bootloader A tool to flash .ofp files in bootloader mode without needing MSM Tool, an alternative to official realme to

💻 Algo-Phantoms-Backend is an Application that provides pathways and quizzes along with a code editor to help you towards your DSA journey.📰🔥 This repository contains the REST APIs of the application.✨
💻 Algo-Phantoms-Backend is an Application that provides pathways and quizzes along with a code editor to help you towards your DSA journey.📰🔥 This repository contains the REST APIs of the application.✨

Algo-Phantom-Backend 💻 Algo-Phantoms-Backend is an Application that provides pathways and quizzes along with a code editor to help you towards your D

Backend/API for the Mumble.dev, an open source social media application.
Backend/API for the Mumble.dev, an open source social media application.

Welcome to the Mumble Api Repository Getting Started If you are trying to use this project for the first time, you can get up and running by following

Job Guy Backend
Job Guy Backend

جاب‌گای چیست؟ اونجا وضعیت چطوریه؟ یه سوال به همین کلیت و ابهام معمولا وقتی برای یه شرکت رزومه می‌فرستیم این سوال کلی و بزرگ برای همه پیش میاد.اونجا وض

A modern Python build backend

trampolim A modern Python build backend. Features Task system, allowing to run arbitrary Python code during the build process (Planned) Easy to use CL

XHacks 2021 Startup Track Winner: Be Heard. Educate, Enact, Empower. No voice left behind. (backend)
XHacks 2021 Startup Track Winner: Be Heard. Educate, Enact, Empower. No voice left behind. (backend)

Be Heard: X Hacks 2021 Submission Educate, Enact, Empower. No voice left behind. Inspiration To say 2020 was an eventful year would be an understateme

Comments
  • testing: Add integration test setup

    testing: Add integration test setup

    Here is the integration test setup that I was able to get up and running. It's a docker-compose + pytest setup, to mock the MS SQL database and run the tests, respectively. I've updated the README with instructions on how to run these, and have updated the CI to run those commands to run the tests on the Github runner. My branch name is there too, but I'll get rid of that after this is reviewed.

    Some things to note

    SQL Files in Repo

    After discussion with Alvin, we decided that for the setup SQL file, the best way to organize these queries is to keep them grouped as separate files for each query, rather than in a giant file. One reason is simplicity, but another reason is because aioodbc (and as a consequence pyodbc) cannot execute giant groups of queries at once. It's only really meant to do one query at a time so it starts choking if we feed it this huge file. The client in the test therefore reads each SQL file sequentially and executes the statement, so the order of the statements is important. The convention I chose is given a folder with the query files in it, each file will be named <query group name>_<sequence #>.sql, so setup_3.sql is the 4th query to be executed at DB setup.

    Using Async Functions with pytest and FastAPI isn't the most straightforward

    Since we're using so much asyncio stuff, I wanted to keep the way the tests are written consistent with the app, which means a lot of async usage. However, one thing to note is that the test fixtures are slightly different from the examples I was sent, namely using httpx's AsyncClient rather than the FastAPI TestClient. This is the official client recommended by FastAPI if we have async tests.

    DB Client hooks

    I made a simple DB client to interact with the database directly for setting up the proper data for individual tests and to delete any rows after a test has run. Therefore, people writing tests would not need to worry about deleting temp data because the fixtures take care of this. Let me know if there's anything you don't like with that, specifically.

    Some bigger considerations for future

    Removal of docker-compose for programmatic docker

    I could add some extra fixtures to package the Docker container set up and tear down with the pytest stuff. This would mean we'd only need one command to run all the tests and tear them down, assuming all the proper required software is installed. I didn't do that yet because of time but it shouldn't be too hard to do.

    Maintaining SQL Files and Syncing them with actual database

    We'd need to keep these SQL files up to date whenever we update the database. This means people like Evan or Patrick would need to go in here and add the appropriate queries to align with what's expected from the actual app and the tests. Not a big deal, but something to keep in mind.

    opened by rayraykay 3
  • Adding new endpoint

    Adding new endpoint

    Adding requested endpoint for
    "/locations/key/{external_key}" { "numberAvailable": "2", "inputType": 2,
    "date": "2021-05-28T00:00:00+04:00", "numberTotal": "10", "vaccine": 5, "tagsA": " ",
    "organization": 23, "line1": "test", "line2": "test2", "city": "toronto", "province": "ontario", "postcode": "m6n2b8", "name": "test", "phone": "4165555555", "notes": " ", "active": 1, "url": "http://www.test.com", "tagsL": " " }

    and "/locations/id/{location_id}" { "numberAvailable": "2", "inputType": 2,
    "date": "2021-05-28T00:00:00+04:00", "numberTotal": "10", "vaccine": 5, "tagsA": " ",
    "organization": 23, "line1": "test", "line2": "test2", "city": "toronto", "province": "ontario", "postcode": "m6n2b8", "name": "test", "phone": "4165555555", "notes": " ", "active": 1, "url": "http://www.test.com", "tagsL": " ", "external_key":"test4564536" }

    opened by egamble01 1
  • FYI --> DIY redirect link

    FYI --> DIY redirect link

    Connect users to the appropriate DIY lookup via FYI via first letter of their postal code! DIY lookup page.xlsx

    When a user types in the first letter foIf a giving users an easier time and less clicks to get where they need to go.

    opened by sabrinacraig 1
Owner
Vaccine Hunters Canada
Vaccine Hunters Canada
Vaccine Hunters Canada
The tool helps to find hidden parameters that can be vulnerable or can reveal interesting functionality that other hunters miss.

The tool helps to find hidden parameters that can be vulnerable or can reveal interesting functionality that other hunters miss. Greater accuracy is achieved thanks to the line-by-line comparison of pages, comparison of response code and reflections.

null 197 Nov 14, 2022
A Tool to validate domestic New Zealand vaccine passes

Vaccine Validator Tool to validate domestic New Zealand vaccine passes Create a new virtual environment: python3 -m venv ./venv Activate virtual envi

null 8 May 1, 2022
To check my COVID-19 vaccine appointment, I wrote an infinite loop that sends me a Whatsapp message hourly using Twilio and Selenium. It works on my Raspberry Pi computer.

COVID-19_vaccine_appointment To check my COVID-19 vaccine appointment, I wrote an infinite loop that sends me a Whatsapp message hourly using Twilio a

Ayyuce Demirbas 24 Dec 17, 2022
Checks for Vaccine Availability at your district and notifies you using E-mail, subscribe to our website.

Vaccine Availability Notifier Project Description Checks for Vaccine Availability at your district and notifies you using E-mail every 10 mins. Kindly

Farhan Hai Khan 19 Jun 3, 2021
A Python Web Application for Checking vaccine slots by pincodes and auto slot booking.

The Dashboard is developed using Bokeh and python 3.5+. This dashboard is useful for you if you are looking for something which will help you to book the vaccine slot once slots become available. Other Vaccine Finders will notify you once slots become available but you will still need to login to the portal and book the slot manually. This dashboard will look for slot availability continuously and will send the OTP itself once slots become available.

Suraj Deshmukh 10 Jan 23, 2022
Vaccine for STOP/DJVU ransomware, prevents encryption

STOP/DJVU Ransomware Vaccine Prevents STOP/DJVU Ransomware from encrypting your files. This tool does not prevent the infection itself. STOP ransomwar

Karsten Hahn 16 May 31, 2022
Todo-backend - Todo backend with python

Todo-backend - Todo backend with python

Julio C. Diaz 1 Jan 7, 2022
✨ Udemy Coupon Finder For Discord. Supports Turkish & English Language.

Udemy Course Finder Bot | Udemy Kupon Bulucu Botu This bot finds new udemy coupons and sends to the channel. Before Setup You must have python >= 3.6

Penguen 4 May 4, 2022
Broken Link Finder is a Burp Extension to detect broken links for a passive scanning domains and links.

Broken Link Finder Broken Link Finder is a Burp Extension to detect broken links for a passive scanning domains and links. Inspired by InitRoot's link

Red Section 10 Sep 11, 2021
Snack Rice - A Rice University servery finder, customized for your needs!

Snack Rice - A Rice University servery finder, customized for your needs!

Aidan Gerber 3 Sep 25, 2022