Giter Club home page Giter Club logo

alphagov.govuk-coronavirus-business-volunteer-form's Introduction

Run tests

GOV.UK Coronavirus Business Volunteer Form

This is an application for submitting a form.

Getting started

The instructions will help you to get the application running locally on your machine.

Prequisites

You will need Postgres installed in order for bundler to install the pg gem (and libpq-dev if on Linux).
You'll need a JavaScript runtime: https://github.com/rails/execjs
Clone the app and run bundle locally.

Running Postgres

Locally

brew install postgres
postgres -D /usr/local/var/postgres

Then set up your local database

rails db:setup

Docker

docker pull postgres
docker run -d -e POSTGRES_PASSWORD=password -e POSTGRES_USER=user -e POSTGRES_DB=coronavirus_form_development -p 5432:5432 postgres

Then set up your Docker database

DATABASE_URL="postgres://user:password@localhost:5432/coronavirus_business_volunteer_form_development" rails db:setup

You'll then need to specify the DATABASE_URL environment variable before the below tasks.

Running Redis

Locally

brew install redis
brew services start redis

Running Sidekiq

We're using Sidekiq, a redis-backed queue, which plays nicely with ActiveJob and ActionMailer, to send emails.

In staging and production, we run instances of the application as workers, to process the email queue.

Locally

Sidekiq will start automatically when you run foreman start, but you can also run it alone with bundle exec sidekiq.

Sending emails locally

You'll need to pass a GOV.UK Notify API key as an environment variable NOTIFY_API_KEY, and change the delivery method in development.rb:

config.action_mailer.delivery_method = :notify

You'll also need to set a GOVUK_NOTIFY_TEMPLATE_ID, which might involve creating a template in Notify if your Notify service doesn't have one.

The template should have a Message of ((body)) only.

Running the application (Postgres will need to be running)

foreman start

Running the tests

bundle exec rake

Deployment pipeline

Every commit to master is deployed to GOV.UK PaaS by this concourse pipeline, which is configured in concourse/pipeline.yml.

The concourse pipeline has credentials for the govuk-forms-deployer user in GOV.UK PaaS. This user has the SpaceDeveloper role, so it can cf push the application.

Exporting data

Data can be exported in JSON format for a single data using a Rake task:

rake export:form_responses["2020-03-26"]

How to deploy breaking changes

Details can be found here.

alphagov.govuk-coronavirus-business-volunteer-form's People

Contributors

alex-ju avatar benthorner avatar bilbof avatar brucebolt avatar chrisbashton avatar danwilliams avatar dependabot-preview[bot] avatar dependabot[bot] avatar gclssvglx avatar gdsnewt avatar hannahjump avatar huwd avatar injms avatar issyl0 avatar jonathanhallam avatar leenagupte avatar murilodalri avatar olliejc avatar quis avatar richardtowers avatar rjbaker avatar rosa-fox avatar sihugh avatar steveholmes avatar theseanything avatar thomasleese avatar venusbb avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.