airTEXT provides air pollution, pollen, and UV forecasts for Greater London and nearby areas. Users can subscribe to receive air quality alerts via email, SMS, or voicemail for their chosen location.
See getting started
To start the Rails server, run:
rails server
You can then access the application in your web browser at
http://localhost:3000
.
To update Ruby gems, run:
bundle update
To update JavaScript dependencies, run:
yarn upgrade
See [doc/upgrading-node.md][] for instructions on how to update the Node.js version used in this project.
See [doc/upgrading-ruby.md][] for instructions on how to update the Ruby version used in this project.
These tests (Rspec and Capybara) can be run with:
bundle exec rspec
Before committing you should run our complete set of checks and tests.
Choose from either the dockerised or undockerised version of the supplied comprehensive test script which includes:
- formatting files with
prettier
- checking scripts with
shellcheck
- linting Ruby files with
standardrb
- linting JS with
eslint
- linting CSS with
stylelint
- running automated test suite with
rspec
- running API specs and generating OpenAPI spec via the
rswag_api_tests_with_docs
rake
task - analysing vulnerabilities in Ruby gems with
brakeman
e.g.
./script/no-docker/test
We use ADRs to document architectural decisions that we make. They can be found in doc/architecture/decisions and contributed to with the adr-tools.
We use Dotenv to manage our environment variables locally.
The repository will include safe defaults for development in /.env.example
and
for test in /.env.test
. We use 'example' instead of 'development' (from the
Dotenv docs) to be consistent with current dxw conventions and to make it more
explicit that these values are not to be committed.
To manage sensitive environment variables:
- Add the new key and safe default value to the
/.env.example
file eg.ROLLBAR_TOKEN=ROLLBAR_TOKEN
- Add the new key and real value to your local
/.env.development.local
file, which should never be checked into Git. This file will look something likeROLLBAR_TOKEN=123456789
CERC_FORECAST_API_HOST_URL
: find the URL of the CERC API host in the 1Password vaultCERC_FORECAST_API_KEY
: find the API key in the 1Password vaultCERC_FORECAST_API_CACHE_LIMIT_MINS
: how often we expire our cached forecastsCERC_SUBSCRIBER_API_HOST_URL
: find the URL of the CERC API host in the 1Password vaultCERC_SUBSCRIBER_API_KEY
: find the API key in the 1Password vaultMAPTILER_API_KEY
: used for vector tiles display within Leaflet. Dev and prod keys are in the 1Password vault
The service is deployed to Heroku at https://air-text-3e4548b53179.herokuapp.com/.
This repository was bootstrapped from
dxw's rails-template
.