{"id":14982994,"url":"https://github.com/dhis2/dhis2-core","last_synced_at":"2025-05-15T05:07:15.523Z","repository":{"id":37285609,"uuid":"66940520","full_name":"dhis2/dhis2-core","owner":"dhis2","description":"DHIS 2 Core. Written in Java. Contains the service layer and Web API.","archived":false,"fork":false,"pushed_at":"2025-05-12T13:48:15.000Z","size":233520,"stargazers_count":300,"open_issues_count":44,"forks_count":363,"subscribers_count":49,"default_branch":"master","last_synced_at":"2025-05-12T13:51:00.493Z","etag":null,"topics":["hacktoberfest","hibernate","java","maven","spring","spring-mvc"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dhis2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-08-30T12:57:05.000Z","updated_at":"2025-05-12T12:57:34.000Z","dependencies_parsed_at":"2025-05-12T13:53:12.183Z","dependency_job_id":null,"html_url":"https://github.com/dhis2/dhis2-core","commit_stats":{"total_commits":11219,"total_committers":121,"mean_commits":92.71900826446281,"dds":0.79507977538105,"last_synced_commit":"cb0dad1ff6d886c2a8ab1f6c5e6028cac60af5de"},"previous_names":[],"tags_count":161,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhis2%2Fdhis2-core","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhis2%2Fdhis2-core/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhis2%2Fdhis2-core/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhis2%2Fdhis2-core/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dhis2","download_url":"https://codeload.github.com/dhis2/dhis2-core/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254276447,"owners_count":22043867,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest","hibernate","java","maven","spring","spring-mvc"],"created_at":"2024-09-24T14:06:33.057Z","updated_at":"2025-05-15T05:07:10.513Z","avatar_url":"https://github.com/dhis2.png","language":"Java","readme":"# DHIS2\r\n\r\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=dhis2_dhis2-core\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=dhis2_dhis2-core)\r\n[![Tests](https://github.com/dhis2/dhis2-core/actions/workflows/run-tests.yml/badge.svg)](https://github.com/dhis2/dhis2-core/actions/workflows/run-tests.yml)\r\n[![API tests](https://github.com/dhis2/dhis2-core/actions/workflows/run-api-tests.yml/badge.svg)](https://github.com/dhis2/dhis2-core/actions/workflows/run-api-tests.yml)\r\n\r\nDHIS2 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. DHIS2 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.\r\n\r\n## Overview\r\n\r\nIssues can be reported and browsed in [JIRA](https://jira.dhis2.org).\r\n\r\nFor documentation visit the [documentation portal](https://docs.dhis2.org/).\r\n\r\nYou can download pre-built WAR files from the [release site](https://releases.dhis2.org/).\r\n\r\nYou can explore various demos in the [play environment](https://play.dhis2.org/).\r\n\r\nFor support and discussions visit the [community forum](https://community.dhis2.org/).\r\n\r\nFor general info visit the [project web page](https://www.dhis2.org/).\r\n\r\nFor OpenAPI documentation visit the [Stoplight workspace](https://dhis2.stoplight.io/).\r\n\r\nFor software developer resources visit the [developer portal](https://developers.dhis2.org/).\r\n\r\nTo contribute to the software read the [contributor guidelines](https://developers.dhis2.org/community/contribute).\r\n\r\nThe software is open source and released under the [BSD 3-Clause license](https://opensource.org/license/bsd-3-clause).\r\n\r\n## Run DHIS2 in Docker\r\n\r\nThe following guides runs DHIS2 with [Docker Compose](https://docs.docker.com/compose/install/).\r\n\r\nA database dump is downloaded automatically the first time you start DHIS2. If you switch between different DHIS2 versions or need to download a different DB dump, you will need to remove the shared volume `db-dump` with the following command.\r\n\r\n```sh\r\ndocker compose down --volumes\r\n```\r\n\r\n### Pre-built images\r\n\r\nWe push pre-built DHIS2 Docker images to Dockerhub. You can pick an `\u003cimage name\u003e` from one of the following\r\nrepositories:\r\n\r\n* [`dhis2/core`](https://hub.docker.com/r/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.\r\n\r\n* [`dhis2/core-dev`](https://hub.docker.com/r/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.\r\n\r\n* [`dhis2/core-canary`](https://hub.docker.com/r/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`.\r\n\r\n* [`dhis2/core-pr`](https://hub.docker.com/r/dhis2/core-pr) - images of PRs made from [dhis2-core](https://github.com/dhis2/dhis2-core/) and not from forks, as forks do not have access to our organizational secrets.\r\n\r\nTo run DHIS2 from latest `master` branch (as it is on GitHub) run the command below.\r\n\r\n```sh\r\nDHIS2_IMAGE=dhis2/core-dev:latest docker compose up\r\n```\r\n\r\n### Local image\r\n\r\nBuild a DHIS2 Docker image as described in [Docker image](#docker-image) and execute the following command.\r\n\r\n```sh\r\ndocker compose up\r\n```\r\n\r\nDHIS2 will become available at `http://localhost:8080` with the Sierra Leone Demo DB.\r\n\r\n### Demo DB\r\n\r\nIf you want to start DHIS2 with a specific demo DB you can pass a URL like the below.\r\n\r\n```sh\r\nDHIS2_DB_DUMP_URL=https://databases.dhis2.org/sierra-leone/2.39/dhis2-db-sierra-leone.sql.gz \\\r\ndocker compose up\r\n```\r\n\r\n### Launch with Doris\r\n\r\n```sh\r\nDHIS2_IMAGE=dhis2/core-dev:local DORIS_VERSION=3.0.4 docker compose -f docker-compose.yml -f docker-compose.doris.yml up\r\n```\r\n\r\n\u003e **Note**\r\n\u003e \r\n\u003e Remember, when running compose up with multiple compose files, you need to pass the same files to compose down, e.g.\r\n\u003e ```\r\n\u003e docker compose -f docker-compose.yml -f docker-compose.doris.yml down\r\n\u003e ```\r\n\r\n\r\n### Synchronization between DHIS2 instances\r\n\r\nYou can run multiple DHIS2 instances to test data and metadata [synchronization](https://docs.dhis2.org/en/use/user-guides/dhis-core-version-master/exchanging-data/metadata-synchronization.html) by running the following command.\r\n\r\n```sh\r\ndocker compose --profile sync up\r\n```\r\n\r\nAfter that follow the [guide](https://github.com/dhis2/wow-backend/blob/master/guides/testing/metadata_sync_testing.md).\r\n\r\n## Build process\r\n\r\nThis repository contains the source code for the server-side component of DHIS2, written in [Java](https://www.java.com/en/) and built with [Maven](https://maven.apache.org/). See the [contributing](./CONTRIBUTING.md) page to learn how to run the software locally.\r\n\r\n### Docker image\r\n\r\nThe DHIS2 Docker image is built using [Jib](https://github.com/GoogleContainerTools/jib/tree/master/jib-maven-plugin). Start by building DHIS2 by executing the script below.\r\n\r\n```sh\r\n./dhis-2/build-dev.sh\r\n```\r\n\r\nStart the image.\r\n\r\n```sh\r\ndocker compose up\r\n```\r\n\r\nDHIS2 should now be available at `http://localhost:8080`.\r\n\r\n#### Customizations\r\n\r\n##### Docker tag\r\n\r\nTo build using a custom tag.\r\n\r\n```sh\r\nmvn clean package -DskipTests -Dmaven.test.skip=true --file dhis-2/pom.xml \\\r\n  --projects dhis-web-server --also-make --activate-profiles jibDockerBuild \\\r\n  -Djib.to.image=dhis2/core-dev:mytag\r\n```\r\n\r\nFor more configuration options related to Jib or Docker go to the [Jib documentation](https://github.com/GoogleContainerTools/jib/tree/master/jib-maven-plugin).\r\n\r\n##### Context path\r\n\r\nTo deploy DHIS2 under a different context then root (`/`) configure the context path by setting the environment variable.\r\n\r\n`CATALINA_OPTS: \"-Dcontext.path='/dhis2'\"`\r\n\r\nDHIS2 should be available at `http://localhost:8080/dhis2`.\r\n\r\n##### Overriding default values\r\n\r\nYou 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.\r\n\r\nMore extensive documentation of this feature is available at the Docker web [pages](https://docs.docker.com/compose/extends/). Using the override file you can customize values for your local environment.\r\n\r\n```yaml\r\nversion: \"3.8\"\r\n\r\nservices:\r\n  db:\r\n    image: postgis/postgis:14-3.3-alpine\r\n    ports:\r\n      - 127.0.0.1:6432:5432\r\n```\r\n\r\n##### DHIS2_HOME\r\n\r\nPreviously, 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 `/opt/dhis2`. You can still run the Docker image with the old behavior by setting the environment variable `DHIS2_HOME` in a `docker-compose.override.yml` file.\r\n\r\n```yaml\r\nenvironment:\r\n  DHIS2_HOME: /DHIS2_home\r\n```\r\n\r\nAlternatively, you can pass the system property `-Ddhis2.home` from the command line. You need to ensure that the `DHIS2_HOME` directory is writeable by the DHIS2 process.\r\n","funding_links":[],"categories":["Java"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhis2%2Fdhis2-core","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdhis2%2Fdhis2-core","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhis2%2Fdhis2-core/lists"}