In this section, we’ll walk you through building and starting an instance of LocatorAPI. There are three options: using Docker, Java, Running from source or WAR file.
If you are familiar with docker, this is the preferred method to start else you can try running via Java or from source.
Prerequisites
A DHIS2 server (v 2.36 or higher)
RO Database User: Create a user in database and provide RO permission to access dhis2 database.
PostGIS extension installed and enabled
Server Requirement
Apache Server
Java JDK 8
Docker
The docker locatorAPI project is able to build docker images, provide scripts and a docker-compose.yml for launching pre-built images. the quickest start is to run the latest image directly:
docker run -d -p 8181:8181 psi-mis/locatorAPI
Java
If you have Java 8 or higher installed, the quickest way to get started is to fetch the latest release as a self contained executable jar:
curl -sSL https://github.com/psi-mis/providerLocatorAPI.git | bash -s java -jar locatorAPI.jar
Running from Source
LocatorAPI can be run from source if you are developing new features. To achieve this you’ll need to get LocatorAPI’s source and build it
git clone https://github.com/psi-mis/providerLocatorAPI.git cd locatorAPI ./mvnw locatorAPI clean install java -jar ./locatorAPI.jar
Deploying war file
If you want to deploy the war file, you can download them from the release section in our github page and move it to the webapps folder of your apache server.
Configuring LocatorAPI
You can overwrite the LocatorAPI configuration by placing the .env file in root installation folder of your LocatorAPI. For .env file copy the code below and update its corresponding values as required
# please set the following values # URL and port for the DHIS2 Org Unit API application.url={{host}} application.port={{8080}} # Postgres server details spring.datasource.url=jdbc:postgresql://<host>:<port>/<database> spring.datasource.username=<username> spring.datasource.password=<password> # jpa Java Persistent API - recommended default values. spring.jpa.generate-ddl=true spring.jpa.hibernate.ddl-auto=create-drop spring.jpa.show-sql=true spring.jpa.hibernate.ddl-auto=update spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect spring.jpa.properties.hibernate.format_sql=true