This is the codebase for the Ruby on Rails app that will handle the submission of sponsorship requests.
- Deployment Pipeline
- System Context Diagram
- Container Diagram
- Component Diagram
- Monitoring
- Related Repositories
- Development
- Database Migrations
- Infrastructure
The, C4 system context diagram is intended to show, at the highest level, the key users and interactions in the system.
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.
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.
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
- Docker
- asdf
- Ruby (recommend installing
rbenvto install/manage the Ruby version)
You may need to install some supporting packages (note the instructions from brew re adding them to your PATH):
brew install icu4c libpqInstall required runtimes, dependencies etc:
make prepareTo run the web application natively outside of a docker container on your machine:
make runThis 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/
To build and tag the web application image:
docker build . -t ukraine-sponsor-resettlementTo run the web application and all it's dependencies:
make run-webapp-dockerThis 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.
Run:
make testNB: 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.
This repository features automated tests run using Cypress
To run the cypress tests against a running instance of the web application:
make cypress-e2e-testDetailed end-to-end tests setup and instructions
Database migrations are required to make changes to the database
make db-migrateOr to run the migrations against the web app running in docker:
make db-migrate-dockerThis will create a file in the ./db/migrate folder, and this file can be amended to reflect the change required.
This application is running on Amazon Web Services (https://aws.amazon.com/console/) via ECS on Fargate.
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_configThere is a known issue where some laptops will block the EICAR file used to test the ClamAV antivirus tooling.