Developer Guide¶
Basic Requirements¶
Developers need to learn Python 3 programming language (tutorial: Python3 ) and GitHub.
Core Dependencies¶
Flask: The BAR API uses Python Flask (tutorial: Flask). We use a class based approach to organize code.
Flask-restx: Flask RestX is used to create endpoints and generate swagger fontend (tutorial: Flask-restx ).
Flask-Caching: This module is used to cache queries (tutorial: Flask-Caching). We used Redis as a key-value store.
Flask-Limiter: This module is used to rate-limit the usage of API end points. This will prevent server from overloading (tutorial: Flask-Limiter )
Marshmallow: This module is only used to validate JSON schema for POST requests (tutorial: Marshmallow).
MarkupSafe: This is used to validate GET request inputs (tutorial: MarkupSafe).
Flask-SQLAlchemy: This is used to provide database connectivity and queries (tutorial: Flask-SQLAlchemy). This is based on Python SQLAlchemy (tutorial: SQLAlchemy)
Flake8: This is used to see if there are no style errors in code. Just run flake8 command.
Pytest: This module (tutorial: Pytest) along with Flask testing framework (tutorial: Flask-Testing) is used to unit test API endpoints.
Coverage: This module show the test code coverage, that is what parts of code are tested by unit tests (tutorial: Coverage)
Black: This module is used to format and clean up code. Just run black . command.
Online CI/CD Pipeline¶
GitHub Actions: This runs automated testing on GitHub (tutorial: GitHub-Actions).
LGTM: This is for code quality testing.
Codecov: This report code coverage.
Read the Docs: This hosts documentation (tutorial: readthedocs).