Dev Environment Setup Instructions
How to run OpenELIS Global from source for development. Everything runs through scripts/dev-stack in the main repository. The repository's README and docs/dev_setup.md are the source of truth when they change. For the big picture first, read OpenELIS Global Architecture and Technology Stack.
1. Prerequisites
Install these on your machine:
Git, Python 3, curl and gettext (
envsubst).Docker with Docker Compose (Docker Desktop on macOS and Windows).
Java 21 and Maven, to build the backend WAR.
Node.js only if you run browser tests or frontend tools on your machine. The frontend build itself runs inside Docker.
You do not need to install mkcert yourself: scripts/dev-stack up installs it when it is missing, to give you trusted local HTTPS.
2. Get the code
git clone https://github.com/DIGI-UW/OpenELIS-Global-2.git
cd OpenELIS-Global-2
bash scripts/setup-workspace.sh # once per clone: initializes the submodulesRun every scripts/dev-stack command from the root of this repository. Each clone gets its own containers, ports and data, so you can run several checkouts side by side.
3. Start the stack
scripts/dev-stack up # full stack (the default)
scripts/dev-stack up --setup light # database, webapp, frontend and proxy only
scripts/dev-stack url # print the address to openSetup | What runs | Use it for |
|---|---|---|
| Database, webapp, frontend, proxy, FHIR server, Analyzer Bridge and analyzer simulator. | Work on integrations, analyzers, referrals, EQA exchange or anything that uses FHIR. |
| Database, webapp, frontend and proxy. | Every lab workflow: patients, orders, results, validation, reports, storage, administration. Uses less memory. Switching setups keeps the same database. |
up builds the backend WAR from your checkout (mvn clean package) and runs it, with the frontend source, in the published development images (tag develop). It pulls the latest images on the first up in each terminal and whenever an image is missing; later runs in the same terminal reuse the local images and print their build date. On the first start on a machine it asks once for your administrator password, to trust the local development certificate; run it in an interactive terminal.
Open the address that scripts/dev-stack url prints and log in as admin with the password adminADMIN!. The legacy screens are at the same address followed by /api/OpenELIS-Global/.
4. Everyday work
You changed | Do this |
|---|---|
Frontend code ( | Nothing: the page reloads in the browser. |
Backend code, Liquibase or properties | Run |
Frontend dependencies, a Dockerfile, | Run |
Nothing, you just want to restart quickly | Run |
Nothing, but you want the newest published images now | Run |
scripts/dev-stack status # containers and addresses
scripts/dev-stack logs -f oe.openelis.org # follow the webapp log
eval "$(scripts/dev-stack env)" # export the stack's addresses into your shell
scripts/dev-stack down # stop, keep the data
scripts/dev-stack down --volumes --yes # stop and delete this checkout's data5. Options and settings
Options of up:
Option | What it does |
|---|---|
| Which services start (see section 3). |
| Builds a module from its source folder and deploys it into the stack. Repeat for several modules (section 6). |
| Builds the container images from this checkout instead of pulling the published ones. |
| Builds and pulls nothing; reuses the last WAR and images. |
| Pulls the latest published images now, even when this terminal already pulled them. Cannot be combined with |
| Returns without waiting for the login page. |
| Does not create the analyzer test scenarios. |
Settings go in front of the command for one run, or as lines in the .env file at the root of the repository to keep them:
Setting | Default | What it does |
|---|---|---|
|
| Tag of the published development images, for example a release such as |
|
|
|
| a free port | Set |
|
| Domain the stack answers on, for a development server reachable from outside. |
6. Work on a module
Modules are developed in their own repository. Run the stack from the core checkout and pass the module's folder:
cd OpenELIS-Global-2
scripts/dev-stack up --setup light --module ../openelis-module-specimen-followupEach run builds the module JAR, deploys it and restarts the webapp. The module's pages run from its own Vite dev server, so page edits reload in the browser. After a Java, Liquibase or manifest change, run the same command again. Start from the example module openelis-module-specimen-followup; the full guide is docs/modules.md.
7. Run the tests
Tests | Command |
|---|---|
Backend unit and integration tests (JUnit, Testcontainers) |
|
Frontend unit tests (Vitest) |
|
End-to-end tests (Playwright) against your stack |
|
Everything CI runs, on a committed change |
|
Skip tests in a Maven build with both flags: mvn clean install -DskipTests -Dmaven.test.skip=true. Format before every commit: mvn spotless:apply and cd frontend && npm run format.
8. Build without the stack
To produce the artifacts only:
scripts/run-java21 mvn -f dataexport/pom.xml install -DskipTests -Dmaven.test.skip=true
scripts/run-java21 mvn package -DskipTests -Dmaven.test.skip=true # target/OpenELIS-Global.war
cd frontend && npm ci --legacy-peer-deps && npm run build # frontend/distRunning these outside Docker is not a supported development setup: the stack above provides the database, FHIR server, certificates and properties the application needs.
9. Troubleshooting
Problem | What to do |
|---|---|
Something is missing or misconfigured | Run |
The browser shows a certificate warning | Open the address that |
A backend build fails | Read the first compiler or dependency error in the output. Do not prune all Docker or Maven caches as a fix. |
You need a clean database |
|
Questions: open an issue on GitHub or ask on the community channels listed under Get Help.