{"id":23296143,"url":"https://github.com/opencastsoftware/govuk-nunjucks-renderer","last_synced_at":"2025-08-22T02:31:02.442Z","repository":{"id":268896139,"uuid":"638184613","full_name":"opencastsoftware/govuk-nunjucks-renderer","owner":"opencastsoftware","description":"A web app for rendering GOV.UK Nunjucks templates","archived":false,"fork":false,"pushed_at":"2025-08-20T20:55:17.000Z","size":739,"stargazers_count":2,"open_issues_count":10,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-20T22:34:51.371Z","etag":null,"topics":["api","govuk","govuk-design-system","govuk-frontend","nunjucks","nunjucks-templates","webapp"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/opencastsoftware.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,"zenodo":null}},"created_at":"2023-05-09T09:00:22.000Z","updated_at":"2025-08-05T02:48:09.000Z","dependencies_parsed_at":"2024-12-19T15:34:15.135Z","dependency_job_id":"f02d1c5e-f147-4776-a36b-7b5e210f4b1a","html_url":"https://github.com/opencastsoftware/govuk-nunjucks-renderer","commit_stats":{"total_commits":90,"total_committers":3,"mean_commits":30.0,"dds":0.5,"last_synced_commit":"178ae8a02fc644e354cb175ad92091cc8edff528"},"previous_names":["opencastsoftware/govuk-nunjucks-renderer"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/opencastsoftware/govuk-nunjucks-renderer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opencastsoftware%2Fgovuk-nunjucks-renderer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opencastsoftware%2Fgovuk-nunjucks-renderer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opencastsoftware%2Fgovuk-nunjucks-renderer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opencastsoftware%2Fgovuk-nunjucks-renderer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opencastsoftware","download_url":"https://codeload.github.com/opencastsoftware/govuk-nunjucks-renderer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opencastsoftware%2Fgovuk-nunjucks-renderer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271575555,"owners_count":24783552,"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-22T02:00:08.480Z","response_time":65,"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":["api","govuk","govuk-design-system","govuk-frontend","nunjucks","nunjucks-templates","webapp"],"created_at":"2024-12-20T07:10:06.049Z","updated_at":"2025-08-22T02:31:02.121Z","avatar_url":"https://github.com/opencastsoftware.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# govuk-nunjucks-renderer\n\n[![CI](https://github.com/opencastsoftware/govuk-nunjucks-renderer/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/opencastsoftware/govuk-nunjucks-renderer/actions/workflows/ci.yml)\n[![codecov](https://codecov.io/gh/opencastsoftware/govuk-nunjucks-renderer/branch/main/graph/badge.svg?token=Gpph41PU7r)](https://codecov.io/gh/opencastsoftware/govuk-nunjucks-renderer)\n[![License](https://img.shields.io/badge/license-MIT-blue)](https://spdx.org/licenses/MIT.html)\n[![Latest Release](https://img.shields.io/github/v/tag/opencastsoftware/govuk-nunjucks-renderer?label=latest)](https://github.com/opencastsoftware/govuk-nunjucks-renderer/pkgs/container/govuk-nunjucks-renderer)\n\nThis repository contains a Node.js web app for rendering [GOV.UK Frontend](https://frontend.design-system.service.gov.uk/) Nunjucks templates.\n\nThis is to enable comparative testing of GOV.UK Frontend components implemented in other technologies.\n\n## Usage\n\nThis project is published to GitHub Packages as a container.\n\nTo run it:\n\n```bash\n# Docker\ndocker run -d -p 3000:3000 ghcr.io/opencastsoftware/govuk-nunjucks-renderer:latest\n# Podman\npodman run -d -p 3000:3000 ghcr.io/opencastsoftware/govuk-nunjucks-renderer:latest\n```\n\nWhen using podman you need to be [logged into](https://docs.podman.io/en/latest/markdown/podman-login.1.html) ghcr.io [using a token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) with the ```read:packages``` scope.\n\n## API\n\nThe app features only one endpoint:\n\n* **URL**\n\n  `/govuk/:version/components/:name`\n\n* **Method**\n\n  `POST`\n  \n* **Path Parameters**\n\n  **Required**\n  \n  `version` - A GOV.UK Frontend [release tag](https://github.com/alphagov/govuk-frontend/releases/) minus the leading `v`.\n  \n  `name` - The GOV.UK Frontend [component](https://design-system.service.gov.uk/components/) name. The names correspond to the [component folder names](https://github.com/alphagov/govuk-design-system/tree/9ace99c886492c64e5303614d5b4303bd29689b9/src/components) in the GOV.UK Design System repository.\n\n* **Request Body**\n\n  A JSON object corresponding to the parameters of the GOV.UK Design System component.\n  \n* **Success Response**\n\n  * **Code**: 200\n  \n    **Body**: A `text/html` response body containing the rendered template content\n    \n    **Example**:\n    \n    ```bash\n    curl -X POST -H \"Accept: text/html\" -H \"Content-Type: application/json\" --data '{\"params\": {\"id\": \"bla\", \"items\": []}}' http://localhost:3000/govuk/4.5.0/components/accordion/\n    ```\n    text/html:\n    ```html\n    \u003cdiv class=\"govuk-accordion\" data-module=\"govuk-accordion\" id=\"bla\"\u003e\n  \n    \u003c/div\u003e\n    ```\n    \n* **Error Responses**\n\n  * **Code**: 406\n\n    **Body**: empty\n    \n    **Cause**: The requester *must* accept HTML. This is signified by an `Accept` header which contains the content type `text/html`.\n    \n  * **Code**: 415\n\n    **Body**: empty\n   \n    **Cause**: The requester *must* provide a JSON POST body. This is signified by a `Content-Type` header which contains the content type `application/json`.\n   \n  * **Code**: 400\n\n    **Body**: A JSON array describing the errors found when validating the request. See the [zod](https://github.com/colinhacks/zod) documentation, especially [ZodIssue](https://github.com/colinhacks/zod/blob/master/ERROR_HANDLING.md#zodissue) for an explanation of the format of these errors.\n    \n    **Cause**:\n    Requests are validated using the [zod](https://github.com/colinhacks/zod) validation library, with a schema derived from the component's parameter definitions.\n    See e.g. [the definitions for accordion](https://github.com/alphagov/govuk-frontend/blob/73c957917a193c61957e889808cc7ba6de479187/src/govuk/components/accordion/accordion.yaml). \n    Validation will fail when the request does not match these expectations.\n   \n    **Example**:\n    \n      ```bash\n      curl -X POST -H \"Accept: text/html\" -H \"Content-Type: application/json\" --data '{\"params\": {\"items\": []}}' http://localhost:3000/govuk/4.5.0/components/accordion/\n      ```\n      application/json:\n      ```json\n      [\n        {\n          \"code\":\"invalid_type\",\n          \"expected\":\"string\",\n          \"received\":\"undefined\",\n          \"path\":[\n            \"params\",\n            \"id\"\n          ],\n          \"message\":\"Required\"\n        }\n      ]\n      ```\n \n## Contributing\n\nThis project is built with Typescript and Node.js.\n\nThe recommended Node.js version can be found at [.node-version](./.node-version). Many Node version managers recognise this file.\n\nWe recommend using a manager like [fnm](https://github.com/Schniz/fnm) to install the appropriate Node.js version to build this project.\n\nTo build:\n\n`npm install \u0026\u0026 npm run build`\n\nTo run tests:\n\n`npm run test`\n\nTo run the app:\n\n`npm run dev`\n\n## License\n\nAll code in this repository is licensed under the MIT License. See [LICENSE](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopencastsoftware%2Fgovuk-nunjucks-renderer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopencastsoftware%2Fgovuk-nunjucks-renderer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopencastsoftware%2Fgovuk-nunjucks-renderer/lists"}