Skip to content
This repository has been archived by the owner on Dec 4, 2017. It is now read-only.

Latest commit

 

History

History
86 lines (56 loc) · 2.67 KB

README.md

File metadata and controls

86 lines (56 loc) · 2.67 KB

Astah to PNG converter stability-deprecated Code Climate Dependency Status

⚠️ This repository is no longer maintained by Lukas Martinelli.

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

🌐 Try out the demo at astah-converter.lukasmartinelli.ch

Astah to PNG converter web interface

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 "[email protected]" 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 "[email protected]" 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.