Development Environment
This document explains how to set up and run the DocApply project locally for development.
Prerequisites
Make sure you have the following installed:
- Java 25
- Node.js v24.2.0+ and pnpm (activated via
corepack enable) - Docker and Docker Compose
- Git
Docker Services
Make sure Docker Desktop is running. For local development, you only need to run the services file which starts Keycloak and PostgreSQL:
docker compose -f docker/local-setup/services.yml up -d
This starts:
- PostgreSQL on
localhost:5432— the application database (user, password and database:docapply) - Keycloak on
localhost:9080— the identity provider with a pre-configured dev realm
To stop the services:
docker compose -f docker/local-setup/services.yml down
Docker File Overview
All Docker configuration files are located in the docker/ directory:
| File | Purpose |
|---|---|
docker/local-setup/services.yml | Local development — starts Keycloak and PostgreSQL |
docker/local-setup/keycloak.yml | Keycloak service definition for local development |
docker/local-setup/postgres.yml | PostgreSQL service definition for local development |
Starting the Application
Once the Docker services are running, start the server and client in two separate terminals:
# Terminal 1 - Start Spring Boot without client build
./gradlew -x webapp
# Terminal 2 - Install pnpm dependencies and start Angular dev server
pnpm install
pnpm start
Starting the server will automatically apply all Liquibase migrations to the database.
If you encounter errors starting the server, ensure the PostgreSQL container is running and reachable.
Importing Test Data
To populate the database with example data, run the import script. This automatically imports all SQL files from the src/main/resources/testdata/ folder, sorted alphabetically:
bash ./src/main/resources/testdata/import-testdata.sh
The script runs psql inside the postgres container, so no database client is needed on your machine (on Windows, run it from Git Bash). To import a single file manually:
docker compose -f docker/local-setup/services.yml exec -T postgres psql -U docapply -d docapply -v ON_ERROR_STOP=1 < src/main/resources/testdata/01_users.sql
Local LLM Setup
If you want to use the AI features on the website then you need a local LLM instance. Follow the instructions in the Local LLM Setup Guide to get started.
Troubleshooting
PostgreSQL container is not running(test data import): Start the Docker services firstpassword authentication failed for user "docapply": The local database uses user, password and databasedocapply; checkSPRING_DATASOURCE_*if you overrode themConnection refusedon port 5432: Another PostgreSQL may already be using the port, or the container is not running- Unexpected build issues: Try running
./gradlew clean buildto reset the environment