HUB
Sign inSign up

dimahkiin/greenwave

By dimahkiin

•Updated 23 days ago

Traffic signal coordination, green-wave optimization and a shared network editor.

Image
API management
Developer tools
Data science
0

1.1K

dimahkiin/greenwave repository overview

⁠dimahkiin/greenwave

Greenwave calculates green waves along traffic corridors and optimizes signal offsets. It includes a network editor and comparisons of Standard Max-Pressure, experimental Smoothing-MP and fixed signal programs. The project is intended for experimentation, with network control modeled through queues rather than individual vehicle trajectories.

Green-wave calculation and offset optimization support trips spanning multiple signal cycles. The UI provides an elapsed-time diagram and an optional departure-time view for compact coordination analysis.

Source: LdDl/greenwave on GitHub⁠

⁠Configuration

The image includes working environment defaults. No configuration file is required.

To provide an environment file for the command below:

cat > greenwave.env <<'EOF'
SERVER_PORT=36000
SERVER_MAIN_PATH=api
EOF

Other settings retain their image defaults.

The optional -conf flag accepts a JSON or TOML configuration file. File configuration replaces environment configuration without merging defaults. Include static_folder = "/app/static" and docs_folder = "/app/app/rest/docs" in a TOML configuration to serve the bundled UI and API documentation.

Keep SERVER_MAIN_PATH=api when using the bundled UI, which calls /api/greenwave and /api/maxpressure.

⁠Usage

docker run --rm \
  --name greenwave \
  --env-file ./greenwave.env \
  -p 36000:36000 \
  dimahkiin/greenwave-server-app:latest

Open http://localhost:36000⁠.

No bind mounts or persistent volumes are required. Editor projects are saved in browser localStorage and can be exported as JSON.

⁠Ports
Container portProtocolPurpose
36000TCP / HTTPWeb UI, REST API and API documentation

The server listens on all interfaces using :<port>. SERVER_HOST is read from configuration but currently does not affect the listener.

⁠Container paths
PathPurpose
/appWorking directory
/app/greenwave-server-appApplication binary and entrypoint
/app/staticBundled web UI
/app/app/rest/docsAPI documentation and swagger.json

⁠Environment

These defaults are defined in the Dockerfile.

VariableDefaultPurpose
SERVER_PORT36000HTTP listening port
SERVER_MAIN_PATHapiAPI route prefix
SERVER_HOST0.0.0.0Read by configuration, currently unused by the listener
SERVER_STARTUP_MESSAGEtrueLog the listening address at startup
USE_CORStrueEnable CORS middleware
DOCS_PATH/app/app/rest/docsAPI documentation directory
STATIC_PATH/app/staticWeb UI directory

If changing SERVER_PORT, also change the container-side port in the Docker port mapping.

⁠Endpoints

Paths below use the default SERVER_MAIN_PATH=api.

MethodPathPurpose
GET/Green-wave coordination workspace
GET/networkNetwork editor
GET/pressureMax-Pressure workspace
GET/api/greenwave/healthService health response
GET/api/greenwave/docs/Interactive API documentation
GET/api/greenwave/docs/swagger.jsonSwagger specification
POST/api/greenwave/extractCalculate green waves
POST/api/greenwave/optimizeOptimize signal offsets
POST/api/maxpressure/runCompare signal controllers and evaluate a fixed-program proposal

The interactive API documentation loads RapiDoc from an external CDN.

⁠Image

The runtime image uses scratch and contains a statically compiled Go binary, the web UI and API documentation. Build stages use golang:1.23-alpine and node:22-alpine.

Measured local linux/amd64 image size: approximately 7.71 MB (7.35 MiB), uncompressed. Registry download size can differ.

To build this image from the repository root:

docker build -f docker/Dockerfile \
  -t dimahkiin/greenwave-server-app:latest .

⁠License

No project license is declared in the checked repository, and no project license file is present. A license type and license-file link are therefore unavailable.

Tag summary
Recent tags
Content type
Image
Digest
sha256:ed6957856…
Size
3.1 MB
Last updated
23 days ago
docker pull dimahkiin/greenwave:latest