Code Monkey home page Code Monkey logo

govuk-coronavirus-vulnerable-people-form's Introduction

Run tests

CoronavirusForm

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'll need an Amazon DynamoDB local instance running in a docker container.

You'll need a JavaScript runtime: https://github.com/rails/execjs
Clone the app and run bundle locally.

Running DynamoDB

Docker

Run the following to set up the local version of DynamoDB

    docker pull amazon/dynamodb-local
    docker run -d -p 8000:8000 amazon/dynamodb-local

Running the application (DynamoDB will need to be running)

foreman start

Running the tests

bundle exec rake

VCR

Some of our tests use VCR to generate stubbed responses. Read about how to test with VCR.

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 or SMSs locally

Change the delivery method in development.rb:

config.action_mailer.delivery_method = :notify_email

You'll then need to pass a GOV.UK Notify API key as an environment variable NOTIFY_API_KEY as well the GOVUK_NOTIFY_EMAIL_TEMPLATE_ID and GOVUK_NOTIFY_SMS_TEMPLATE_ID template IDs.

You can create an api key here: https://www.notifications.service.gov.uk/services/6ba785b8-71e0-4d0e-9f41-b7aa8876e5a9/api/keys

Make sure to pick either "Team and whitelist" or "Testing". The api key can be revoked later.

If you're testing SMS as well, make sure you have a mobile number associated with your Notify profile.

Running the app

GOVUK_NOTIFY_EMAIL_TEMPLATE_ID=<email_template_id_from_notify> GOVUK_NOTIFY_SMS_TEMPLATE_ID=<sms_template_id_from_notify> NOTIFY_API_KEY=<your_api_key> foreman start

If your Notify service doesn't have a template you'll need to create a template in Notify.

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

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.

How to deploy breaking changes

Details can be found here.

Licence

MIT License

govuk-coronavirus-vulnerable-people-form's People

Contributors

alex-ju avatar bilbof avatar brucebolt avatar chrisbashton avatar danwilliams avatar dependabot-preview[bot] avatar gclssvglx avatar gdsnewt avatar huwd avatar injms avatar issyl0 avatar jonathanhallam avatar jpluscplusm avatar kevindew avatar leenagupte avatar m-green avatar murilodalri avatar nickcolley avatar nooshu avatar olliejc avatar pixeltrix avatar richardtowers avatar rosa-fox avatar stephengill avatar steveholmes avatar theseanything avatar timpaul avatar

Watchers

 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.