{"id":20038742,"url":"https://github.com/defra/flood-risk-front-office","last_synced_at":"2025-05-05T07:32:19.604Z","repository":{"id":7040597,"uuid":"55979699","full_name":"DEFRA/flood-risk-front-office","owner":"DEFRA","description":"The public facing Flood risk activity exemptions service","archived":false,"fork":false,"pushed_at":"2024-10-28T15:52:26.000Z","size":717,"stargazers_count":2,"open_issues_count":8,"forks_count":1,"subscribers_count":10,"default_branch":"main","last_synced_at":"2024-10-28T17:36:05.411Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":false,"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":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","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":"2016-04-11T14:32:33.000Z","updated_at":"2024-10-28T15:51:24.000Z","dependencies_parsed_at":"2023-02-15T13:01:29.045Z","dependency_job_id":"f5e70367-c606-415f-acc7-2525f740a6ef","html_url":"https://github.com/DEFRA/flood-risk-front-office","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DEFRA%2Fflood-risk-front-office","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DEFRA%2Fflood-risk-front-office/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DEFRA%2Fflood-risk-front-office/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DEFRA%2Fflood-risk-front-office/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DEFRA","download_url":"https://codeload.github.com/DEFRA/flood-risk-front-office/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224431758,"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:25.221Z","updated_at":"2024-11-13T10:32:25.956Z","avatar_url":"https://github.com/DEFRA.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flood Risk Front Office\n\n![Build Status](https://github.com/DEFRA/flood-risk-front-office/workflows/CI/badge.svg?branch=main)\n[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=DEFRA_flood-risk-front-office\u0026metric=sqale_rating)](https://sonarcloud.io/dashboard?id=DEFRA_flood-risk-front-office)\n[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=DEFRA_flood-risk-front-office\u0026metric=coverage)](https://sonarcloud.io/dashboard?id=DEFRA_flood-risk-front-office)\n[![Licence](https://img.shields.io/badge/Licence-OGLv3-blue.svg)](http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3)\n\nA Ruby on Rails application delivering the [Flood risk activity exemptions service](https://register-flood-risk-exemption.service.gov.uk).\n\nThis is a thin, host application which merely mounts and provides styling for the [flood_risk_engine](https://github.com/DEFRA/flood-risk-engine) rails engine. The engine is responsible for the service implementation.\n\n## Prerequisites\n\nPlease make sure the following are installed:\n\n- [Ruby 2.3.1](https://www.ruby-lang.org) installed for example via [RVM](https://rvm.io) or [Rbenv](https://github.com/sstephenson/rbenv/blob/master/README.md)\n- [Bundler](http://bundler.io/)\n- [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)\n- [Postgresql](http://www.postgresql.org/download)\n- [Phantomjs](https://github.com/teampoltergeist/poltergeist#installing-phantomjs)\n\n## Installation\n\nClone the repository and install its gem dependencies:\n\n```bash\ngit clone https://github.com/DEFRA/flood-risk-front-office.git\ncd flood-risk-front-office\nbundle\n```\n\n### .env\n\nThe project uses the [dotenv](https://github.com/bkeepers/dotenv) gem to load environment variables when the app starts. **Dotenv** expects to find a `.env` file in the project root.\n\nDuplicate `.env.example` and rename the copy as `.env`\n\nOpen it and update `SECRET_KEY_BASE` and the settings for database, email etc.\n\nIf Google analytics is required, uncomment the line `GOOGLE_ANALYTICS_ID=ABC-DEFGHI` and replace ABC-DEFGHI with the required Google tag.\n\n### Database\n\nThe usual rails commands can be used to manage the databases for example\n\n```bash\nbundle exec rake db:create\nbundle exec rake db:migrate\nbundle exec rake db:seed\n```\n\nAdd `RAILS_ENV=test` to the commands when preparing the test database.\n\n### Geospatial Queries\n\nThe engine uses [PostGIS](https://postgis.net/) [rgeo](https://rubygems.org/gems/rgeo) for geospatial queries. The [activerecord-postgis-adapter](https://github.com/rgeo/activerecord-postgis-adapter) gem adds geospatial datatypes to PotgreSQL and supports geospatial queries. The adapter is enabled for this application by defining the database adapter as `postgis` instead of `postgresql` in `database.yml`:\n\n```\nadapter: postgis\n```\n\nNote that postgis is also required when running automated unit tests within GitHub CI. To support this, `ci.yml` specifies the use of a docker image which runs `PostgreSQL` with the `postgis` adapter:\n\n```\nimage: postgis/postgis:10-2.5\n```\n\n## Running the app\n\nTo start the service locally run\n\n```bash\nbundle exec rails s\n```\n\nYou can then access the web site at http://localhost:3000\n\n## Tests\n\nWe use [RSpec](http://rspec.info/) and focus on feature tests in this project that go through the journey for each organisation type (unit testing is done in [flood _risk_engine](https://github.com/DEFRA/flood-risk-engine) and acceptance tests in [Flood risk acceptance tests](https://github.com/DEFRA/flood-risk-acceptance-tests)).\n\nTo run [Rubocop](https://github.com/bbatsov/rubocop) and the test suite\n\n```bash\nbundle exec rake\n```\n\nTo run just the tests\n\n```bash\nbundle exec rake spec\n```\n\n## Quality and conventions\n\nThe project is linked to [Travis CI](https://travis-ci.org/DEFRA/flood-risk-front-office) and all pushes to the **GitHub** are automatically checked.\n\nThe checks include running all tests plus **Rubocop**, but also tools like [HTLMHint](https://github.com/yaniswang/HTMLHint) and [i18n-tasks](https://github.com/glebm/i18n-tasks). Check the `.travis.yml` for full details, specifically the `before_script:` section.\n\nIt is left to each developer to setup their environment such that these checks all pass before presenting their code for review and merging.\n\n## Contributing to this project\n\nIf you have an idea you'd like to contribute please log an issue.\n\nAll contributions should be submitted via a pull request.\n\n## License\n\nTHIS INFORMATION IS LICENSED UNDER THE CONDITIONS OF THE OPEN GOVERNMENT LICENCE found at:\n\nhttp://www.nationalarchives.gov.uk/doc/open-government-licence/version/3\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 license\n\nThe 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.\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%2Fflood-risk-front-office","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdefra%2Fflood-risk-front-office","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefra%2Fflood-risk-front-office/lists"}