GithubHelp home page GithubHelp logo

jgraph / plantuml-serverless Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mmajis/plantuml-serverless

21.0 2.0 7.0 11.48 MB

Serverless PlantUML diagram rendering

License: GNU General Public License v3.0

Java 71.83% HTML 7.61% Shell 12.91% Dockerfile 7.64%

plantuml-serverless's Introduction

Render PlantUML diagrams with AWS Lambda

A serverless UI + API to render PlantUML diagrams.

Drop in replacement for official PlantUML server

This can be used as a drop in replacement for scenarios where http://www.plantuml.com/plantuml is used as a rendering endpoint. You can avoid sending the diagram source to a server outside your control and use an encrypted HTTPS endpoint for the diagram traffic.

This doesn't support everything the official PlantUML server does but should be good for most intents and purposes (PNG, SVG and TXT rendering).

For example, to have Visual Studio Code PlantUML plugin render using your own serverless deployment, set the following properties in vscode for the plugin:

    "plantuml.render": "PlantUMLServer",
    "plantuml.server": "https://your-endpoint-here"

Use "plantuml.server": "https://plantuml.nitorio.us" if you'd like to try before you deploy your own.

Demo

PNG Diagram

Rendered PNG diagram should be here

SVG Diagram

Rendered SVG diagram should be here

TXT Diagram

https://plantuml.nitorio.us/txt/Kt8goYylJYrIKj2rKr1o3F1KS4yiIIrFh5IoKWZ8ALOeIirBIIrIACd8B5Oeo4dCAodDpU52KGVMw9EOcvIIgE1McfTSafcVfwI0JpU6Of09C6czhCGYlDgnwBVHrSKq80YiEJL58IKpCRqeCHVDrM0zM9oDgGqUGc0jg464hXe0

Build

  • npm ci
  • mvn clean package

Deploy

You can deploy with Serverless framework or AWS SAM.

This used to be available on the AWS Serverless Application Repository, but currently that's not possible because it doesn't appear to support lambda functions packaged as container images.

Serverless framework:

  • Edit serverless.yml to replace custom.domains.dev and custom.domains.prod with your own domain names.
    • If you don't want a custom domain name, remove or comment out the serverless-domain-manager plugin from the plugins list and skip the sls create-cert and sls create_domain commands.
  • Run sls create-cert to create an ACM certificate for your domain as configured in custom.customCertificate.
  • Run sls create_domain to create an API Gateway custom domain as configured in custom.customDomain.
  • Run sls deploy.

The above steps deploy the default dev stage. To deploy the prod stage, add --stage prod to each command.

AWS SAM

  • Run sam-deploy.sh

The SAM deployment doesn't include custom domains currently.

JGraph deployment

  • Set the region in the serverless.yml file, then deploy using sls deploy
  • Ensure gateway urls are the same and matches the ones used in region CF worker
  • Ensure the gateway custom domain (plant-aws.diagrams.net) API mapping is correct. Currently, it points to prod-plantuml-serverless - prod in eu-central-1 region
  • You can edit the domain manually also from (API Gateway -> Custom domain names) and set the new stack name (API Mapping)

plantuml-serverless's People

Contributors

adamcin avatar cagataygurturk avatar d4gg4d avatar davidjgraph avatar dependabot[bot] avatar m-mohamedin avatar mmajis avatar snyk-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.