{"id":45591907,"url":"https://github.com/onsdigital/babbage","last_synced_at":"2026-05-11T10:02:59.889Z","repository":{"id":31597957,"uuid":"35162817","full_name":"ONSdigital/babbage","owner":"ONSdigital","description":"Legacy part of the ONS website","archived":false,"fork":false,"pushed_at":"2026-02-23T10:22:38.000Z","size":110588,"stargazers_count":0,"open_issues_count":2,"forks_count":2,"subscribers_count":29,"default_branch":"develop","last_synced_at":"2026-02-23T19:03:45.066Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"HTML","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/ONSdigital.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2015-05-06T14:17:08.000Z","updated_at":"2026-02-04T10:25:56.000Z","dependencies_parsed_at":"2023-02-18T06:01:21.618Z","dependency_job_id":"f810554d-f543-45f6-9f9f-c6b5e5d8bd4a","html_url":"https://github.com/ONSdigital/babbage","commit_stats":null,"previous_names":[],"tags_count":184,"template":false,"template_full_name":null,"purl":"pkg:github/ONSdigital/babbage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ONSdigital%2Fbabbage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ONSdigital%2Fbabbage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ONSdigital%2Fbabbage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ONSdigital%2Fbabbage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ONSdigital","download_url":"https://codeload.github.com/ONSdigital/babbage/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ONSdigital%2Fbabbage/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32889972,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-10T13:40:02.631Z","status":"online","status_checked_at":"2026-05-11T02:00:05.975Z","response_time":120,"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":[],"created_at":"2026-02-23T12:46:27.663Z","updated_at":"2026-05-11T10:02:59.883Z","avatar_url":"https://github.com/ONSdigital.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Babbage\n\nRepository for ONS Website Babbage\n\nBabbage is a bespoke service for translating JSON into HTML. The Zebedee-Reader reads .json files off the server for\npassing to Babbage. Babbage then translates them into the .html files that are used in the website.\n\nBabbage contains two main areas of functionality, as follows:\n\n1. It creates the HTML files for the pages on the website.\n2. It creates the HTML files for the website publications in the publishing\n   system [Florence](https://github.com/ONSdigital/florence)\n\n## Getting started\n\nMake sure the following dependencies are installed:\n\n1. Java 8 (temurin builds are recommended):\n\n   ```shell\n   brew install temurin@8\n   ```\n\n1. [nvm](https://github.com/nvm-sh/nvm) installed:\n\n   ```shell\n   brew install nvm\n   ```\n\n   :warning: Make sure to follow the instructions provided at the end of the install to configure up your shell profile.\n\n1. The node version specified in [`.nvmrc`](./.nvmrc) installed through nvm:\n\n   ```shell\n   nvm install\n   ```\n\nIn order to run babbage locally:\n\n* To run Babbage for the website functionality use this command\n\n  ```shell\n  make debug-web\n  ```\n\n* To run Babbage for the publishing functionality use this command\n\n  ```shell\n  make debug-publishing\n  ```\n\n* Babbage runs on port :8080\n\n### Dependencies\n\nBabbage runs independently. However, it requires other services to run in web and publishing mode. There are stacks that\ncan be used in `dp-compose`\n\n* In order to run it locally, with the other required services;\n  * For web mode, use [legacy-core-web](https://github.com/ONSdigital/dp-compose/tree/main/v2/stacks/legacy-core-web)\n  * For publishing mode run Babbage\n      with [homepage publishing](https://github.com/ONSdigital/dp-compose/tree/main/v2/stacks/homepage-publishing)\n\n### Configuration\n\n| Environment variable           | Default                  | Description                                                                            |\n|--------------------------------|--------------------------|----------------------------------------------------------------------------------------|\n| CONTENT_SERVICE_MAX_CONNECTION | 50                       | The maximum number of connections Babbage can make to the content service              |\n| CONTENT_SERVICE_URL            | \u003chttp://localhost:8082\u003e  | The URL to the content service (zebedee)                                               |\n| ENABLE_COVID19_FEATURE         |                          | Switch to use (or not) the covid feature                                               |\n| HIGHCHARTS_EXPORT_SERVER       | \u003chttp://localhost:9999/\u003e | The URL to the highcharts export server                                                |\n| IS_PUBLISHING                  | N                        | Switch to use (or not) the publishing functionality                                    |\n| TABLE_RENDERER_HOST            | \u003chttp://localhost:23300\u003e | The URL to the table renderer                                                          |\n| POOLED_CONNECTION_TIMEOUT      | 5000                     | The number of milliseconds to wait before closing expired connections                  |\n| IDLE_CONNECTION_TIMEOUT        | 60                       | The number of seconds to wait before closing idle connections                          |\n| OTEL_EXPORTER_OTLP_ENDPOINT    | \u003chttp://localhost:4317\u003e  | URL for OpenTelemetry endpoint                                                         |\n| OTEL_SERVICE_NAME              |                          | Service name to report to telemetry tools                                              |\n| DEPRECATION_CONFIG             | []                       | See below                                                                              |\n\n#### DEPRECATION_CONFIG\n\nThe variable DEPRECATION_CONFIG consists of a json argument to the following schema:\n\n```yaml\nDEPRECATION_CONFIG:\n  type: array\n  description: \"An array of path patterns to be deprecated\"\n  items:\n    type: object\n    description: \"An individual path pattern to be deprecated\"\n    properties:\n      deprecationDate:\n        type: string\n        description: \"The date in which the decision was made to deprecate the path pattern. This should be in ISO_DATE_TIME format and set for local time.\"\n        format: date-time\n        example: \"2011-11-30T23:59:59\"\n      deprecationLink:\n        description: \"A url to further information of the deprecation of the path pattern\"\n        type: string\n        example: \"https://developer.ons.gov.uk/retirement/\"\n      sunsetDate:\n        type: string\n        description: \"The date of when this path pattern will cease to return data on its endpoints and instead return blanket 404 status codes. This should be in ISO_DATE_TIME format and set for local time.\"\n        format: date-time\n        example: \"2011-12-25T23:59:59\"\n      matchPattern:\n        type: string\n        description: \"A regex string pattern to match against requests. If you use \".*/data$\" this is for use with the 'pageTypes' below to deprecate data endpoints\"\n      message:\n        type: string\n        description: \"A message to return in the case of data endpoints. This is only used with the data endponts deprecation functionality.\"\n      pageTypes:\n        type: string\n        description: \"Comma separated list of page types, in the singular. This is only used with the data endponts deprecation functionality.\"\n        example: \"bulletin,article\"\n```\n\nFor example, matches by pattern:\n\n```json\n[\n  {\n    \"deprecationDate\": \"2011-11-30T23:59:59\",\n    \"deprecationLink\": \"https://developer.ons.gov.uk/retirement/\",\n    \"sunsetDate\": \"2011-12-25T23:59:59\",\n    \"matchPattern\": \"^/timeseriestool/data$\"\n  }\n]\n```\n\nOr matches on the data endpoint:\n\n```json\n[\n  {\n    \"deprecationDate\": \"2011-11-30T23:59:59\",\n    \"deprecationLink\": \"https://developer.ons.gov.uk/retirement/\",\n    \"sunsetDate\": \"2011-12-25T23:59:59\",\n    \"matchPattern\": \".*/data$\",\n    \"pageTypes\": \"bulletin,article\",\n    \"message\": \"no content served here\"\n  }\n]\n```\n\nThis would then be provided as an environment variable like so (ensuring quotes have been escaped):\n\n```sh\nexport DEPRECATION_CONFIG='[{\"deprecationDate\":\"2011-11-30T23:59:59\", \"sunsetDate\":\"2011-12-25T23:59:59\", \"link\":\"https://developer.ons.gov.uk/retirement/\", \"matchPattern\":\"^/timeseriestool/data$\"}]'\n```\n\nFor the purposes of our configuration this would need to be double escaped like so:\n\n```json\n{\n  //...json,\n  \"DEPRECATION_CONFIG\": \"[{\\\\\\\"deprecationDate\\\\\\\":\\\\\\\"2011-11-30T23:59:59\\\\\\\", \\\\\\\"sunsetDate\\\\\\\":\\\\\\\"2011-12-25T23:59:59\\\\\\\", \\\\\\\"link\\\\\\\":\\\\\\\"https://developer.ons.gov.uk/retirement/\\\\\\\", \\\\\\\"matchPattern\\\\\\\":\\\\\\\"^/timeseriestool/data$\\\\\\\"}]\"\n  //...more json,\n}\n```\n\n### Debugging\n\nWhen Babbage is run using one of its scripts (either run.sh or run-publishing.sh) it incorporates a Java Debug Wire\nProtocol (JDWP).\n\nTo create the configuration in Intellij, for calling the JDWP debugger, do as follows:\n\n* Choose Run --\u003e Edit Configurations...\n* Click the + to create a new configuration\n* For the type of configuration select either 'Remote' or 'Remote JVM' (whichever option it gives you)\n* Give the new configuration a name e.g. Babbage Remote\n* For 'Debugger mode' choose 'Attach to remote JVM'\n* For 'Host' enter: localhost\n* For 'Port' enter the port number given in the relevant script (e.g. for run-publishing.sh it's 8000)\n* Intellij should automatically complete the command line arguments (note that these are similar to the jdwp arguments\n  in the relevant script):\n\n  -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:8000\n\nThen, to run and debug Babbage just do the following:\n\n* At the command line, run the relevant script E.g.,\n  cd babbage\n  ./run-publishing.sh\n\n* Then in Intellij:\n* Open babbage and add any breakpoints required\n* Choose Run --\u003e Debug 'Babbage Remote'\n\n### Tools\n\nTo run some of our tests you will need additional tooling:\n\n#### Audit\n\nFor Java auditing we use mvn `ossindex:audit` which requires you\nto [setup an OSS Index account](https://github.com/ONSdigital/dp/blob/main/guides/MAC_SETUP.md#oss-index-account-and-configuration)\nand make some updates\nto [Maven: Local Setup for ossindex:audit](https://github.com/ONSdigital/dp/blob/main/guides/MAC_SETUP.md#maven-local-setup-for-ossindexaudit)\n\n#### Testing\n\nTo run the unit tests:\n\n`make test`\n\nThere is also a [guide for regression testing](REGRESSION.md). This is not complete and should not be seen as\ndefinitive.\n\n### Contributing\n\nSee [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n### License\n\nCopyright © 2025, [Office for National Statistics](https://www.ons.gov.uk)\n\nReleased under MIT license, see [LICENSE](LICENSE.md) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonsdigital%2Fbabbage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fonsdigital%2Fbabbage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonsdigital%2Fbabbage/lists"}