/mbi-api

Primary LanguagePython

MBI SPA Backend

This is a Flask based API project which has two endpoints:

  1. /verify
    1. Verifies an MBI following the short spec and returns true or false
  2. /generate
    1. Generates and returns a random MBI, following the above-mentioned spec

Tests

The project utilizes pytest for its unit testing.

I have included a Postman collection for live testing of the API. This collection tests the verify endpoint, generate endpoint, as well as a combination of the two (generate then verify).

Deployment

The API is permanently deployed at https://mbi-api.juanleonardosanchez.com/

It can be deployed locally using the included start.sh which simply runs docker based on the provided Dockerfile.

Local Setup (No Docker)

sudo apt install python3-venv
python3 -m venv virtualenv
source virtualenv/bin/activate
pip install wheel uwsgi flask
sudo ufw allow 5000
python app.py