{"id":22369170,"url":"https://github.com/defra/land-grants-api","last_synced_at":"2026-05-16T17:36:34.562Z","repository":{"id":266482826,"uuid":"898476570","full_name":"DEFRA/land-grants-api","owner":"DEFRA","description":"Git repository for service land-grants-api","archived":false,"fork":false,"pushed_at":"2025-03-25T17:27:12.000Z","size":1703,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-25T18:33:26.630Z","etag":null,"topics":["backend","cdp","node","service"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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":null,"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":"2024-12-04T13:16:00.000Z","updated_at":"2025-03-21T10:07:13.000Z","dependencies_parsed_at":"2025-02-10T17:22:09.381Z","dependency_job_id":"69792abd-dc5e-4448-b37e-101fed84d264","html_url":"https://github.com/DEFRA/land-grants-api","commit_stats":null,"previous_names":["defra/land-grants-api"],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DEFRA%2Fland-grants-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DEFRA%2Fland-grants-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DEFRA%2Fland-grants-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DEFRA%2Fland-grants-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DEFRA","download_url":"https://codeload.github.com/DEFRA/land-grants-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245689507,"owners_count":20656417,"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":["backend","cdp","node","service"],"created_at":"2024-12-04T19:18:00.506Z","updated_at":"2025-10-12T22:57:25.964Z","avatar_url":"https://github.com/DEFRA.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Land Grants API\n\nTo read more about the farming grants platform, see this docs repo:\n\nhttps://github.com/DEFRA/farming-grants-docs\n\nTo read more about Land Grants API see\nhttps://github.com/DEFRA/farming-grants-docs/docs/projects/land-grants-api\n\nor the same on confluence:\nhttps://eaflood.atlassian.net/wiki/spaces/LGS/pages/5866356750/Land+Grants+Service+Home\n\nThe capabilities of the `land-grants-api` include:\n\n- [Available area calculation](docs/available-area-calculation.md)\n- [Land based grant application eligibility checks](docs/eligibility-checks.md)\n- [Grant payment calculations](docs/payment-calculation.md)\n\n## Contents\n\n- [Working wiith qgis](docs/working-wiith-qgis.md)\n\n## Requirements\n\n### Node.js\n\nPlease install [Node.js](http://nodejs.org/) `\u003e= v18` and [npm](https://nodejs.org/) `\u003e= v9`. You will find it\neasier to use the Node Version Manager [nvm](https://github.com/creationix/nvm)\n\nTo use the correct version of Node.js for this application, via nvm:\n\n```bash\ncd land-grants-api\nnvm use\n```\n\n## Local development\n\n### Configuration\n\nAn `.env` is NOT required for running the API locally, all the config values are defaulted to a local setup, unless developer/user wants to override these for testing; if so see `env.example`.\n\n### Setup\n\nInstall application dependencies:\n\n```bash\nnpm install\n```\n\n### Download the land data\n\n1. Download the `sql` files from [sharepoint]('https://defra.sharepoint.com/teams/Team1645/Restricted_FCP%20RPS%20Future/Forms/AllItems.aspx?id=%2Fteams%2FTeam1645%2FRestricted%5FFCP%20RPS%20Future%2Fland%2Dgrant%2Dapi%2Ddata\u0026viewid=f5678bbd%2Dae3a%2D4cd4%2D9f4c%2Dab8e79452a94\u0026ovuser=770a2450%2D0227%2D4c62%2D90c7%2D4e38537f1102%2CJilly%2EGledhill%40defra%2Egov%2Euk\u0026OR=Teams%2DHL\u0026CT=1733739622621\u0026clickparams=eyJBcHBOYW1lIjoiVGVhbXMtRGVza3RvcCIsIkFwcFZlcnNpb24iOiI0OS8yNDEwMjAwMTMxOCIsIkhhc0ZlZGVyYXRlZFVzZXIiOmZhbHNlfQ%3D%3D'), talk to a collegue if you do not have access.\n\n2. Copy these files to to the `src/api/common/migration` folder\n\nThe api uses [Liquibase](https://docs.liquibase.com/home.html) for db migrations, the `changelog` folder contains our current `postgres` schema\n\n### Development\n\nIn order to run the api, you will need `docker` installed, so please make sure this is running when either running the setup or starting the api.\n\nTo run the application in `development` mode run the following commands:\n\n#### Create database\n\nYou are only required to run this once, unless the schema changes.\n\nThis script:\n\n- will start a dockerised postgres database\n- extract the data seed files into the changelog folder\n- run the liquibase migration, creating the tables\n\n```bash\nnpm run dev:setup\n```\n\n#### Start the api\n\nThis script will start the api\n\n```bash\nnpm run dev\n```\n\n#### Seed data\n\nThe seed data is in `src/api/common/migration` and are compressed sql files.\n\nThey are uncompressed when you run `npm run dev:setup` or the db tests, and are instered as part of the migrations.\n\nWhen updating seed data we cannot update the existing files, we will need to create a new migration updating the seed data.\n\n### Testing\n\nIn order to run the `db tests` please make sure you have `docker` running\n\nIn order to run all the tests\n\n```bash\nnpm run test\n```\n\nWe can also run these individually for `unit` and `db`\n\n```bash\nnpm run test:unit\n```\n\n```bash\nnpm run test:db\n```\n\n## API endpoints\n\nThis API includes swagger documentation, this can be viewed at:\n\n`http://{host_name}:3001/documentation`\n\n### Production\n\nTo mimic the application running in `production` mode locally run:\n\n```bash\nnpm start\n```\n\n### Npm scripts\n\nAll available Npm scripts can be seen in [package.json](./package.json).\nTo view them in your command line run:\n\n```bash\nnpm run\n```\n\n### Update dependencies\n\nTo update dependencies use [npm-check-updates](https://github.com/raineorshine/npm-check-updates):\n\n\u003e The following script is a good start. Check out all the options on\n\u003e the [npm-check-updates](https://github.com/raineorshine/npm-check-updates)\n\n```bash\nncu --interactive --format group\n```\n\n### Formatting\n\n#### Windows prettier issue\n\nIf you are having issues with formatting of line breaks on Windows update your global git config by running:\n\n```bash\ngit config --global core.autocrlf false\n```\n\n### Dependabot\n\nWe have added an example dependabot configuration file to the repository. You can enable it by renaming\nthe [.github/example.dependabot.yml](.github/example.dependabot.yml) to `.github/dependabot.yml`\n\n### SonarCloud\n\nInstructions for setting up SonarCloud can be found in [sonar-project.properties](./sonar-project.properties)\n\n## Licence\n\nTHIS INFORMATION IS LICENSED UNDER THE CONDITIONS OF THE OPEN GOVERNMENT LICENCE found at:\n\n\u003chttp://www.nationalarchives.gov.uk/doc/open-government-licence/version/3\u003e\n\nThe following attribution statement MUST be cited in your products and applications when using this information.\n\n\u003e Contains public sector information licensed under the Open Government license v3\n\n### About the licence\n\nThe Open Government Licence (OGL) was developed by the Controller of Her Majesty's Stationery Office (HMSO) to enable\ninformation providers in the public sector to license the use and re-use of their information under a common open\nlicence.\n\nIt is designed to encourage use and re-use of information freely and flexibly, with only a few conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefra%2Fland-grants-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdefra%2Fland-grants-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefra%2Fland-grants-api/lists"}