Skip to content

communitiesuk/ukraine-sponsor-resettlement

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3,133 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ukraine Sponsor Resettlement

This is the codebase for the Ruby on Rails app that will handle the submission of sponsorship requests.

Table of Contents

Deployment Pipeline

Prod Deployment Pipeline Staging Deployment Pipeline

System Context Diagram

The, C4 system context diagram is intended to show, at the highest level, the key users and interactions in the system.

C4 Context diagram

Container Diagram

The, C4 container diagram is intended to zoom in from the system boundary, at the highest level, to provide further detail for the technical audience.

C4 Container diagram

Component Diagram

The, C4 Component diagram is intended to zoom in from the system boundary, at the highest level, to provide further detail for the technical audience.

C4 Component diagram

Monitoring

Alerting

Alerts are configured in CloudWatch, and push to PagerDuty via a SNS topic. Sentry also creates incidents in PagerDuty on new errors.

PagerDuty incidents go to the #msp-live-service-alerts channel in Made Tech's Slack instance

Development

Pre-requisites

  • Docker
  • asdf
  • Ruby (recommend installing rbenv to install/manage the Ruby version)

Getting started

First time

You may need to install some supporting packages (note the instructions from brew re adding them to your PATH):

brew install icu4c libpq

Install required runtimes, dependencies etc:

make prepare

Every time

Running locally

To run the web application natively outside of a docker container on your machine:

make run

This will automatically pick up any changes you make to the code, and is an easier development workflow for frequent changes.

The Rails server should start on http://localhost:8080

Either visit http://localhost:8080/sponsor-a-child/ or http://localhost:8080/expression-of-interest/

Running via Docker

To build and tag the web application image:

docker build . -t ukraine-sponsor-resettlement

To run the web application and all it's dependencies:

make run-webapp-docker

This is a more consistent running process with what the github actions pipelines run and what gets deployed to production, but does not pick up code changes until you re-build the image and restart the webapp container.

You can also run the image from a remote ECR repo in AWS by first authenticating docker against the remote repo and then passing the image URI from ECR via the WEBAPP_IMAGE environment variable.

Running tests

Unit tests

Run:

make test

NB: This builds a Docker image and sets up an environment for running tests depending on PostgresQL, Redis and S3.

The coverage report will be copied to ./coverage.

Running Automated tests (End-to-End tests)

This repository features automated tests run using Cypress

To run the cypress tests against a running instance of the web application:

make cypress-e2e-test

Detailed end-to-end tests setup and instructions

Database migrations

Database migrations are required to make changes to the database

make db-migrate

Or to run the migrations against the web app running in docker:

make db-migrate-docker

This will create a file in the ./db/migrate folder, and this file can be amended to reflect the change required.

Infrastructure

This application is running on Amazon Web Services (https://aws.amazon.com/console/) via ECS on Fargate.

Troubleshooting

postgres errors during bundle install

If you have postgres installed separately (e.g. with brew on MacOS), when running bundle install you may see an error installing the pg gem:

ERROR:  Error installing pg:
ERROR: Failed to build gem native extension.

An error occurred while installing pg (1.5.9), and Bundler cannot continue.

Try installing the pg gem separately, pointing to the location of the pg-config:

gem install pg -v '1.5.9' -- --with-pg-config=$(brew --prefix libpq)/bin/pg_config

ClamAV tests failing

There is a known issue where some laptops will block the EICAR file used to test the ClamAV antivirus tooling.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors