Public | Automated Build

Last pushed: 2 years ago
Short Description
Short description is empty for this repo.
Full Description

Astah to PNG converter

A simple web interface and API that can export diagrams as images from
a Astah project files.

:globe_with_meridians: Try out the demo at astah-converter.lukasmartinelli.ch

API

There is a single ressource project for an Astah project file.

Upload project file

Make a POST request to the projects endpoint with a file upload named upload.

curl -H "Accept:application/json" -F "upload=@UseCaseDiagram.astah" http://localhost/projects
{
    "project_url":"http://localhost/projects/ee6a3d12a3b22305272badb76f39fe738c97eb3d",
    "exports":[
        {
            "export_url":"http://localhost/projects/ee6a3d12a3b22305272badb76f39fe738c97eb3d?file=UseCase Diagramm.png",
            "filename":"UseCase Diagramm.png"
        }
    ]
}

Download exported image

Make a GET request to the exported file.

curl -O http://localhost/projects/ee6a3d12a3b22305272badb76f39fe738c97eb3d?file=UseCase Diagram.png"

Upload project and download all exports

If you request text/plain from the API you can download the exports
line by line.

curl -H "Accept:text/plain" -F "upload=@UseCaseDiagram.astah" http://localhost/projects | xargs -n1 curl -O

Deployment

The Dockerfile contains Astah, Oracle JDK7 and the latest Node.

I have already setup an automated build lukasmartinelli/astah-converter
which you can use.

docker pull lukasmartinelli/astah-converter

Or you can clone the repo and build the docker image yourself.

docker build -t lukasmartinelli/astah-converter .

Now you can run the image.

docker run -p 3000:3000 -it lukasmartinelli/astah-converter

Development

For developing I recommend mounting the current directory to the installation.

docker run -v $(pwd):/opt/astah-api -p 80:3000 -it lukasmartinelli/astah-converter

Attention: if you add additional Node packages you need to rebuild the image.

Docker Pull Command
Owner
lukasmartinelli
Source Repository