This is the codebase for the Ruby on Rails app that will handles 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 Grafana and push to the following destinations:
- #homes-for-ukraine-alerts, DLUHC managed Slack channel
- PagerDuty, MadeTech managed instance.
- Email to the team. (Find the email address defined in the grafana alerts)
- Prometheus Exporter repository
- Gov PAAS Prometheus Exporter, documents the metrics available in Grafana.
- Docker
Run:
make run
In case of any error, run these two commands before make run
:
bundle exec rake webpacker:install
bundle exec rails assets:precompile
The Rails server should start on http://localhost:8080
Either visit http://localhost:8080/sponsor-a-child/ or http://localhost:8080/expression-of-interest/
Run: make test
NB: This builds a Docker image and sets up an environment for running tests depending on PostgresQL, Redis and S3. The container will be destroyed when the tests complete, which means that the coverage report will be lost.
If you want the coverage report, you can keep the container alive by editing /bin/test.sh to do
RAILS_ENV=test rake db:prepare && rake db:migrate && rake && tail -f /dev/null
instead of terminating when the rake task which runs the tests has finished. (tail -f /dev/null
is a benign way of keeping the container active).
When the tests have completed you can copy the coverage report to your docker host's local filesystem by doing
docker cp <container ID or name>:/app/coverage <destination path on host>
on the host. For example, to copy to the coverage report to the current working directory on the host:
docker cp ukraine-sponsor-resettlement-test-1:/app/coverage .
You can then terminate the testing container with ctrl-c.
This repository features automated tests run through Cypress. Setup and instructions can be found here
Database migrations are required to make changes to the database
rails generate migration <name of migration>
This 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/).