Hypertext Rails

Documentation

Getting Started

Communication Center

Procore / Project Groups

Analytics Database

Other Features

PepTalk Client App (Rails)

This repository contains the client-facing PepTalk Rails application used for admin operations, integrations, communication workflows, and reporting dashboards.

Current Tech Snapshot

  • Ruby 3.1.2
  • Rails 7.0.x
  • Admin UI via ActiveAdmin
  • Auth via Devise (admin users and users)
  • Background processing via Delayed::Job (rake jobs:work)
  • Frontend assets are mostly served from static public/ paths, with targeted Rails asset usage for editor/admin JS

High-Level Product Areas (Current)

  • ActiveAdmin back office: operational management for projects, workflows, templates, imports, deliveries, delayed jobs, and related data.
  • Communication Center: templates, stakeholders/personas, cadence rules, workflows, delivery scheduling, analytics exports.
  • Performance Metrics: dashboard and incident upload/reporting flow.
  • Integrations Hub: pages and settings for Procore, Sitemetric, Microsoft Teams, and BI/Looker entry points.
  • Webhooks and tracking: Twilio inbound/status, SES webhooks, email click/open tracking routes.

Data / Database Pattern

This app uses a mixed database setup:

  • Primary app DB (sqlite in dev/test, postgres in production-like envs).
  • Additional external postgres connections for Pepcore data (pepcore_* connections in config/database.yml).
  • Some models inherit from ApplicationRecord (primary DB), while external-data models can use a dedicated base class (PepcoreBase with establish_connection :pepcore_data).

Environment Variables and Secrets (Current State)

There are currently multiple sources in use:

  1. OS-level environment variables (ENV[...] / ENV.fetch(...)) throughout app config.
  2. .env (via dotenv-rails) for local development convenience.
  3. config/application.yml (via figaro) as another env var source.
  4. Rails encrypted credentials (config/credentials.yml.enc + config/master.key) used at least as fallback for Twilio config.

Notes:

  • config/secrets.yml is present but uses ENV["SECRET_KEY_BASE"].
  • Active Record encryption keys are read from environment variables in config/application.rb.

Background Jobs

  • Delayed Job table exists in schema (delayed_jobs).
  • Worker process command is bundle exec rake jobs:work.
  • Queue-specific worker config exists in config/.service.yml (for example default and scheduled_post_queue).

Running Locally (First Draft)

Prerequisites likely required:

  • Ruby 3.1.2
  • Bundler
  • Node/Yarn (project uses Yarn with esbuild)
  • Database access as needed for external Pepcore connections

Typical setup:

  1. Install gems: bundle install
  2. Install JS deps: yarn install
  3. Build JS assets when needed: yarn build
  4. Setup app: bin/setup
  5. Run app server: bin/rails server
  6. Run worker separately (when testing async flows): bundle exec rake jobs:work

Known Integrations / External Services

  • Procore
  • Sitemetric
  • Microsoft Teams
  • Twilio (SMS + webhook endpoints)
  • AWS SES/SNS (email event webhook flow)
  • Sentry
  • DigitalOcean Spaces (active storage/object storage config)