{"id":23401576,"url":"https://github.com/veeso-dev/tokyo-draft","last_synced_at":"2025-04-08T20:50:48.260Z","repository":{"id":183011746,"uuid":"669282657","full_name":"veeso-dev/tokyo-draft","owner":"veeso-dev","description":"A webservice to render HTML templates from API data","archived":false,"fork":false,"pushed_at":"2024-01-31T15:57:42.000Z","size":71,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-02-14T16:41:43.703Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/veeso-dev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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":"2023-07-21T20:06:01.000Z","updated_at":"2023-09-23T17:19:45.000Z","dependencies_parsed_at":"2024-01-31T17:16:15.644Z","dependency_job_id":"623a2bf2-bf3d-4dfc-8668-abe5a7008579","html_url":"https://github.com/veeso-dev/tokyo-draft","commit_stats":null,"previous_names":["veeso-dev/tokyo-draft"],"tags_count":3,"template":false,"template_full_name":"veeso-dev/rust-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veeso-dev%2Ftokyo-draft","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veeso-dev%2Ftokyo-draft/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veeso-dev%2Ftokyo-draft/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veeso-dev%2Ftokyo-draft/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/veeso-dev","download_url":"https://codeload.github.com/veeso-dev/tokyo-draft/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247927305,"owners_count":21019506,"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":[],"created_at":"2024-12-22T11:17:00.851Z","updated_at":"2025-04-08T20:50:48.236Z","avatar_url":"https://github.com/veeso-dev.png","language":"Rust","funding_links":["https://ko-fi.com/veeso","https://www.paypal.me/chrisintin"],"categories":[],"sub_categories":[],"readme":"# tokyo-draft\n\n\u003cp align=\"center\"\u003e~ A webservice to render HTML templates from API data ~\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#get-started-\"\u003eGet started\u003c/a\u003e\n  ·\n  \u003ca href=\"https://crates.io/crates/tokyo-draft\" target=\"_blank\"\u003eCrates.io\u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003eDeveloped by \u003ca href=\"https://veeso.dev/\" target=\"_blank\"\u003e@veeso\u003c/a\u003e\u003c/p\u003e\n\u003cp align=\"center\"\u003eCurrent version: 0.1.2 (25/07/2023)\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://opensource.org/license/mit/\"\n    \u003e\u003cimg\n      src=\"https://img.shields.io/badge/License-MIT-teal.svg\"\n      alt=\"License-MIT\"\n  /\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/veeso-dev/tokyo-draft/stargazers\"\n    \u003e\u003cimg\n      src=\"https://img.shields.io/github/stars/veeso-dev/tokyo-draft.svg\"\n      alt=\"Repo stars\"\n  /\u003e\u003c/a\u003e\n  \u003ca href=\"https://ko-fi.com/veeso\"\u003e\n    \u003cimg\n      src=\"https://img.shields.io/badge/donate-ko--fi-red\"\n      alt=\"Ko-fi\"\n  /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/veeso-dev/tokyo-draft/actions\"\n    \u003e\u003cimg\n      src=\"https://github.com/veeso-dev/tokyo-draft/workflows/build-test/badge.svg\"\n      alt=\"Linux CI\"\n  /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n- [tokyo-draft](#tokyo-draft)\n  - [About tokyo-draft](#about-tokyo-draft)\n  - [Get started](#get-started)\n    - [Run](#run)\n  - [tokyo-draft API](#tokyo-draft-api)\n    - [Check](#check)\n    - [Render](#render)\n      - [Errors](#errors)\n  - [Hook API](#hook-api)\n  - [Support the developer](#support-the-developer)\n  - [Contributing and issues](#contributing-and-issues)\n  - [Changelog](#changelog)\n  - [License](#license)\n\n---\n\n## About tokyo-draft\n\ntokyo-draft is a Rust web service which renders HTML templates starting from incoming data from API. The API allows you to render any template you've pre-configured in the service configuration.\nThe rendered template is then sent via a POST request to a configurable hook.\n\n---\n\n## Get started\n\n### Run\n\nFirst configure the environment file as you wish, then source .env and run tokyo-draft with\n\n```sh\n./tokyo-draft.sh start /var/run/tokyo-draft.pid\n```\n\nAt this point tokyo-draft will be served on the specified port in the `.env` (or `.env.override`) file. (Default: `3011`)\n\n## tokyo-draft API\n\n### Check\n\nCheck web service status:\n\n```txt\nGET /check\n```\n\nResponse:\n\n```json\n{\n  \"status\": \"ok\"\n}\n```\n\n### Render\n\nRender a template with provided data:\n\n```txt\nPOST /render\n```\n\npayload:\n\n```json\n{\n  \"template\": \"my-template\",\n  \"data\": {\n    \"key1\": \"value\",\n    \"key2\": 123,\n  },\n  \"hookMetadata\": {\n    /* custom data to be passed to hook */\n  }\n}\n```\n\nResponse (HTML):\n\n(rendered template)\n\n#### Errors\n\n- In case of missing keys or unknown template returns 400.\n\n## Hook API\n\nIt is possible to configure in the environment the key `RENDER_HOOK` to an URL which will receive the rendered template as parameter as follows:\n\n```json\n{\n  \"body\": \"RENDERED TEMPLATE HTML SYNTAX BASE64 ENCODED\",\n  \"metadata\": {\n    /* data passed as hookMetadata to /render */\n  }\n}\n```\n\n---\n\n## Support the developer\n\nIf you like tokyo-draft and you're grateful for the work I've done, please consider a little donation 🥳\n\nYou can make a donation with one of these platforms:\n\n[![ko-fi](https://img.shields.io/badge/Ko--fi-F16061?style=for-the-badge\u0026logo=ko-fi\u0026logoColor=white)](https://ko-fi.com/veeso)\n[![PayPal](https://img.shields.io/badge/PayPal-00457C?style=for-the-badge\u0026logo=paypal\u0026logoColor=white)](https://www.paypal.me/chrisintin)\n\n---\n\n## Contributing and issues\n\nContributions, bug reports, new features and questions are welcome! 😉\nIf you have any question or concern, or you want to suggest a new feature, or you want just want to improve pavao, feel free to open an issue or a PR.\n\nPlease follow [our contributing guidelines](CONTRIBUTING.md)\n\n---\n\n## Changelog\n\nView tokyo-draft's changelog [HERE](CHANGELOG.md)\n\n---\n\n## License\n\ntokyo-draft is licensed under the MIT license.\n\nYou can read the entire license [HERE](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fveeso-dev%2Ftokyo-draft","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fveeso-dev%2Ftokyo-draft","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fveeso-dev%2Ftokyo-draft/lists"}