{"id":19504733,"url":"https://github.com/nice-digital/consultations","last_synced_at":"2025-06-17T05:05:10.143Z","repository":{"id":39577577,"uuid":"120294597","full_name":"nice-digital/consultations","owner":"nice-digital","description":"Provides a simple and consistent way of contributing to and collecting stakeholder comments from NICE consultations","archived":false,"fork":false,"pushed_at":"2025-05-16T15:12:02.000Z","size":31667,"stargazers_count":1,"open_issues_count":11,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-30T08:50:24.669Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C#","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/nice-digital.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":"2018-02-05T11:15:32.000Z","updated_at":"2025-05-16T15:12:08.000Z","dependencies_parsed_at":"2024-02-09T10:45:06.714Z","dependency_job_id":"c949ee80-9255-4b03-b0bc-2bdd5083d1ed","html_url":"https://github.com/nice-digital/consultations","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nice-digital/consultations","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nice-digital%2Fconsultations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nice-digital%2Fconsultations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nice-digital%2Fconsultations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nice-digital%2Fconsultations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nice-digital","download_url":"https://codeload.github.com/nice-digital/consultations/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nice-digital%2Fconsultations/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260294454,"owners_count":22987622,"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-11-10T22:26:57.411Z","updated_at":"2025-06-17T05:05:10.119Z","avatar_url":"https://github.com/nice-digital.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- NB: run `npx doctoc .` to re-generate the ToC --\u003e\n\n# Comment collection\n\n\u003e Our goal is to provide a simple and consistent way of contributing to and collecting stakeholder comments from NICE consultations\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eTable of contents\u003c/strong\u003e\u003c/summary\u003e\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n\n- [What is it?](#what-is-it)\n  - [Background](#background)\n  - [Why are we doing this?](#why-are-we-doing-this)\n  - [Who are our users?](#who-are-our-users)\n  - [What outcome will users get from this service?](#what-outcome-will-users-get-from-this-service)\n  - [What outcome are we looking for?](#what-outcome-are-we-looking-for)\n  - [What are our key metrics?](#what-are-our-key-metrics)\n- [Stack](#stack)\n  - [Architecture](#architecture)\n  - [Technical stack](#technical-stack)\n- [Set up](#set-up)\n  - [Other README files](#other-readme-files)\n  - [Secrets](#secrets)\n  - [Redis server](#redis-server)\n  - [Gotchas](#gotchas)\n- [Tests](#tests)\n- [Entity Framework Migrations](#entity-framework-migrations)\n- [Good to know](#good-to-know)\n  - [Further info](#further-info)\n  - [Environments](#environments)\n  - [Supported by](#supported-by)\n  - [Regenerate the Table of Contents](#regenerate-the-table-of-contents)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c/details\u003e\n  \n## What is it?\nThis service provides a way for NICE stakeholders to comment directly on NICE consultations and documents to provide their viewpoint; and a way for NICE teams to request comments and process them for response which doesn’t require repetitive manual handling.\n\n### Background\n\nConsultation is a key part of developing NICE guidance, including NICE quality standards. The consultation processes enable external organisations and individuals to comment on guidance content at specific stages in the development process, and feed into the decision-making process.\n\n### Why are we doing this?\n\nWhat is our motivation for building this product or service?\n\n- NICE efficiencies\n- Increase stakeholder engagement\n- Improve quality of responses given by NICE\n\n### Who are our users?\n\n- Internal teams at NICE who consult on the guidance they are producing by collecting comments from external stakeholders\n- Our external stakeholders are the people who the guidance and standards that NICE produces affect and who want to provide their views on the development of these, so that their needs and priorities are reflected in the final guidance\n\n### What outcome will users get from this service?\n\nWhat problem will it solve for people?\n\n- Less manual handling when collating comments\n- Less variation for stakeholders between different types of consultation - Secondary\n- Able to comment against specific parts of a document or more generically\n- Easier for NICE to tell which part of the document is being commented on\n\n### What outcome are we looking for?\n\nWhat problem will it solve for our organisation?\n\n- Efficiency savings for NICE by reducing manual handling during collation\n\n### What are our key metrics?\n\nWhat do we need to measure against these outcomes?\n\n- Time taken to collate results\n- End to end time taken for consultation process\n- Number of comments received\n- Number of distinct organisations commenting\n- Improved quality of responses / lower error rate\n\n## Stack\n\n### Architecture\n\nConsultations sits below [Varnish](https://github.com/nice-digital/varnish) so is under the main niceorg domain. It pulls data from [InDev](https://github.com/nice-digital/publicationsindev) via an API and stores data in SQL Server.\n\n\u003c!-- See http://asciiflow.com/ --\u003e\n\n\u003cpre\u003e\n                  +---------+                                          \n        +---------- Varnish -------------+                             \n        |         +----|----+            |                             \n        |              |                 |                             \n        |              |                 |                             \n+-------v------+  +----v----+    +-------v-------+    +---------------+\n| Guidance Web |  | Orchard |    | Consultations -----\u003e SQL Server DB |\n+--------------+  +---------+    +-------^-------+    +---------------+\n                                         |                             \n                                         |                             \n                                         |                             \n                                     +---|---+                         \n                                     | InDev |                         \n                                     +-------+                         \n\u003c/pre\u003e\n\n### Technical stack\n\n- [Varnish](https://varnish-cache.org/) for infrastructure-level routing\n- [.NET Core 2](https://github.com/dotnet/core) on the server\n  - [xUnit.net](https://xunit.net/) for .NET unit tests\n  - [Moq](https://github.com/moq/moq4) for mocking in .NET\n  - [Shouldly](https://github.com/shouldly/shouldly) for .NET assertions\n  - [KDiff](http://kdiff3.sourceforge.net/) for diffing approvals tests\n- [SQL Server](https://www.microsoft.com/en-gb/sql-server/sql-server-2017) as our database\n  - [Entity Framework Core](https://github.com/aspnet/EntityFrameworkCore) as an ORM\n  - [EF Core In-Memory Database Provider](https://docs.microsoft.com/en-us/ef/core/providers/in-memory/) for integration tests\n- [React](https://reactjs.org/) for the UI library\n  - [Create React App](https://github.com/facebook/create-react-app) for configless React\n  - [Jest](https://facebook.github.io/jest/) for JavaScript tests\n  - [ASP.NET Core JavaScript Services](https://github.com/aspnet/JavaScriptServices) for rendering JavaScript server side in .NET\n  - [ESLint](https://eslint.org/) for JavaScript linting\n- [SASS](https://sass-lang.com/) as a CSS pre-processor\n- [Modernizr](https://modernizr.com/) for feature detection\n- [WebdriverIO](http://webdriver.io/) for automated functional testing\n- [NICE Design System](https://nice-digital.github.io/nice-design-system/) for NICE styling\n  - [NICE Icons](https://github.com/nice-digital/nice-icons) for icon webfont\n\n## Set up\n\n1. Install [KDiff](http://kdiff3.sourceforge.net/) to be able see diffs from integration tests\n2. Install [SQL Server](https://www.microsoft.com/sql-server) and [SQL Server Management Studio (SSMS)](https://docs.microsoft.com/sql/ssms/download-sql-server-management-studio-ssms)\n3. Restore Consultations database in SSMS and set account running visual studio as db_owner (Your domain username or SUDO account if running as administrator)\n4. Clone the project `git clone git@github.com:nice-digital/consultations.git`\n5. Open _Consultations.sln_\n6. Paste database connection string into DefaultConnection in secrets.json file (see \"Secrets\" below for format)\n   - right click on project\n   - select 'manage user secrets'\n   - paste contents of secrets.json (from another dev) to replace the defualt text here.\n7. Press F5 to run the project in debug mode\n8. Dependencies will download (npm and NuGet) so be patient on first run\n9. The app will run in IIS Express on http://localhost:52679/\n10. cd into _consultations\\Comments\\ClientApp_\n    run 'npm install --only=dev'\n    run 'npm run build'\n    run `npm start` if Startup is using `UseProxyToSpaDevelopmentServer`. This runs a react dev server on http://localhost:3000/.\n11. Run `npm test` in a separate window to run client side tests in watch mode\n12. If the application has a URL like https://niceorg:44306/ You may need to add a line to your hosts file (C:\\Windows\\System32\\drivers\\etc\\hosts) pointing \"niceorg\" at 127.0.0.1\n13. If you don't have it already, you will need to go into Identity Management for the environment you are working in e.g. https://test-identityadmin.nice.org.uk/ and give youself Administrator access to Consultations.\n14. Install Redis locally on your machine. Instructions below.\n\n### Other README files\n\n-There is another README file in _consultations\\Comments\\ClientApp_ which goes into more detail if `npm start` does not work immediately.\n\n### Secrets\n\n- First try to copy the secrets file from another developer who has had comment collection working before.\n- If you cannot find another developer with a secrets file, you can copy the format below.\n\n```\n{\n  \"ConnectionStrings\": {\n    \"DefaultConnection\": \"\u003cconnection string\u003e\"\n  },\n  \"Logging\": {\n    \"RabbitMQHost\": \"\u003crabbit server URL\u003e\",\n    \"RabbitMQPort\": \"\u003crabbit server port\u003e\",\n    \"IncludeScopes\": false,\n    \"LogFilePath\": \"\u003clog file path\u003e\",\n    \"LogLevel\": {\n      \"Default\": \"Debug\",\n      \"System\": \"Information\",\n      \"Microsoft\": \"Information\"\n    },\n    \"UseRabbit\": false,\n    \"UseFile\": true\n  },\n  \"AppSettings\": {\n    \"Environment\": {\n      \"Name\": \"local\",\n      \"SecureSite\": \"false\"\n    }\n  },\n  \"Feeds\": {\n    \"ApiKey\": \"\u003cindev API key\u003e\",\n    \"IndevBasePath\": \"\u003cindev base path\u003e\",\n    \"IndevPublishedChapterFeedPath\": \"\u003cfeed path\u003e\",\n    \"IndevDraftPreviewChapterFeedPath\": \"\u003cfeed path\u003e\",\n    \"IndevPublishedDetailFeedPath\": \"\u003cfeed path\u003e\",\n    \"IndevDraftPreviewDetailFeedPath\": \"\u003cfeed path\u003e\",\n    \"IndevPublishedPreviewDetailFeedPath\": \"\u003cfeed path\u003e\",\n    \"IndevListFeedPath\": \"\u003cfeed path\u003e\",\n    \"CacheDurationSeconds\": 60,\n    \"IndevIDAMConfig\": {\n      \"Domain\": \"\u003cInDev IDAM Domain\u003e\",\n      \"ClientId\": \"\u003cAuth0 Client Id\u003e\",\n      \"ClientSecret\": \"\u003cAuth0 Client Secret\u003e\",\n      \"APIIdentifier\": \"\u003cAuth0 API Identifier\u003e\"\n    }\n  },\n  \"WebAppConfiguration\": {\n    \"ApiIdentifier\": \"\u003cAuth0 API Identifier for comment collection\u003e\",\n    \"ClientId\": \"\u003cAuth0 Client Id for comment collection\u003e\",\n    \"ClientSecret\": \"\u003cAuth0 Client secret for comment collection\u003e\",\n    \"AuthorisationServiceUri\": \"\u003cAuth0 Authorisation service URI for comment collection\u003e\",\n    \"Domain\": \"\u003cAuth0 Domain comment collection\u003e\",\n    \"PostLogoutRedirectUri\": \"\u003cAuth0 Post Logout Redirect Uri\u003e\",\n    \"RedirectUri\": \"\u003cAuth0 Redirect Uri\u003e\",\n    \"CallBackPath\": \"\u003cAuth0 callback path\u003e\",\n    \"GoogleTrackingId\": \"\u003cgoogle tracking id\u003e\",\n    \"RedisServiceConfiguration\": {\n      \"ConnectionString\": \"\u003credis server URL\u003e\",\n      \"Enabled\": true\n    }\n  },\n  \"Encryption\": {\n    \"Key\": \"\u003cEncryption key for encrypting comment text\u003e\",\n    \"IV\": \"\u003cInitialisation Vector for encrypting comment text\u003e\"\n  },\n  \"PDF\": {\n    \"PDFDocGenServer\": \"\u003cPDF DocGen Server\u003e\"\n  },\n  \"ConsultationList\": {\n    \"DownloadRoles\": {\n      \"AdminRoles\": [ \"\u003cList of Admin roles\u003e\", \"\u003cList of Admin roles\u003e\" ],\n      \"TeamRoles\": [ \"\u003cList of team roles\u003e\", \"\u003cList of team roles\u003e\", \"\u003cList of team roles\u003e\" ]\n    }\n  },\n  \"AWS\": {\n    \"Profile\": \"\u003cAWS Profile\u003e\",\n    \"Region\": \"\u003cAWS Region\u003e\"\n  }\n}\n\n```\n\n### Redis server\n\nThis application uses a data store called Redis to capture and store Tokens from Auth0. You will need to run a local version of Redis using Chocolatey, A docker/podman container or via WSL at a command prompt. Go to [https://redis.io/docs/getting-started/](https://redis.io/docs/getting-started/) to get started, the instructions are well written.\n\n### Gotchas\n\n- `spa.UseReactDevelopmentServer` can be slow so try using `spa.UseProxyToSpaDevelopmentServer(\"http://localhost:3000\");` instead within [Startup.cs](Comments/Startup.cs).\n- Need to ensure that nothing else is running on port 80, otherwise you will encounter a socket exception error when running in debug.\n- Exception: OpenIdConnectAuthenticationHandler: message.State is null or empty. -- caused if login is attempted without redis, clear your cookies and login again.\n- It might take a few F5's, visual studio restarts and cookie clears to get all the various services/applications to start co-operating\n\n## Tests\n\nThe project uses serveral layers of tests:\n\n- C# low-level unit tests, run via xUnit, asserted with Shouldly. See [Comments.Test/UnitTests](Comments.Test/UnitTests).\n- C# 'integration' tests (approval based of server rendered HTML), run via xUnit, asserted with Shouldly, diffed with Kdiff. See [Comments.Test/IntegrationTests](Comments.Test/IntegrationTests).\n- JavaScript unit tests via jest. See [Comments/ClientApp/src](Comments/ClientApp/src).\n- Functional high-level tests, via webdriver.io.\n\n## Entity Framework Migrations\n\nWe use Code first Entity Framework migrations to update the consultations database\n\nTo update the database\n\n- add a new property to the relevent class in Consultations \u003e Comments \u003e Models \u003e EF\n- in visual studio go to Tools \u003e NuGet Package Manager \u003e Package Manager Console\n- in the package manager console window run the command Add-Migration [give your migration a useful name] eg Add-Migration AddCommentCreationDate  \n  This will create a new migrations script in Consultations \u003e Comments \u003e Migrations\n- when the comment collection is next hit the changes in the migration script will be applied to SQL.  \n  A new column will be created in \\_\\_EFMigrationHistory to flag that the migration has been run.\n\n## Good to know\n\n### Further info\n\nSee the [Consultations Sharepoint site](https://niceuk.sharepoint.com/sites/External_Consultations)\n\n### Environments\n\n| Environment | URL                                      |\n| ----------- | ---------------------------------------- |\n| local       | https://local.nice.org.uk/consultations/ |\n| Alpha       | https://alpha.nice.org.uk/consultations/ |\n| Live        | https://www.nice.org.uk/consultations/   |\n\n### Supported by\n\n\u003cimg src=\"https://cdn.worldvectorlogo.com/logos/browserstack.svg\" align=\"left\" width=\"80\" style= \"padding-right: 20px\" alt=\"BrowserStack Logo\"\u003e\nWe're using \u003ca href=\"https://browserstack.com\"\u003eBrowserStack's\u003c/a\u003e support of open source projects for our day-to-day cross-browser and cross-device testing, and as part of an automated CI environment. \u003ca href=\"https://www.browserstack.com/open-source\"\u003eSee their support for open source projects\u003c/a\u003e.\n\n### Regenerate the Table of Contents\n\nFor further information about the recommended ReadMe structure plus a 'how to' for regenerating the table of contents, follow the instructions in [DIT Engineering - ReadMes](https://niceuk.sharepoint.com/sites/DIT_Engineering/SitePages/Readmes.aspx)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnice-digital%2Fconsultations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnice-digital%2Fconsultations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnice-digital%2Fconsultations/lists"}