https://github.com/defra/find-ffa-frontend
Git repository for service find-ffa-frontend
https://github.com/defra/find-ffa-frontend
cdp frontend node service
Last synced: 3 months ago
JSON representation
Git repository for service find-ffa-frontend
- Host: GitHub
- URL: https://github.com/defra/find-ffa-frontend
- Owner: DEFRA
- License: other
- Created: 2024-09-11T12:52:06.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-11-28T16:25:29.000Z (7 months ago)
- Last Synced: 2025-04-05T10:43:03.773Z (3 months ago)
- Topics: cdp, frontend, node, service
- Language: JavaScript
- Size: 1.03 MB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Farming Funding Assistant (FFA) Frontend
Note that this is port of https://github.com/DEFRA/fcp-find-ai-frontend, which he been configured to run in CDP. It therefore doesn't follow the usual CDP template and code conventions
## Prerequisites
- Docker
- Docker Compose## Local Development
Install local dependencies
```BASH
npm i
```Copy and populate .env file (api keys will need to be added in manually)
```BASH
cp .env.example .env
```Spin up docker container
```BASH
docker compose up
### or to launch in the background:
docker compose up -d
```Build frontend assets
```BASH
npm run build
```Run application on http://localhost:3000/
## Running the application
### Build container image
When using the Docker Compose files in development the local `app` folder will
be mounted on top of the `app` folder within the Docker container, hiding the CSS files that were generated during the Docker build. For the site to render correctly locally `npm run build` must be run on the host system. This will run `webpack` build and prevents `_layout.njk` file being replaced by volume mapping in `docker-compose.override.yaml`.By default, the start script will build (or rebuild) images so there will
rarely be a need to build images manually. However, this can be achieved
through the Docker Compose
[build](https://docs.docker.com/compose/reference/build/) command:```
# Build container images
docker compose build
````### Start
Use Docker Compose to run service locally.
```
docker compose up
```## Test structure
The tests have been structured into subfolders of `./test` as per the
[Microservice test approach and repository structure](https://eaflood.atlassian.net/wiki/spaces/FPS/pages/1845396477/Microservice+test+approach+and+repository+structure)### Running tests
A convenience script is provided to run automated tests in a containerised
environment. This will rebuild images before running tests via docker-compose,
using a combination of `docker-compose.yaml` and `docker-compose.test.yaml`.
The command given to `docker-compose run` may be customised by passing
arguments to the test script.Examples:
```
# Run all tests
scripts/test# Run tests with file watch
scripts/test -w
```## CI pipeline
This service uses github actions, as per CDP standard. See `.github`
## Licence
THIS INFORMATION IS LICENSED UNDER THE CONDITIONS OF THE OPEN GOVERNMENT LICENCE found at:
The following attribution statement MUST be cited in your products and applications when using this information.
> Contains public sector information licensed under the Open Government license v3
### About the licence
The Open Government Licence (OGL) was developed by the Controller of Her Majesty's Stationery Office (HMSO) to enable information providers in the public sector to license the use and re-use of their information under a common open licence.
It is designed to encourage use and re-use of information freely and flexibly, with only a few conditions.