bearriver2 is a Ruby on Rails application used to run the Bear River Writers' Conference registration flow end-to-end. It supports applicant sign-up, application submission, conference configuration, payment processing callbacks, and administrative operations through ActiveAdmin.
- Accepts user registrations and conference applications.
- Stores annual conference configuration (
ApplicationSetting) and derives current conference year behavior from the active setting. - Supports lodging and partner registration selections that feed cost and balance calculations.
- Integrates with a hosted payment gateway flow and records payment receipts.
- Provides admin management via ActiveAdmin for conference operations.
- Sends transactional emails for application events and balance due messaging.
- Ruby
3.4.9 - Rails
7.2.2 - PostgreSQL
- Hotwire (
turbo-rails,stimulus-rails) - ActiveAdmin
- Devise authentication (users + admin users)
- RSpec + FactoryBot
- RuboCop (Rails profile)
- Front-end bundling:
jsbundling-railswithesbuildcssbundling-railswithsass+postcss
User: conference applicant account (Devise auth).Application: conference submission associated to a user and scoped byconf_year.ApplicationSetting: annual/admin-configurable conference settings; exactly one record should be active.Payment: user payment records (gateway and manual entries), tied toconf_year.- Supporting lookup/config models:
Workshop,Lodging,PartnerRegistration,Gender.
- User signs up/logs in.
- User submits
Application. - App computes costs from selected lodging/partner options and optional subscription.
- User is redirected to payment gateway for payment.
- Gateway callback posts receipt data to
payment_receipt, where it is validated/recorded. - User/admin can review payments and balances.
Install the following locally:
- Ruby
3.4.9 - Bundler
- Node.js + Yarn
- PostgreSQL (running locally)
- Redis (used by Action Cable in development)
bundle install
yarn installThis app expects encrypted Rails credentials and some environment variables.
- Ensure
config/master.keyis available locally (or provideRAILS_MASTER_KEY). - Set required environment variables where applicable:
DATABASE_URL(staging/production)REDIS_URL(production Action Cable; optional in local if using defaults)SENDGRID_API_KEY(production mail delivery)
The payment gateway integration reads these Rails credentials keys:
NELNET_SERVICE.DEVELOPMENT_KEYNELNET_SERVICE.DEVELOPMENT_URLNELNET_SERVICE.PRODUCTION_KEYNELNET_SERVICE.PRODUCTION_URLNELNET_SERVICE.SERVICE_SELECTOR(for QA/dev selection behavior)
Devise mailer sender is read from:
devise.mailer_sender
bin/rails db:create
bin/rails db:migrate
bin/rails db:seedPreferred (runs Rails + JS + CSS watchers via foreman):
bin/devThis starts:
- Rails server (
web) - JS bundler watch (
js) - CSS build/watch (
css)
App will be available at http://localhost:3000.
- User auth routes are provided by Devise (
/users/...). - Admin interface is mounted with ActiveAdmin.
- Seed data creates a development-only admin user:
- Email:
admin@example.com - Password:
password
- Email:
Change or remove this immediately outside local development.
- Root:
/ - Applications:
/applications - Payments:
/payments/make_payment/payment_receipt(gateway callback endpoint)
- Static pages:
/about/contact/privacy/terms_of_service
Run the full test suite:
bundle exec rspecRun a focused spec file:
bundle exec rspec spec/requests/payments_spec.rbbundle exec rubocopdevelopmentandstaginguseletter_opener_webtooling for local/staging preview.productionuses SMTP (SendGrid), configured inconfig/environments/production.rb.
In development/staging, preview mail at:
/letter_opener
stagingandproductionuseDATABASE_URL.productionenforces SSL (config.force_ssl = true).- Ensure credentials and environment variables are set before boot.
- Precompile assets for production deploys:
bin/rails assets:precompile- Keep exactly one
ApplicationSettingrecord active to avoid ambiguous "current conference" behavior. - Payment totals are stored as strings representing cents in parts of the flow; preserve conversion logic when modifying payment code.
- Gateway callback validation is security-sensitive; treat changes to receipt verification paths as high risk and cover with request/service tests.
# Start all local services
bin/dev
# Prepare DB from scratch
bin/rails db:drop db:create db:migrate db:seed
# Run tests and lints
bundle exec rspec
bundle exec rubocop-
ActiveSupport::MessageEncryptor::InvalidMessage
Missing/incorrectmaster.keyfor encrypted credentials. -
Database connection errors
Verify local PostgreSQL is running and database/user access is configured. -
Asset build issues
Re-runyarn installand start viabin/devso JS/CSS watchers are active. -
Payment redirect issues in local
ConfirmNELNET_SERVICEcredential values and environment selection logic.
- Create a feature branch from
staging. - Add/adjust tests for behavior changes.
- Run specs and RuboCop locally.
- Open a PR with clear behavior notes and risk areas (especially payments/admin flows).