MCPcopy Index your code
hub / github.com/dhis2/dhis2-core

github.com/dhis2/dhis2-core @4.1.2.3

Chat with this repo
repository ↗ · DeepWiki ↗ · release 4.1.2.3 ↗ · + Follow
48,184 symbols 268,317 edges 6,156 files 10,510 documented · 22%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

DHIS 2

Quality Gate Status Tests API tests

DHIS 2 is a flexible information system for data capture, management, validation, analytics and visualization. It allows for data capture through clients ranging from Web browsers, Android devices, Java feature phones and SMS. DHIS 2 features data visualization apps for dashboards, pivot tables, charting and GIS. It provides metadata management and configuration. The data model and services are exposed through a RESTful Web API.

Overview

Issues can be reported and browsed in JIRA.

For documentation visit the documentation portal.

You can download pre-built WAR files from the continuous integration server.

You can explore various demos of DHIS 2 in the play environment.

For support and discussions visit the community forum.

For general info visit the project web page.

For OpenAPI documentation visit the Stoplight workspace.

For software developer resources visit the developer portal.

To contribute to the software read the contributor guidelines.

The software is open source and released under the BSD license.

Run DHIS2 in Docker

The following guides use Docker Compose to run DHIS2 using Docker.

A DB dump is downloaded automatically the first time you start DHIS2. If you switch between different DHIS2 versions and/or need to download a different DB dump you will need to remove the shared volume db-dump using

docker compose down --volumes

Pre-built Images

We push pre-built DHIS2 Docker images to Dockerhub. You can pick an <image name> from one of the following repositories:

  • dhis2/core - images of the release and release-candidate DHIS2 versions. These images represent the stable DHIS2 versions, meaning they won't be rebuilt in the future.

  • dhis2/core-dev - images of the latest development DHIS2 versions - branches master (tagged as latest) and the previous 3 supported major versions. Image tags in this repository will be overwritten multiple times a day.

  • dhis2/core-canary - images of the latest daily development DHIS2 versions. We tag the last core-dev images for the day and add an extra tag with a "yyyyMMdd"-formatted date, like core-canary:latest-20230124.

  • dhis2/core-pr - images of PRs made from https://github.com/dhis2/dhis2-core/ and not from forks. As forks do not have access to our organizations/repos secrets.

To run DHIS2 from latest master branch (as it is on GitHub) run:

DHIS2_IMAGE=dhis2/core-dev:latest docker compose up

Local Image

Build a DHIS2 Docker image first as described in Docker image. Then execute

docker compose up

DHIS2 should become available at http://localhost:8080 with the Sierra Leone Demo DB.

Demo DB

If you want to start DHIS2 with a specific demo DB you can pass a URL like

DHIS2_DB_DUMP_URL=https://databases.dhis2.org/sierra-leone/2.39/dhis2-db-sierra-leone.sql.gz docker compose up

using versions we for example publish to https://databases.dhis2.org/

Build process

This repository contains the source code for the server-side component of DHIS 2, which is developed in Java and built with Maven.

To build it you must first install the root POM file, navigate to the dhis-web directory and then build the web POM file.

See the contributing page to learn how to run locally.

Docker image

The DHIS2 Docker image is built using Jib. To build make sure to build DHIS2 and the web project first

./dhis-2/build-dev.sh

Run the image using

docker compose up

It should now be available at http://localhost:8080.

Customizations

Docker tag

To build using a custom tag run

mvn -DskipTests -Dmaven.test.skip=true -f dhis-2/dhis-web/dhis-web-portal/pom.xml jib:dockerBuild -Djib.to.image=dhis2/core-dev:mytag

For more configuration options related to Jib or Docker go to the Jib documentation.

Context path

To deploy DHIS2 under a different context then root (/) configure the context path by setting the environment variable

CATALINA_OPTS: "-Dcontext.path='/dhis2'"

DHIS2 should be available at http://localhost:8080/dhis2.

Overriding default values

You can create a local file called docker-compose.override.yml and override values from the main docker-compose.yml file. As an example, you might want to use a different version of the Postgres database and run it on a different port. More extensive documentation of this feature is available here. Using the override file you can easily customize values for your local situation.

version: "3.8"

services:
  db:
    image: postgis/postgis:14-3.3-alpine
    ports:
      - 127.0.0.1:6432:5432
DHIS2_HOME

Previously, the Docker image was built with environment variable DHIS2_HOME set to /DHIS2_home. This is not the case anymore, instead DHIS2_HOME will fallback to its default /opt/dhis2. You can still run the Docker image with the old behavior by setting the environment variable DHIS2_HOME like

    environment:
      DHIS2_HOME: /DHIS2_home

in a docker-compose.override.yml file. Alternatively, you can pass the system property -Ddhis2.home directly from the command line. You need to ensure that this DHIS2_HOME is writeable yourself!

Extension points exported contracts — how you extend this code

TrackerImporterDataBuilder (Interface)
@author Gintare Vilkelyte [8 implementers]
dhis-2/dhis-test-e2e/src/test/java/org/hisp/dhis/tracker/imports/databuilder/TrackerImporterDataBuilder.java
ExpressionItemMethod (Interface)
Applies a method in an expression item class. @author Jim Grace [20 implementers]
dhis-2/dhis-support/dhis-support-expression-parser/src/main/java/org/hisp/dhis/parser/expression/ExpressionItemMethod.java
NotificationMessageRenderer (Interface)
@author Halvdan Hoem Grelland [41 implementers]
dhis-2/dhis-api/src/main/java/org/hisp/dhis/notification/NotificationMessageRenderer.java
FieldTransformer (Interface)
Interface for FieldTransformers, used to modify the Jackson Json tree dynamically (for example renaming of keys). @auth [6 …
dhis-2/dhis-services/dhis-service-field-filtering/src/main/java/org/hisp/dhis/fieldfiltering/FieldTransformer.java
PageRequestParams (Interface)
PageRequestParams represent the HTTP request parameters that configure whether it is paginated or not. Tracker s [6 implementers]
dhis-2/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/tracker/export/PageRequestParams.java
JsonDataValue (Interface)
Representation of org.hisp.dhis.webapi.controller.tracker.view.DataValue. [11 implementers]
dhis-2/dhis-test-web-api/src/test/java/org/hisp/dhis/webapi/controller/tracker/JsonDataValue.java
ActionAccessResolver (Interface)
@author Torgeir Lorange Ostby [4 implementers]
dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/security/ActionAccessResolver.java
Generator (Interface)
Provides basic methods required by test generator implementers. [6 implementers]
dhis-2/dhis-test-e2e/src/test/java/org/hisp/dhis/analytics/generator/Generator.java

Core symbols most depended-on inside this repo

Shape

Method 39,520
Class 5,080
Function 2,552
Interface 722
Enum 310

Languages

Java95%
TypeScript5%

Modules by API surface

dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/d3/d3.min.js376 symbols
dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.java321 symbols
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/lodash/lodash.min.js242 symbols
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/angular/angular.js230 symbols
dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseAnalyticalObject.java167 symbols
dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/User.java158 symbols
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/Metadata.java151 symbols
dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/EventQueryParams.java151 symbols
dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityQueryParams.java128 symbols
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js119 symbols
dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java119 symbols
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/deprecated/tracker/event/EventSearchParams.java107 symbols

Datastores touched

dhisDatabase · 1 repos

For agents

$ claude mcp add dhis2-core \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page