{"id":13413181,"url":"https://github.com/lucasepe/draft","last_synced_at":"2025-08-13T16:32:20.647Z","repository":{"id":40736665,"uuid":"269697572","full_name":"lucasepe/draft","owner":"lucasepe","description":"Generate High Level Cloud Architecture diagrams using YAML syntax.","archived":true,"fork":false,"pushed_at":"2021-09-08T18:02:56.000Z","size":4595,"stargazers_count":582,"open_issues_count":1,"forks_count":28,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-08T13:50:55.892Z","etag":null,"topics":["diagrams","golang","graphviz-dot","microservices-architecture","yaml"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lucasepe.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-05T16:11:40.000Z","updated_at":"2025-04-02T22:57:14.000Z","dependencies_parsed_at":"2022-07-20T14:17:36.777Z","dependency_job_id":null,"html_url":"https://github.com/lucasepe/draft","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/lucasepe/draft","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasepe%2Fdraft","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasepe%2Fdraft/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasepe%2Fdraft/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasepe%2Fdraft/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lucasepe","download_url":"https://codeload.github.com/lucasepe/draft/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasepe%2Fdraft/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270274617,"owners_count":24556688,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-13T02:00:09.904Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["diagrams","golang","graphviz-dot","microservices-architecture","yaml"],"created_at":"2024-07-30T20:01:34.578Z","updated_at":"2025-08-13T16:32:20.213Z","avatar_url":"https://github.com/lucasepe.png","language":"Go","funding_links":[],"categories":["Images 图像处理","Go","图片","Images","Relational Databases","yaml"],"sub_categories":["SQL 查询语句构建库","检索及分析资料库","Search and Analytic Databases","Advanced Console UIs"],"readme":"# Draft\n\nA commandline tool that generate **H**igh **L**evel microservice \u0026 serverless **A**rchitecture diagrams using a declarative syntax defined in a YAML file.\n\n- Works on [linux, macOS, windows](https://github.com/lucasepe/draft/releases/latest)\n- Just a [single portable binary file](https://github.com/lucasepe/draft/releases/latest)\n- Input data in flat YAML text files\n- Usable with shell scripts\n\n\n# Why?\n\nI prefer to think in terms of capabilities rather than specific vendor services.\n\n- _\"do we need a DNS?\"_ instead of _\"do we need Route 53?\"_\n- _\"do we need a CDN?\"_ instead of _\"do we need Cloudfront?\"_\n- _\"do we need a database? if yes? what type? Relational? No SQL\"_ instead of \"do we need Google Cloud Datastore?\"_\n- _\"do we need some serverless function?\"_ instead of _\"do we need an Azure Function\"_\n\n...and so on.\n\n# How `draft` works?\n\n`draft` takes in input a declarative YAML file and generates a [`dot`](https://en.wikipedia.org/wiki/DOT_(graph_description_language)) script for [Graphviz](https://www.graphviz.org/)\n\n```bash\ndraft backend-for-frontend.yml | dot -Tpng -Gdpi=200 \u003e backend-for-frontend.png \n```\n\nPiping the `draft` output to [GraphViz](http://www.graphviz.org/doc/info/output.html/) `dot` you can generate different output formats:\n\n| format       | command                                                        |\n|:-------------|:---------------------------------------------------------------|\n| PNG          | \u003ccode\u003edraft input.yml \u0026#124; dot -Tpng \u003e output.png\u003c/code\u003e     |\n| JPEG         | \u003ccode\u003edraft input.yml \u0026#124; dot -Tjpg \u003e output.jpg\u003c/code\u003e     |\n| PostScript   | \u003ccode\u003edraft input.yml \u0026#124; dot -Tps \u003e output.ps\u003c/code\u003e       |\n| SVG          | \u003ccode\u003edraft input.yml \u0026#124; dot -Tsvg \u003e output.svg\u003c/code\u003e     |\n\nTo install GraphViz to your favorite OS, please, follow this link [https://graphviz.gitlab.io/download/](https://graphviz.gitlab.io/download/).\n\n# Installation Steps\n\nTo build the binaries by yourself, assuming that you have `Go` installed, here the steps:\n\nClone the repo,\n```psh\ngit clone https://github.com/lucasepe/draft.git\n```\n\nMove to the 'cmd' directory:\n```psh\ncd draft/cmd\n```\n\nGenerate the static assets\n```psh\ngo generate ../...\n```\n\nBuild the binary tool\n```psh\ngo build -o draft\n```\n\n# Components\n\nThe basic unit of each _draft_ design is the `component`, has these attributes:\n\n| Name      | Required | Scope                         | Notes                                                   |\n|:----------|:--------:|:------------------------------|---------------------------------------------------------|\n| id        | no       | used for the connecttions     | autogenerated if omitted (read more for details...)     |\n| kind      | yes      | identify the component type   | see [all available kinds](#list-of-all-available-kinds) |\n| provider  | no       | get the specific provider icon| see [using custom icons](#using-custom-icons)           |\n| label     | no       | text below the component icon | can contain basic HTML tags                             |\n| outline   | no       | tag to group components       |                                                         |\n| impl      | no       | text above the icon           | can use this to specify the provider implementation     |\n| fontColor | no       | the label text color          | hex color code - supports transparency too              |\n\n### Notes about a component `id`\n\n- you can define your component `id` explicitly (i.e. _id: MY_SERVICE_A_)\n- or you can omit the component `id` attribute and it will be autogenerated\n\n### How is auto-generated a component `id`?\n\nAn auto-generated component `id` has a prefix and a sequential number\n\n- the prefix is related to the component `kind`\n  - examples _waf1, ..., wafN_ or _ser1, ..., serN_ etc.\n\n# List of all available kinds\n\nDraft uses a set of symbols independent from the different providers (AWS, Microsoft Azure, GCP). \n\nBelow is a list of all the components currently implemented.\n\n## Clients\n\nSample YAML file [examples/clients.yml](./examples/clients.yml).\n\n```bash\ndraft -impl -verbose examples/clients.yml | dot -Gdpi=110 -Tpng \u003e examples/clients.png\n```\n\n![Clients](examples/clients.png)\n\n## Networking\n\nSample YAML file [examples/networking.yml](./examples/networking.yml).\n\n```bash\ndraft -impl -verbose examples/networking.yml | dot -Gdpi=110 -Tpng \u003e examples/networking.png\n```\n\n![Networking](examples/networking.png)\n\n## Compute\n\nSample YAML file [examples/compute.yml](./examples/compute.yml).\n\n```bash\ndraft -impl -verbose examples/compute.yml | dot -Gdpi=110 -Tpng \u003e examples/compute.png\n```\n\n![Compute](examples/compute.png)\n\n## Database\n\nSample YAML file [examples/database.yml](./examples/database.yml).\n\n```bash\ndraft -impl -verbose examples/database.yml | dot -Gdpi=110 -Tpng \u003e examples/database.png\n```\n\n![Database](examples/database.png)\n\n## Storage\n\nSample YAML file [examples/storage.yml](./examples/storage.yml).\n\n```bash\ndraft -impl -verbose examples/storage.yml | dot -Gdpi=110 -Tpng \u003e examples/storage.png\n```\n\n![Storage](examples/storage.png)\n\n## Security\n\nSample YAML file [examples/security.yml](./examples/security.yml).\n\n```bash\ndraft -impl -verbose examples/security.yml | dot -Gdpi=110 -Tpng \u003e examples/security.png\n```\n\n![Security](examples/security.png)\n\n# Using custom icons\n\nHere how to render components with specific _aws_, _google_ and _azure_ icons.\n\n1. Download the \u003cu\u003ePNG\u003c/u\u003e icons of your cloud provider [AWS](https://aws.amazon.com/it/architecture/icons/), [GCP](https://cloud.google.com/icons), [Azure](https://www.microsoft.com/en-us/download/details.aspx?id=41937)\n\n2. Take only the icons related to the [components supported](#list-of-all-available-kinds) by [draft](https://github.com/lucasepe/draft/releases/latest)\n\n3. Make a directory with the provider name (i.e. `/draft/icons/aws`, `/draft/icons/google`, `/draft/icons/azure`) \n\n4. Rename each icon as [draft](https://github.com/lucasepe/draft/releases/latest) components `kind` (i.e. `dns.png`, `cdn.png` and so on...)\n\n5. Run [draft](https://github.com/lucasepe/draft/releases/latest) specifyng the icons folder using the environment variable `DRAFT_ICONS_PATH`\n  - example: `DRAFT_ICONS_PATH=/draft/icons draft my-file.yml | dot \u003e ark-aws.png`\n\n👉 I have already done all the work for points 1 to 4. So you can avoid it by copying the directory [icons](./icons) 👈\n\n\n# Connections\n\nThe arrows that join the components. \n\nTo connect an _origin_ component with one or more _targets_ component you need to specify at least each `id`.\n\nA _connection_ has the following properties:\n\n| Attribute | Type     | Required | What is it?                    |\n|:----------|:--------:|:--------:|--------------------------------|\n| origin    | string   | yes      | id of the starting component   |\n| targets   | object   | yes      | one or more destinations       |\n\nEach _target_ has the following properties:\n\n| Attribute      | Type     | Required | What is it?                                       |\n|:---------------|:--------:|:--------:|---------------------------------------------------|\n| id             | string   | yes      | target component id                               |\n| label          | string   | no       | text on the connection                            |\n| labeldistance  | float    | no       | distance of the label from the connection tail    |\n| labelangle     | float    | no       | determine the label position relative to the tail |\n| minlen         | float    | no       | sets the minimum connection length                |\n| num            | int      | no       | usefult to track an order path on your graph      |\n| color          | string   | no       | label color (hex color string)                    |\n| dashed         | bool     | no       | if true the connection line will be dashed        |\n| dir            | string   | no       | arrows direction (forward, back, both, none)      |\n| highlight      | bool     | no       | if true makes the arrow thicker                   |\n\n\nSample YAML file [examples/connections.yml](./examples/connections.yml).\n\n```bash\ndraft examples/connections.yml | dot -Gdpi=110 -Tpng \u003e examples/connections.png\n```\n\n![Connections](examples/connections.png)\n\n\n[![Twitter](https://img.shields.io/twitter/url?style=social\u0026url=https%3A%2F%2Fgithub.com%2Flucasepe%2Fdraft)](https://twitter.com/intent/tweet?text=Wow:\u0026url=https%3A%2F%2Fgithub.com%2Flucasepe%2Fdraft)\n\n---\n\n## Changelog\n\n👉 [Record of all notable changes made to a project](./CHANGELOG.md)\n\n---\n\n## Examples\n\n👉 [Collection of draft architecture descriptor YAML files](./examples/README.md)\n\n---\n\n(c) 2020 Luca Sepe http://lucasepe.it. MIT License \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucasepe%2Fdraft","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucasepe%2Fdraft","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucasepe%2Fdraft/lists"}