Things that commonly trip up developers new to BOPS.
BOPS is organized as 11 Rails engines. Each engine has its own:
spec/directory for tests- Routes mounted under specific paths
- Models and controllers scoped to its functionality
When running specs, target the specific engine:
docker compose --profile console run --rm console rspec engines/bops_core
docker compose --profile console run --rm console rspec engines/bops_admin- Request specs: Use
planx.bops.servicesas the host - System specs: Require correct subdomain setup for the local authority being tested
BOPS has 600+ existing migrations. Rules:
- Never modify old migrations - Create new migrations instead
- Use strong_migrations patterns for safe deployments
- Test migrations both up and down
The database requires the PostGIS extension for geospatial features. If you see errors about missing spatial functions, ensure PostGIS is properly installed and enabled.
Email and SMS are sent via GOV.UK Notify, not ActionMailer directly.
- Set
NOTIFY_API_KEYenvironment variable (use mock value for local development) - Templates are managed in the GOV.UK Notify dashboard
- See
app/mailers/for integration patterns
To enable 2FA locally:
- Set
OTP_SECRET_ENCRYPTION_KEYandNOTIFY_API_KEY(from 1password) - Set
otp_required_for_login: trueon the user record - Use an authenticator app to complete login
BOPS uses an OpenLayers-powered Web Component from Open Systems Lab. Set OS_VECTOR_TILES_API_KEY in .env for full map functionality (value in AWS Parameter Store).
After adding a new Stimulus controller, run:
./bin/rails stimulus:manifest:updateOr create controllers with the generator:
./bin/rails generate stimulus controllerName