Online Backend Target Technology Stack
The Online Backend is implemented inΒ Django (inΒ Python programming language).
Django is used for:
ORM Mapping, and help manage the database scheme (viaΒ migrations)
Generic (out if the box) features (User management,...)
Generic administration interface (not intended to final users, but is useful for implementation phase and, in production, trouble shooting)
Django is NOT used to build user interfaces (i.e. the Django Templates are not used).
Instead, a REST interface is built on top of the services/models viaΒ Django REST Framework, with the JSON Api extensionΒ
The Django REST Framework
support various formats (JSON, XML,...)
provides, on top of the actual REST API, a (browsable) documentation.
The JSON Api extension of the Django REST Framework, is dedicated to provide an interface compliant with the {json:api} standard
Under consideration: the implementation of a GraphQL, usingΒ Graphene.
Modularity
Desired modularity will be achieved by combining two techniques:
Security
The backend security is based on django (django REST framework) default mechanisms, that have been configured/customized in 3 main areas:
ensure (backward/concurrent) compatibility with current openIMIS implementation (way to define users, grant access to features,...)
prepare the integration with openHIE ecosystem (integration with a SSO platform)
provide fine-grained (object level) RBAC security model.
Note: the backend must be run behind a gateway.
The security models and concepts describe the core elements of the backend security.
Special notices highlight the important aspects related to the various (security-related) actors of an openIMIS concrete implementation:
for deployers (implementers) theΒ Backend security - Implementers highlightsΒ presents the backend securization, along its interactions with other components
for administrator, theΒ Backend security - Administrators highlightsΒ is given on how to manage the various openIMIS backend accesses
for developers, theΒ Backend security - Developers guidelines are provided to ensure the endpoints opened along the various modules are secured.
Testing
Backend modules are unittested via python/django classic unit test framework.
Test coverage is gathered by continuous build (viaΒ travis-ci) andΒ reported onΒ codeclimat
To register a module for code coverage and metrics:
login onΒ https://codeclimate.com/ using your github account ('Quality' login) and select the 'Open Source repositories'
click on "Add repo" and choose the repo of your module
In the 'Repo Settings' | 'Analysis' | 'Test Coverage' section, copy the 'TEST REPORTER ID' in your clipboard.
login onΒ https://travis-ci.orgΒ using your github account
select the 'openimis/openimis-be_py' repository and go 'Settings'
add an environment variable namedΒ Β CC_TEST_REPORTER_ID_<your module (logical)name> (exampleΒ CC_TEST_REPORTER_ID_claim)
... with the code climat 'TEST REPORTER ID' as value.
TheΒ behave python library is shipped with openIMIS backend, so thatΒ gherkin can be used for more functional testing.
Documentation and Tutorials
(official) Django documentation is very complete and is clearly THE privileged source of information.
Some other material of interest:
Python programming language onΒ edx.orgΒ
Django tutorial on youtube
Books of interest:
REST APIs with Django: Build powerful web APIs with Python and Django, byΒ William S. Vincent
To setup a development environment, the use of pip, pipenv and virtualenv is highly recommended, please visitΒ https://docs.python-guide.org/dev/virtualenvs/Β for detailed information.
Did you encounter a problem or do you have a suggestion?
Please contact our Service Desk
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. https://creativecommons.org/licenses/by-sa/4.0/