A map-based Angular demo application for DNA Evolutions' JOpt.TourOptimizer — a reactive Spring WebFlux route optimization service. Configure nodes and resources on a Leaflet map, run optimizations against the TourOptimizer REST API, and watch results appear in real time via Server-Sent Events.
- Live demo: https://demo.dna-evolutions.com
- Docker Hub:
dnaevolutions/jopt_demoapplication - Full documentation: dna-evolutions.com/docs/learn-and-explore/feature-guides/angular_demo_client
- Interactive API: dna-evolutions.com/api
- What this application does
- Versions
- Run with Docker (recommended)
- Run without Docker
- Build a custom image
- Regenerate TypeScript models
- Project structure
- Further links
The demo walks through a complete JOpt optimization cycle:
- Load precoded example data or place nodes and resources freely on the map.
- Configure optimization options (time windows, capacities, constraints).
- Submit the optimization via
POST /api/v1/runsand receive arunId. - Stream live progress updates via SSE (
GET /api/v1/runs/{runId}/stream/progress). - Retrieve and display the result — routes are drawn as polylines on the map with full solution details.
A video walkthrough is available on YouTube:
| Dependency | Version |
|---|---|
| Angular | 21.2.7 |
| Angular Material / CDK | 21.2.5 |
| TypeScript | 5.9.3 |
| RxJS | 7.8.2 |
| Leaflet | 1.9.4 |
| Bootstrap | 5.3.8 |
| ngx-charts | 20.5.0 |
| zone.js | 0.16.1 |
| Node (Docker build) | 22.12-alpine |
| nginx (Docker runtime) | 1.27.4-alpine |
App version: 3.0.0-alpine
Compatible with TourOptimizer spec: 1.3.5-SNAPSHOT or higher
April 2026: Updated to Angular 21.2. Compatible with TourOptimizer 1.3.5+.
February 2026: Updated to Angular 21.1. Multiple dependency upgrades.
January 2025: Updated to Angular 19.1. Compatible with TourOptimizer 1.3.0+.
July 2024: Updated to Angular 18. Compatible with TourOptimizer 1.2.7+.
January 2024: Updated to Angular 17. Compatible with TourOptimizer 1.2.6+. Added free-moving example — nodes and resources can be repositioned via drag and drop.
Docker is the fastest way to get started — no Node.js or Angular CLI installation required.
- Docker installed and available in your terminal.
- A running JOpt.TourOptimizer instance. Start one with:
docker run -d --rm --name jopt-touroptimizer \
-p 8081:8081 \
-e SPRING_PROFILES_ACTIVE=cors \
dnaevolutions/jopt_touroptimizer:latestThe cors profile is required so the browser can reach the optimizer from the demo app.
docker run -d --rm \
--name jopt-demo \
-p 3000:80 \
-e JOPT_SWAGGER_HOST="http://localhost" \
-e JOPT_SWAGGER_PORT="8081" \
dnaevolutions/jopt_demoapplicationThen open http://localhost:3000.
| Variable | Default | Description |
|---|---|---|
JOPT_SWAGGER_HOST |
http://localhost |
Base URL of the TourOptimizer instance. |
JOPT_SWAGGER_PORT |
8081 |
Port of the TourOptimizer instance. |
INPRODUCTION |
false |
When true, the app uses the public DNA Evolutions endpoint. Avoid in production — the public endpoint limits requests and enforces a 20-element cap regardless of your license. |
If TourOptimizer is also running in Docker, use a shared network instead of relying on localhost:
docker network create jopt-network
docker run -d --rm --name jopt-touroptimizer \
--network jopt-network \
-e SPRING_PROFILES_ACTIVE=cors \
dnaevolutions/jopt_touroptimizer:latest
docker run -d --rm \
--name jopt-demo \
--network jopt-network \
-p 3000:80 \
-e JOPT_SWAGGER_HOST="http://jopt-touroptimizer" \
-e JOPT_SWAGGER_PORT="8081" \
dnaevolutions/jopt_demoapplication- Node.js / npm installed.
- Angular CLI installed:
npm install -g @angular/cli - A running TourOptimizer instance (see prerequisites above).
npm install
ng serveOpen http://localhost:5000. The default port is 5000 and can be changed in angular.json.
The TourOptimizer endpoint is configured in src/environments/environment.ts (development) and src/environments/environment.prod.ts (production) under the host and port keys.
Modify the source code in your IDE, then build and run your own Docker image:
# Build (requires at least 4 GB of RAM for the Node.js build stage)
docker build -t jopt-demo-custom .
# Run
docker run -d --rm \
--name jopt-demo-custom \
-p 3000:80 \
-e JOPT_SWAGGER_HOST="http://localhost" \
-e JOPT_SWAGGER_PORT="8081" \
jopt-demo-customOpen http://localhost:3000.
The TypeScript API client in build/openapi/ is generated from the TourOptimizer OpenAPI spec using the OpenAPI Generator CLI.
Download the cleaned spec from your running TourOptimizer:
curl http://localhost:8081/v3/api-docs -o ../openapi/touroptimizer_spec.jsonOr use the pre-cleaned version from GitHub: Java-REST-Client-Examples — touroptimizer_spec_cleaned.json
Save it as touroptimizer_spec.json in a folder called openapi next to (not inside) the project directory:
parent-directory/
├── openapi/
│ └── touroptimizer_spec.json
└── Angular-Demo-Application-Source/ ← project root
└── package.json
npm run generate:apiThis runs:
openapi-generator-cli generate \
-g typescript-angular \
-i ../openapi/touroptimizer_spec.json \
-o ./build/openapiThe generator can also be run as a Docker container or Maven dependency — see the OpenAPI Generator documentation.
touroptimizer-angular-demo/
├── src/
│ ├── app/
│ │ ├── _services/
│ │ │ ├── optimization-wrapper/ # Core optimization orchestration
│ │ │ ├── optimization-event/ # SSE progress and warning streams
│ │ │ ├── load-example-data/ # Precoded example inputs
│ │ │ ├── geo-and-routing/ # Geolocation and routing logic
│ │ │ └── leaflet-map/ # Map marker, polyline, popup services
│ │ ├── component/
│ │ │ ├── consent/ # Cookie consent page
│ │ │ ├── introduction/ # Intro panel, how-to and video dialogs
│ │ │ ├── example/ # Main example view
│ │ │ ├── leaflet-map/ # Leaflet map component
│ │ │ ├── optimization-run/ # Prepare, run and progress dialogs
│ │ │ ├── optimization-events/ # Live progress component (SSE)
│ │ │ ├── optimization-elements/ # Node, resource and result dialogs
│ │ │ ├── optimization-elements-selector/
│ │ │ └── custom-date-time-picker/
│ │ └── pipe/
│ │ ├── date/ # DateFormatPipe
│ │ ├── duration/ # DurationFormatPipe
│ │ └── distance/ # DistanceFormatPipe
│ ├── assets/
│ │ ├── env.js / env.template.js # Runtime environment config (envsubst)
│ │ └── precoded-data/ # Example optimization inputs
│ └── environments/
│ ├── environment.ts # Dev: localhost:8081
│ └── environment.prod.ts # Prod: Azure endpoint
├── build/
│ └── openapi/ # Auto-generated TypeScript API client
│ ├── api/
│ │ ├── optimization.service.ts # Optimization API calls
│ │ └── stream.service.ts # SSE streaming API
│ └── model/ # ~150 TypeScript model interfaces
├── Dockerfile # Multi-stage: node build → nginx serve
├── angular.json # Angular CLI config (dev port: 5000)
└── package.json
- Full demo application guide
- Getting started
- Special features overview
- Interactive API testing
- Official JavaDocs
Get an extended free license designed for small businesses and customers evaluating the product:
DNA Evolutions Portal (sign-in required)
For help or questions reach us at www.dna-evolutions.com/contact or info@dna-evolutions.com.
For license terms and plans please visit www.dna-evolutions.com.
A product by DNA Evolutions GmbH ©


