{"id":20038776,"url":"https://github.com/defra/pafs-user","last_synced_at":"2025-05-05T07:32:22.290Z","repository":{"id":37431110,"uuid":"52283440","full_name":"DEFRA/pafs-user","owner":"DEFRA","description":"Project Application and Funding Service Front End code","archived":false,"fork":false,"pushed_at":"2025-04-17T16:55:07.000Z","size":1144,"stargazers_count":2,"open_issues_count":43,"forks_count":1,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-04-18T07:02:04.601Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","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":"CHANGELOG.md","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,"zenodo":null}},"created_at":"2016-02-22T15:32:14.000Z","updated_at":"2025-04-17T16:55:11.000Z","dependencies_parsed_at":"2023-02-19T04:01:29.663Z","dependency_job_id":"895d7fb0-46bd-4140-b468-6d2722818723","html_url":"https://github.com/DEFRA/pafs-user","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DEFRA%2Fpafs-user","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DEFRA%2Fpafs-user/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DEFRA%2Fpafs-user/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DEFRA%2Fpafs-user/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DEFRA","download_url":"https://codeload.github.com/DEFRA/pafs-user/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252458573,"owners_count":21751063,"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:45.277Z","updated_at":"2025-05-05T07:32:21.756Z","avatar_url":"https://github.com/DEFRA.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Project Application and Funding Service\n\n[![CI](https://github.com/DEFRA/pafs-user/actions/workflows/ci.yml/badge.svg)]((https://github.com/DEFRA/pafs-user/actions/workflows/ci.yml))\n\nThe Project Application and Funding Service (PAFS) is used by regional management authorities to apply for funding for flood and coastal risk management projects.\n\nThe application sends emails using the Send-grid e-mail service.\n\n## PAFS Documentation\n\nFor a full breakdown of the PAFS documentation, technical and non technical please click the [link](https://aimspd.sharepoint.com/sites/pwa_dev/AIMS%20Project%20Delivery%20Collaboration/_layouts/15/guestaccess.aspx?docid=08fcc88cb3f7c45b48a274bf0ea4132f5\u0026authkey=AWuSgciHOQlICM9DP0JtdRA)\n\n## Development Environment\n\n### Install global system dependencies\n\nThe following system dependencies are required, regardless of how you install the development environment.\n\n* [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)\n* [git-flow](https://github.com/nvie/gitflow/wiki/Installation)\n\n### Obtain the source code\n\nClone the repository, copying the project into a working directory:\n\n    git clone https://github.com/EnvironmentAgency/pafs-user.git\n    cd pafs-user\n\nWe use \"git flow\" to manage development and features branches.\nTo initialise git flow for the project, you need to run:\n\n    git checkout -t origin/main\n    git flow init # choose the defaults\n    git checkout develop\n\nSee the [Wiki page on Git Flow](https://github.com/EnvironmentAgency/waste-exemptions/wiki/Git-Flow),\nfor more information about our branching strategy.\n\n### Local Installation\n\n#### Local system dependencies\n\n* [Ruby 3.2.2](https://www.ruby-lang.org) (e.g. via [RVM](https://rvm.io) or [Rbenv](https://github.com/sstephenson/rbenv/blob/master/README.md))\n* [Postgresql](http://www.postgresql.org/download)\n* [Phantomjs](https://github.com/teampoltergeist/poltergeist#installing-phantomjs) (test specs)\n\n#### Application gems _(local)_\n\nRun the following to download the app dependencies ([rubygems](https://www.ruby-lang.org/en/libraries/))\n\n    cd \u003cpafs-project-directory\u003e\n    gem install bundler\n    bundle install\n\n#### .env configuration file\n\nThe project uses the [dotenv](https://github.com/bkeepers/dotenv) gem which allows enviroment variables to be loaded from a ```.env``` configuration file in the project root.\n\nDuplicate ```./dotenv.example``` and rename the copy as ```./.env```. Open it and update SECRET_KEY_BASE and settings for database, email etc. - Secret Key base can be anything\n\n#### Databases _(local)_\n\nThere are several databases per environment, therefore, ensure you run the following:\n\n    bundle exec rake db:create:all\n    bundle exec rake db:schema:load\n    bundle config local.pafs_core /path/to/local/pafs_core\n    bundle\n\n#### Start the service _(local)_\n\nTo start the service locally simply run:\n\n    bundle exec rails server\n\nYou can then access the web site at \u003chttp://localhost:3000\u003e\n\n#### Intercepting email in development\n\nYou can use mailcatcher to trap and view outgoing email.\n\nMake sure you have the following in your `.env` or `.env.development` file:\n\n    SECRET_KEY_BASE=''\n    DATABASE_USERNAME=''\n    DATABASE_PASSWORD=''\n    DEVISE_USER_SEPARATE_DB=''\n    DEVISE_MAILER_SENDER=''\n    AIRBRAKE_HOST=''\n    AIRBRAKE_PROJECT_KEY=''\n    GOOGLE_ANALYTICS_ID=''\n    EMAIL_USERNAME=''\n    EMAIL_PASSWORD=''\n    EMAIL_APP_DOMAIN=''\n    EMAIL_HOST=''\n    EMAIL_PORT=''\n    ENABLE_USER_AREAS=''\n\nStart mailcatcher with `$ mailcatcher` and navigate to\n[http://127.0.0.1:1080](http://127.0.0.1:1080) in your browser.\n\nNote that [mail_safe](https://github.com/myronmarston/mail_safe) maybe also be running in which\ncase any development email will seem to be sent to your global git config email address.\n\n#### Setting an known state for our environments\n\nThere are times when we require our environments to be cleared of projects and put into a known state.\nThis is typical when we require that the service has no proposals, or their associated data.\n\nThe following command (`bundle exec projects:delete_all`) will remove all proposals from the service, leaving the existing users and their associated area's intact.\n\n## Quality\n\nWe use tools like [rubocop](https://github.com/bbatsov/rubocop), [brakeman](https://github.com/presidentbeef/brakeman), and [i18n-tasks](https://github.com/glebm/i18n-tasks) to help maintain quality, reusable code. Rather than running them manually we automate it via GitHub actions.\n\n## Tests\n\nWe use [RSpec](http://rspec.info/) for unit testing, and intend to use [Cucumber](https://github.com/cucumber/cucumber-rails) for our acceptance testing.\n\n### Test database seeding\n\nBefore executing the tests for the first time, you will need to seed the database:\n\n    bundle exec rake db:seed RAILS_ENV=test\n\nTo execute the unit tests simply enter:\n\n    rspec\n\nAs this point we have no acceptance tests but when we do they can be executed using:\n\n    cucumber\n\n### Production debugging\n\n#### Rails console\n\nTo launch a rails console on a deployed server, the environment variables might need to be loaded from a different directory\n\nFor example:\n`. ../../.exportedenv \u0026\u0026 RAILS_ENV=production bundle exec rails console`\n\n#### Logging\n\nCurrently (15 Jun 2021), no logs are written to the `production.log`. This should be fixed.\n\n#### File upload errors\n\nWhen the file upload fails, the user sees a 'cookies' error. This might come from an `InvalidAuthenticityToken`, which might also come from a Clam AV error.\nIt's worth checking that the Clam AV service is running: \u003chttps://github.com/franckverrot/clamav-client#ping--boolean\u003e\n\n## End of year maintenance routine\n\nA maintenance routine needs to be run each April at the start of the new financial year to remove all previous year’s data for return to ‘draft’ \u0026 ‘archived’ projects. PMs are expected to re-profile their ‘funding’ \u0026 ‘risks and properties benefitting’ requirements to current and future years. It will remove all years before current financial year.\n\nThe rake task to run is `pafs:remove_previous_years[max_records]` where `max_records` is the number of records to process e.g. `pafs:remove_previous_years[10000]`.\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\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 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%2Fpafs-user","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdefra%2Fpafs-user","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefra%2Fpafs-user/lists"}