OpenSRP Technical Overview of Each Component
OpenSRP is comprised of multiple components, the Android client, OpenSRP server, OpenMRS and the data warehouse. This document provides a technical overview of each of these components, including links to external open source systems (Nifi, Superset, DHIS2 and RapidPro). A high level overview of each service is available in the Implementer's Guide.
OpenSRP App (Android Mobile Device)
The OpenSRP App is a module application that is built for each implementation. The OpenSRP team has defined numerous libraries that serve as a baseline of services that can be applied to a particular implementation. Each deployment builds their own APK that is custom tailored to their implementation and deployed to their teams. The OpenSRP consortium creates these modules and applications on the OpenSRP GitHub organization. Android apps and module repositories are prefixed with opensrp-client-. For example, the Zambia implementation uses the repository opensrp-client-path and it depends on the opensrp-client-core and opensrp-client-stock. Each modular dependency is available on Maven Central as artifacts and is defined as part of the gradle.build properties.
The OpenSRP Android app is built in Java using the Android SDK. The Android APK is targeted to build and run on Android API version 27 and higher, but supports backward compatibility as required for each project depending on the devices that have been deployed. Some legacy projects still require support for API version 18. It utilizes SQLite as the primary data store, which is encrypted with a private key on installation. All apps are built using the Model View Presenter (MVP) pattern. Some legacy applications still contain code that does not follow this pattern, but all development moving forward will use this pattern.
The OpenSRP Android app interacts with the OpenSRP server to exchange information bidirectionally through the server's REST API. These transactions are documented in the sync service for each deployment both on the Android client and OpenSRP server core deployment.
OpenSRP Server
The OpenSRP Server is a Java 8 Web Application built on top of the Spring Framework and runs in a Tomcat 7 server. The OpenSRP server has recently gone through a refactor where each project was split into multiple modules so common functionality could be realized across projects. The OpenSRP server deployed using Docker containers that are run with Ansible scripts. The server is currently headless and only exposes a REST API that can be consumed by clients. The server uses PostgreSQL as the primary data store and stores other information in MySQL and CouchDB. The team is working to reduce these multiple database dependencies. The OpenSRP server also contains services to interact with third party systems such as DHIS2 and OpenMRS. This allows OpenSRP to accurately post transactions to these external systems. Recent developments have been made in the sync process with third party systems and we are using Apache Nifi to integrate the OpenSRP Server with RapidPro.
The OpenSRP GitHub repositories relating to the server are prefixed with opensrp-server-. For example, the core services are available on opensrp-server-core.
OpenMRS Server
OpenSRP utilizes OpenMRS 1.12 and 2.x as a dependency. The OpenMRS stores information in a common transactional database that is valuable for viewing individual patient records. Each client record from OpenSRP is stored in OpenMRS and edits to data in OpenMRS are made available to OpenSRP. OpenMRS is a Java 8 Web Application built on top of the Spring Framework by an independent open source community. It runs in a Tomcat 7 server and utilizes MySQL as the primary data store. The OpenLMIS UI utilizes AngularJS and JavaServerPages on the front end. An overview of OpenMRS is available here as well as on their wiki. Source code is available at https://github.com/openmrs.
RapidPro
The OpenSRP server interacts with RapidPro to interact with clients and providers over SMS and other third party chat application (Telegram, Facebook Messenger and WhatsApp). RapidPro is an independent Python Djanog web application that is built by an independent online community. Each implementation optionally chooses to deploy their own version of RapidPro if required for their project or integrates OpenSRP with an existing SaaS version of the service. The integration with RapidPro is performed through an Apache Nifi integration. RapidPro's source code can be accessed at https://github.com/rapidpro and their online wiki can be accessed at https://rapidpro.github.io/rapidpro/docs/.
DHIS2
OpenSRP often needs to integrate with DHIS2 in order to send mandatory reports from the Android tablet to DHIS2. OpenSRP integrates with DHIS2 natively through a service that runs on the OpenSRP server. This integration, including the compatible version of DHIS2 is implementation specific. Implementations rarely stand up independent DHIS2 servers except for staging and testing purposes. More information about DHIS2 is available on their website. The source code can be accessed on https://github.com/dhis2.
Apache Nifi
OpenSRP uses Apache Nifi to support integrations with RapidPro and the data warehouse platform. Apache Nifi is a web application that is built and supported by the Apache foundation. More information on Apache Nifi can be found on their website and source code can be accessed on https://github.com/apache/nifi.
Electronic Data Warehouse
The OpenSRP Electronic Data Warehouse utilizes three tools, Apache Nifi for data ingestion, a PostgreSQL database for storage and Apache Superset for visualization. The PostgreSQL database is run on a server with minimal access provided to Nifi and Superset. Superset is a web application that is built and supported by the Apache foundation. Superset allows us to create real time dashboards, view reports and query the data warehouse through a user interface. Superset is a web application with independent role based access controls and permissions. The technical architecture of Superset can be found in their documentation and source code can be accessed on https://github.com/apache/incubator-superset/.
This site is no longer maintained. Please visit docs.opensrp.io for current documentation.