{"id":18382435,"url":"https://github.com/ntd/adg-openresty","last_synced_at":"2025-04-11T20:45:53.490Z","repository":{"id":136637737,"uuid":"456685423","full_name":"ntd/adg-openresty","owner":"ntd","description":"ADG sample usage in OpenResty","archived":false,"fork":false,"pushed_at":"2022-03-29T05:53:50.000Z","size":103,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-15T23:42:03.441Z","etag":null,"topics":["2d","adg","cad","cairo","drafting","drawing","openresty"],"latest_commit_sha":null,"homepage":"https://adg.entidi.com/demo","language":"Lua","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/ntd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-07T21:36:29.000Z","updated_at":"2022-05-04T23:17:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"30d7eba6-8f8d-4828-b36c-0946ccc47299","html_url":"https://github.com/ntd/adg-openresty","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ntd%2Fadg-openresty","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ntd%2Fadg-openresty/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ntd%2Fadg-openresty/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ntd%2Fadg-openresty/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ntd","download_url":"https://codeload.github.com/ntd/adg-openresty/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248480278,"owners_count":21110935,"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","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":["2d","adg","cad","cairo","drafting","drawing","openresty"],"created_at":"2024-11-06T01:05:39.309Z","updated_at":"2025-04-11T20:45:53.463Z","avatar_url":"https://github.com/ntd.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"General information\n===================\n\nThis is an example of [ADG](https://adg.entidi.com) usage scenario: an\nend-point for generating dynamic drawings solely based on the OpenResty\nwebserver.\n\n[OpenResty](https://openresty.org/) is an NGINX webserver flavour with\nintegrated Lua support for stellar performances. This makes it a perfect\nfit for automatic drawing generation.\n\n\nInstallation\n============\n\nYou should already have OpenResty installed somewhere in your system.\nAlso, you must have at least installed the runtime and development\npackages of the following projects:\n\n* cairo\n* pango\n* gobject-introspection\n\nOn desktop system, these dependencies are usually already installed but\non headless servers some manual intervention is likely needed. Here are\nthe steps needed on a typical Debian 9 server:\n\n```sh\n# Install the required dependencies on Debian 9\napt install build-essential \\\n            gobject-introspection libgirepository1.0-dev \\\n            libcairo2-dev libpango1.0-dev\n# For more recent releases, we install ninja and meson with `pip3`\napt install python3-pip\npip3 install meson ninja\n```\n\nOn other systems, something similar would likely be required. Once every\nneeded dependency is installed, we can build everything else inside a\nlocal folder: no root privileges are needed here!\n\n```sh\nmkdir my-adg-app\ncd my-adg-app\ngit clone https://github.com/pavouk/lgi/\ngit clone https://github.com/ntd/adg\ngit clone https://github.com/ntd/adg-openresty\ncd adg-openresty\n# Customize the environment to match your system\nvi helpers/env.conf\nhelpers/build-lgi ../lgi\nhelpers/build-adg ../adg\n```\n\nOnce everything has been built, you can start or stop the adg-openresty\nservice by using the helper script `adg-openresty`:\n\n```sh\n# To start the service\nhelpers/adg-openresty start\n# To stop the service\nhelpers/adg-openresty stop\n```\n\nOnce the service is successfully started, you can see the results on\n`http://localhost:2784/piston.png`. The default piston should be\nsomething similar to the following drawing:\n\n![Default piston drawing](./piston-default.png)\n\nYou can change any variable by passing custom settings as GET arguments.\nThe list of possible variable names, together with their fallback\nvalues, is exposed in [piston.lua](./app/piston.lua), function `DATA()`.\nFor example, you should get the following piston with\n`http://localhost:2784/piston.png?A=45\u0026B=25\u0026DHOLE=8\u0026DGROOVE=\u0026D1=13\u0026D3=14\u0026LD3=10\u0026D6=16`:\n\n![Default piston drawing](./piston-custom.png)\n\nLicense\n=======\n\nThis project is licensed under the terms of the [MIT license](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fntd%2Fadg-openresty","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fntd%2Fadg-openresty","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fntd%2Fadg-openresty/lists"}