This guide starts DocEngine on a developer machine using Docker Desktop for the backend and local Node.js for the React frontend. Commands are written for Windows PowerShell unless marked otherwise.
- Docker Desktop with Docker Compose v2, running in Linux-container mode.
- Java 21 and Maven 3.9 or newer (needed to run Maven builds/tests on the host; not required just to run the prebuilt Compose stack).
- Node.js and npm (for the frontend).
- Git (to clone the repository).
For a lower-resource computer, start with the regular app and observability stack. Do not run the optional k6 load test unless the machine has sufficient resources; it can generate many uploads/jobs and fill MinIO storage.
Clone the repository, then change into its root folder:
git clone https://github.com/<your-account>/DocEngine.git
cd DocEngineCreate the local environment file from the checked-in example:
Copy-Item .env.example .env.env is ignored by Git. The values in .env.example are demo defaults only. Change the local passwords if desired, but keep the credentials consistent for services that share them. Never commit .env or use these defaults for a public/production deployment.
From the repository root:
docker compose --env-file .env -f docs/docker-compose.mvp.yml up -d --buildThis Compose file starts PostgreSQL, RabbitMQ, MinIO, pgAdmin, the DocEngine API, the worker, Prometheus, and Grafana. The first build can take several minutes while Docker downloads base images and Maven dependencies.
Check container status:
docker compose --env-file .env -f docs/docker-compose.mvp.yml psWait until PostgreSQL and RabbitMQ show healthy and the API/worker are running. Check the API health endpoint:
curl.exe http://127.0.0.1:8081/actuator/healthExpected response:
{"status":"UP"}The API runs in the container on port 8080 and is published to host port 8081. The worker's HTTP/Actuator port is published as host port 8082. PostgreSQL is published as host port 5433, while other containers connect to it on postgres:5432.
Open a second PowerShell terminal in the repository root:
cd frontend
npm install
npm run devOpen the URL printed by Vite, normally http://localhost:5173. The frontend calls the local API at http://127.0.0.1:8081 by default and uses demo-tenant-key as the pre-filled local API key. Choose a comma-delimited CSV with a header row, upload it, create the conversion job, and wait for completion. The download link appears when the API provides the result URL.
If uploads fail in the browser, check that the API container is healthy and that the API CORS configuration allows http://localhost:5173.
You can also exercise the API directly from PowerShell. This example uses the checked-in September fixture.
Upload the CSV:
$upload = curl.exe -sS `
-X POST http://127.0.0.1:8081/api/v1/uploads `
-H "X-API-Key: demo-tenant-key" `
-F "file=@tests/integration/resources/september-sales.csv" |
ConvertFrom-Json
$uploadSubmit a CSV-to-PDF job using the returned MinIO input reference:
$payload = @{
jobType = "CONVERT_CSV_TO_PDF"
input = @{
dataFile = $upload.inputReference
}
} | ConvertTo-Json -Compress
$job = Invoke-RestMethod `
-Uri http://127.0.0.1:8081/api/v1/jobs `
-Method Post `
-Headers @{
"X-API-Key" = "demo-tenant-key"
"Idempotency-Key" = "setup-report-$(Get-Random)"
} `
-ContentType "application/json" `
-Body $payload
$jobPoll until the job reaches a terminal status:
do {
$status = Invoke-RestMethod `
-Uri "http://127.0.0.1:8081/api/v1/jobs/$($job.jobId)" `
-Headers @{ "X-API-Key" = "demo-tenant-key" }
$status | Select-Object jobId,status,resultUrl
if ($status.status -notin @("COMPLETED", "FAILED")) {
Start-Sleep -Seconds 2
}
} while ($status.status -notin @("COMPLETED", "FAILED"))When status is COMPLETED, download the PDF from the returned URL before it expires (the local default is 15 minutes):
Invoke-WebRequest -Uri $status.resultUrl -OutFile .\docengine-output.pdfThe worker creates a PDF containing each header and its row value. CSVs must have a header row and a consistent number of comma-separated fields. Quoted commas and multiline quoted fields are supported. The job's resultUrl points to the generated PDF.
- Prometheus targets and query UI:
http://127.0.0.1:9090/targets - Grafana:
http://127.0.0.1:3000 - API metrics:
http://127.0.0.1:8081/actuator/prometheus - Worker metrics:
http://127.0.0.1:8082/actuator/prometheus
The Grafana login is controlled by GRAFANA_ADMIN_USER and GRAFANA_ADMIN_PASSWORD in .env. The Prometheus data source and DocEngine dashboard are provisioned from files under infra/grafana/provisioning/.
On the Prometheus /targets page, the docengine-api and docengine-worker targets should be UP. In Grafana, open the provisioned DocEngine — System Overview dashboard.
From the repository root:
mvn testThe atomic-claim integration test connects to PostgreSQL directly. If using the Compose database, the defaults in the test may not match your host mapping or .env values. Supply the connection settings as Maven system properties; substitute your local values without sharing them:
mvn test `
"-Duser.timezone=Asia/Kolkata" `
"-Ddocengine.test.jdbc-url=jdbc:postgresql://localhost:5433/docengine" `
"-Ddocengine.test.db-user=<POSTGRES_USER>" `
"-Ddocengine.test.db-password=<POSTGRES_PASSWORD>"Build/lint the frontend:
Set-Location frontend
npm run build
npm run lint
Set-Location ..Testcontainers-based tests may require Docker Desktop to be running. The tests that connect to an already-running local PostgreSQL instance need the correct host port, username, password, and a PostgreSQL-compatible JVM timezone.
# View logs
docker compose --env-file .env -f docs/docker-compose.mvp.yml logs -f docengine-api docengine-worker
# Restart services after rebuilding images
docker compose --env-file .env -f docs/docker-compose.mvp.yml up -d --build docengine-api docengine-worker
# Show current container usage
docker stats
# Stop containers but preserve named data volumes
docker compose --env-file .env -f docs/docker-compose.mvp.yml downTo remove database and MinIO data as well, docker compose ... down -v deletes the named volumes and their contents. Only do this when you intentionally want to reset local data.
Install k6 separately, ensure the API and worker stack is running, then read tests/load/README.md. Begin at 100 VUs and increase gradually. Load tests create real input objects and queued jobs; clean up test objects between sessions if appropriate. They are not part of normal setup and should not be run on a constrained machine.
- API health is unavailable: run
docker compose ... psand inspectdocker compose ... logs docengine-api; check PostgreSQL/RabbitMQ health and wait for migrations/startup. - Upload or job returns 401: use
X-API-Key: demo-tenant-keyfor the local demo tenant. - Browser reports CORS: confirm the frontend origin is
http://localhost:5173and the API's allowed-origin configuration includes it. - Result URL does not open: download it from the same host while it is still valid; check that MinIO is running and
MINIO_PUBLIC_ENDPOINTin.envis reachable from the browser (normallyhttp://127.0.0.1:9000). - Prometheus target is DOWN: check the API/worker containers and the scrape targets in
infra/prometheus/prometheus.yml. Prometheus reaches them by Compose service name, not hostlocalhost. - Port already in use: stop the process/container using that host port or update the host-side port mapping and corresponding local client URL. Keep the container-side ports expected by the Compose network unchanged unless updating service configuration too.