Running the playground
One Java server hosts this website, the docs and the interactive playground.
Locally
mvn -q install -DskipTests java -jar jdogo-playground/target/jdogo-playground-2.1.0.jar 8090
Open http://localhost:8090. The playground is at /playground.
Docker
docker compose up --build
The compose file runs the playground behind nginx with per-client rate limits, gzip and security headers, and waits for the health check at /api/health.
HTTPS
For a public site, add the TLS override. It serves HTTPS on port 443 with HTTP/2 and HSTS, redirects plain HTTP to HTTPS, and keeps /api/health on port 80 for load balancers. Point JDOGO_TLS_CERT_DIR at a folder holding fullchain.pem and privkey.pem:
JDOGO_TLS_CERT_DIR=/etc/letsencrypt/live/example.com \ docker compose -f docker-compose.yml -f docker-compose.tls.yml up -d
For Let's Encrypt, run certbot with the webroot plugin and -w docker/certbot/www: nginx serves the challenge files from there on port 80. After a renewal, reload nginx with docker compose exec proxy nginx -s reload.
Kubernetes
deploy/k8s runs two replicas of the image the release workflow publishes, ghcr.io/jdogo-dev/jdogo-studio, with Redis and a network policy: kubectl create namespace jdogo-system, then kubectl apply -k deploy/k8s. A new package on ghcr.io is private, so make it public once (package settings on GitHub) or give the cluster an image pull secret. Terminate TLS at your ingress or load balancer. The base images are pinned by digest, and Dependabot proposes updates weekly.
Public mode and dev mode
By default the server is safe to expose:
- Comparisons of pasted data use short timing runs. Full timings need dev mode.
- At most seven comparisons run or wait at once. Others get
503withRetry-After. - API calls are limited per client (a burst of 40, then 10 a second). Static pages are not. Idle clients are forgotten, so memory stays bounded.
- The client address comes from the connection.
X-Real-IPandX-Forwarded-Forcount only from a trusted proxy: loopback by default, or whatJDOGO_TRUSTED_PROXIESlists (addresses, orprivatefor a proxy in the same Docker network, asdocker-compose.ymlsets). - Pages carry a strict content-security policy and make no third-party requests: fonts are served from the site.
- Request bodies over 10 MB are refused with
413. - Live model calls, the million-row stress test and the evidence refresh are off.
Start with -Djdogo.dev=true on a trusted machine to turn those on.
Rebuilding the figures
The site's numbers come from studio/evidence.json, built from the benchmark suite. To rebuild after a change:
java -Djdogo.dev=true -jar jdogo-playground/target/jdogo-playground-2.1.0.jar 8095 & python3 scripts/build_studio_evidence.py --server http://localhost:8095
Editing these docs
Doc pages are generated. Edit the sources in docs/site/, then run:
python3 scripts/build_docs_site.py