{"id":20038732,"url":"https://github.com/defra/fws-app","last_synced_at":"2026-01-26T18:07:12.003Z","repository":{"id":36272236,"uuid":"167327783","full_name":"DEFRA/fws-app","owner":"DEFRA","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-24T14:38:18.000Z","size":2190,"stargazers_count":3,"open_issues_count":8,"forks_count":1,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-10-25T18:43:24.222Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DEFRA.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}},"created_at":"2019-01-24T08:03:59.000Z","updated_at":"2024-08-13T13:09:39.000Z","dependencies_parsed_at":"2024-05-16T16:28:00.774Z","dependency_job_id":"ac5456fa-081f-4dd2-9e35-e86a35fb2360","html_url":"https://github.com/DEFRA/fws-app","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DEFRA%2Ffws-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DEFRA%2Ffws-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DEFRA%2Ffws-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DEFRA%2Ffws-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DEFRA","download_url":"https://codeload.github.com/DEFRA/fws-app/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224431754,"owners_count":17310200,"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-13T10:32:22.640Z","updated_at":"2026-01-26T18:07:11.998Z","avatar_url":"https://github.com/DEFRA.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Build status](https://github.com/DEFRA/fws-app/actions/workflows/ci.yml/badge.svg)[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=DEFRA_fws-app\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=DEFRA_fws-app)[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=DEFRA_fws-app\u0026metric=coverage)](https://sonarcloud.io/dashboard?id=DEFRA_fws-app)\n\n# fws-app\nThis is the FWIS management tool\n\n# Environment variables\n\n| name               | description           | required |        default        |       valid        | notes |\n|--------------------|------------------     |:--------:|-----------------------|:------------------:|-------|\n| FWS_ENV_NAME       | Environment name      |    no    | dev                   | dev,tst,pre,prd    |       |\n| PORT               | Port number           |    no    | 3000                  |                    |       |\n| FWS_API_URL        | API url               |    yes   |                       |                    |       |\n| FWS_API_KEY        | API key               |    yes   |                       |                    |       |\n| FWS_APP_PROXY      | Proxy                 |    no    |                       |                    |       |\n| AD_CLIENT_ID       | AD Client Id          |    yes   |                       |                    |       |\n| AD_CLIENT_SECRET   | AD Client Secret      |    yes   |                       |                    |       |\n| AD_TENANT          | AD Tenant             |    yes   |                       |                    |       |\n| AD_COOKIE_PASSWORD | Cookie password       |    yes   |                       |                    |       |\n| IS_SECURE          | Secure cookie         |    no    | false                 |                    |       |\n| FORCE_HTTPS        | Force https           |    no    | false                 |                    |       |\n| HOME_PAGE          | Home page             |    no    | http://localhost:3000 |                    |       |\n| LOCAL_CACHE        | Force local cache     |    no    | true                  |                    |       |\n| REDIS_HOST         |                       |    no    |                       |                    |       |\n| REDIS_PORT         |                       |    no    |                       |                    |       |\n| REDIS_TLS          |                       |    no    | false                 |                    |       |\n| FWS_APP_GA_ID      | Google analytics Id   |    no    |                       |                    |       |\n\n# Prerequisites\n\nNode v22+\n\n# Running the application\n\nFirst build the application using:\n\n`$ npm run build`\n\nThis will build the css based on the `govuk-frontend` scss/styles.\n\nNow the application is ready to run:\n\n`$ node index.js`\n\n# Docker Setup\n\n## Prerequisites\n\n- Docker and Docker Compose installed\n- Python virtual environment (required for fws-api setup)\n- [fws-api](https://github.com/DEFRA/fws-api) cloned as a sibling directory to fws-app\n\n## Quick Start\n\n**_NOTE:_** The fws-api localstack debugging must be disabled by ensuring that `LAMBDA_DOCKER_FLAGS` is not defined in https://github.com/DEFRA/fws-api/blob/development/docker/.env\n\nThe easiest way to run fws-app with Docker is using the automated startup script:\n\n```bash\n# 1. Activate your Python virtual environment\nsource ~/environments/my_env/bin/activate\n\n# 2. Configure environment variables\n# Copy docker/.env.example to docker/.env and populate the required secrets:\n# - AD_CLIENT_ID\n# - AD_CLIENT_SECRET\n# - AD_TENANT\n# - AD_COOKIE_PASSWORD\n\n# 3. Run the startup script\n./docker/scripts/start-local.sh\n```\n\nThe `start-local.sh` script will:\n1. Validate all required environment variables are set\n2. Bootstrap the fws-api in LocalStack (`npm run bootstrap-debug`)\n3. Auto-populate the `FWS_API_URL` from LocalStack\n4. Build and start all Docker services\n5. Display the application URL: http://localhost:3000\n\nTo stop and teardown the local environment:\n\n```bash\n./docker/scripts/stop-local.sh\n```\n\nThe `stop-local.sh` script will:\n1. Stop and remove all Docker containers\n2. Teardown the fws-api in LocalStack (`npm run teardown`)\n3. Display completion message\n\n### Debugging\n\n```json\n// The development base of the webapp exposes debug port 9229 so add this to your .vscode/launch.json file for debugging:\n{\n  \"type\": \"node\",\n  \"request\": \"attach\",\n  \"name\": \"Attach to Docker\",\n  \"address\": \"localhost\",\n  \"port\": 9229,\n  \"localRoot\": \"${workspaceFolder}\",\n  \"remoteRoot\": \"/app\"\n}\n```\n\n## Manual Docker Commands\n\n### Build the fws-app image only\n\n```bash\ndocker build -f docker/Dockerfile -t fws-app:latest --target development .\n```\n\n### Run with Docker Compose\n\n```bash\n# Start all services (Redis + fws-app)\ndocker compose -f docker/infrastructure.yml -f docker/app.yml up -d\n\n# Start with rebuild\ndocker compose -f docker/infrastructure.yml -f docker/app.yml up -d --build\n\n# Stop all services\ndocker compose -f docker/infrastructure.yml -f docker/app.yml down\n```\n\n### Start individual services\n\n```bash\n# Start only Redis\ndocker compose -f docker/infrastructure.yml up -d fws-app-redis\n\n# Start only fws-app\ndocker compose -f docker/app.yml up -d fws-app\n```\n\n## Configuration\n\nEnvironment variables are managed in `docker/.env`. See the Environment Variables section above for required values.\n\n**Note:** Never commit secrets to `docker/.env`. A pre-commit hook is available to prevent this:\n\n```bash\n./install-hooks.sh\n```\n\n## Helper Scripts\n\n- `docker/scripts/start-local.sh` - Full automated setup and startup\n- `docker/scripts/stop-local.sh` - Full automated teardown and cleanup\n- `docker/scripts/update-localstack-url.sh` - Update FWS_API_URL from LocalStack\n\n## Network Configuration\n\nThe fws-app container connects to:\n- **default network** - For communication with fws-app-redis\n- **docker_ls (LocalStack network)** - For communication with the fws-api in LocalStack\n\nEnsure LocalStack is running before starting fws-app if you need API connectivity.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefra%2Ffws-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdefra%2Ffws-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefra%2Ffws-app/lists"}