Skip to content
This repository has been archived by the owner on Aug 27, 2024. It is now read-only.

Latest commit

 

History

History
73 lines (41 loc) · 3.29 KB

README.md

File metadata and controls

73 lines (41 loc) · 3.29 KB

fh-service-directory-ui

A service directory to list the services and family hubs provided by local authorities in the UK.

Set up a development environment

The web site uses two services, the service directory API and postcodes.io.

Service Directory API

The service directory API is a custom DfE API. You can either clone it fron GitHub and run it locally, or use the development API.

The endpoint of the service directory API is retrieved from the ServiceDirectoryAPI:Endpoint config. AppSettings.json contains the default URL when running the API locally.

If you want to use the development API, ask a team member for the endpoint URL and set it in user secrets.

Postcodes.io API

Postcodes.io is an external API that accepts anonymous requests. The correct enpoint is already in the AppSettings.json file, so it should just work.

Regenerate the CSS

The CSS is generated from the SASS (.scss) files. If you are using Visual Studio, any changes to the SASS files should automatically trigger the compilation and minification of the CSS files. In Rider, follow these instructions.

To manually generate and minify the CSS files, run the sass-to-min-css gulp task, or run the sass-to-min-css:watch gulp task to initiate a watcher that will automatically recompile the CSS files when the SASS files are changed.

The entry point for the site's SASS is styles\scss\application.scss.

Regenerate the JavaScript

In Visual Studio, any changes to the Typescript (or JavaScript) files, should automatically trigger the transpiling, bundling and minification of the Javascript files. In Rider, follow these instructions.

The bundling process supports the use of ECMAScript modules.

To manually transpile, bundle and minify the js files, run the js gulp task, or run the js:watch gulp task to initiate a watcher that will automatically run the process when the ts/js files are changed.

The entry point for the site's JavaScript is scripts\app.ts. This file imports the modules that make up the site's JavaScript.

Debugging the JavaScript in Visual Studio

To debug the JavaScript in Visual Studio, set breakpoints in the JavaScript files under the Script documents folder in the Solution Explorer when debugging.

(Note, we might switch to environment-based bundling and minification at a later point.)

Running Lighthouse

Disable any extensions that might interfere with the Lighthouse report, such as Axe Accessibility, WAVE, Google Analytics Debugger etc.

Edit launchsettings.json and add this to the FamilyHubs.ServiceDirectoryUI profile:

        "hotReloadEnabled": false,

Switch to a different profile and then back to the FamilyHubs.ServiceDirectoryUI profile, for the change to take affect.

Run Lighthouse.

Google Analytics

GA4 documentation.

Useful test data

Example Salford LA postcode:

m27 8ss

Example Tower Hamlets LA postcode:

e14 7pq