{"id":27998136,"url":"https://github.com/alphagov/forms-api","last_synced_at":"2025-05-08T22:49:36.357Z","repository":{"id":37086301,"uuid":"475483883","full_name":"alphagov/forms-api","owner":"alphagov","description":"Our core Forms api and datastore","archived":false,"fork":false,"pushed_at":"2025-05-08T18:06:01.000Z","size":1804,"stargazers_count":11,"open_issues_count":8,"forks_count":4,"subscribers_count":16,"default_branch":"main","last_synced_at":"2025-05-08T22:49:24.049Z","etag":null,"topics":["forms","govuk-forms","open-source","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alphagov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2022-03-29T14:37:16.000Z","updated_at":"2025-05-07T16:00:49.000Z","dependencies_parsed_at":"2023-10-12T18:28:56.956Z","dependency_job_id":"657a1e87-afe1-4ba4-9e89-8c630bbe54ce","html_url":"https://github.com/alphagov/forms-api","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alphagov%2Fforms-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alphagov%2Fforms-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alphagov%2Fforms-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alphagov%2Fforms-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alphagov","download_url":"https://codeload.github.com/alphagov/forms-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253160827,"owners_count":21863624,"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":["forms","govuk-forms","open-source","ruby"],"created_at":"2025-05-08T22:49:35.552Z","updated_at":"2025-05-08T22:49:36.340Z","avatar_url":"https://github.com/alphagov.png","language":"Ruby","readme":"![tests status](https://github.com/alphagov/forms-api/actions/workflows/test.yml/badge.svg)\n\n# GOV.UK Forms - API\n\n`forms-api` is the API for the GOV.UK Forms platform. It is a Ruby on Rails api app, currently using a Postgresql database for data storage and is used for storing/serving the form configurations that are created by form creators in [forms-admin](https://github.com/alphagov/forms-admin).\n\n## Before you start\n\nTo run the project you will need to install:\n\n- [Ruby](https://www.ruby-lang.org/en/) - we use version 3.1 of Ruby. Before running the project, double check the [.ruby-version] file to see the exact version.\n- a running [PostgreSQL](https://www.postgresql.org/) database\n\nWe recommend using a version manager to install and manage these, such as:\n\n- [asdf](https://github.com/asdf-vm/asdf) for Ruby (and many other languages)\n- [RVM](https://rvm.io/) or [rbenv](https://github.com/rbenv/rbenv) for Ruby\n\n## Getting started\n\n### Installing for the first time\n\n```bash\n# 1. Clone the git repository and change directory to the new folder\ngit clone git@github.com:alphagov/forms-api.git\ncd forms-api\n\n# 2. Run the setup command\n./bin/setup\n```\n\n### Running the app\n\n```bash\n# Running the server without watching for changes\nbundle exec rails s\n```\n\nThis will start the server on `localhost:9292`\n\n## Configuration and deployment\n\nThe forms-api app is containerised (see [Dockerfile](https://github.com/alphagov/forms-api/blob/main/Dockerfile)) and can be deployed however you would normally deploy a containerised app.\n\n### Testing the project\n\n```bash\n# Run the Ruby test suite\nbundle exec rake\n```\n\n## Secrets vs Settings\n\nRefer to the [the config gem](https://github.com/railsconfig/config#accessing-the-settings-object) to understand the `file based settings` loading order.\n\nTo override file based via `Machine based env variables settings`\n\n```bash\ncat config/settings.yml\nfile\n  based\n    settings\n      env1: 'foo'\n```\n\n```bash\nexport SETTINGS__FILE__BASED__SETTINGS__ENV1=\"bar\"\n```\n\n```ruby\nputs Settings.file.based.setting.env1\nbar\n```\n\nRefer to the [settings file](config/settings.yml) for all the settings required to run this app\n\n## Feature flags\n\nThis repo supports the ability to set up feature flags. To do this, add your feature flag in the [settings file](config/settings.yml) under the `features` property. eg:\n\n```yaml\nfeatures:\n  some_feature: true\n```\n\nYou can then use the [feature service](app/services/feature_service.rb) to check whether the feature is enabled or not. Eg. `FeatureService.enabled?(:some_feature)`.\n\nYou can also nest features:\n\n```yaml\nfeatures:\n  some:\n    nested_feature: true\n```\n\nAnd check with `FeatureService.enabled?(\"some.nested_feature\")`.\n\n### Testing with features\n\nRspec tests can also be tagged with `feature_{name}: true`. This will turn that feature on just for the duration of that test.\n\n## Logging\n\n- HTTP access logs are managed using [Lograge](https://github.com/roidrage/lograge) and configured within [the application config](./config/application.rb)\n- The output format is JSON using the [JsonLogFormatter](./app/lib/json_log_formatter.rb) to enable simpler searching and visbility especially in Splunk.\n- **DO NOT** use [log_tags](https://guides.rubyonrails.org/configuring.html#config-log-tags) since it breaks the JSON formatting produced by Lograge.\n\n## Updating versions\n\nUse the [update_app_versions.sh script in forms-deploy](https://github.com/alphagov/forms-deploy/blob/main/support/update_app_versions.sh)\n\n## Support\n\nRaise a Github issue if you need support.\n\n## How to contribute\n\nWe welcome contributions - please read [CONTRIBUTING.md](CONTRIBUTING.md) and the [alphagov Code of Conduct](https://github.com/alphagov/.github/blob/main/CODE_OF_CONDUCT.md) before contributing.\n\n## License\n\nWe use the [MIT License](https://opensource.org/licenses/MIT).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falphagov%2Fforms-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falphagov%2Fforms-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falphagov%2Fforms-api/lists"}