Skip to content
Boilerplate for a Flask REST API with JWT-based authentication, focused on test-coverage and CI via purest, tox, and github actions.
Python Mako
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
migrations
src/flask_api_tutorial
tests
.gitignore
.pre-commit-config.yaml
README.md
pyproject.toml
pytest.ini
run.py
setup.py
tox.ini

README.md

flask-api-tutorial

Hello! This project is the application documented in a tutorial series on my website: How To: Create a Flask API with JWT-Based Authentication

This can be used as boilerplate for any REST API project that is built on Flask, SQLAlchemy, Swagger UI and pytest. My goal is to provide a REST API that is secured via JSON Web Tokens (JWT) and is robust and secure enough for use in a real-world, production application. The most important packages/extensions used by the application are:

  • Flask-RESTx
  • Flask-SQLAlcheny
  • Flask-Migrate
  • PyJWT
  • Pytest
  • Tox

Throughout the tutorial series the importance of developing automated test coverage is emphasized, along with explanations for configuring several pytest plugins that enforce code style/format, perform linting, calculate test coverage, etc.

Ensuring that your test cases are executed against your code as it would be installed by an end-user, and not against the code in your local development environment is explained and accomplished with tox.

Deploying the application as part of a CICD system is demonstrated for Github Actions and Azure Pipelines.

The methodology and step-by-step process of implementing this application is documented as a tutorial series on my website. Please check it out if you would like to learn how it was built.

Feedback can be provided either by creating a new issue here or by commenting on the article series on my website.

You can’t perform that action at this time.