Skip to content

How It Works

Each tenant site has its own keyspace, domains and feature switches. Redfly signs people in, Solr powers search and the map, and chat fans out live over Pulsar.

Tenancy

The keyspace caulight_control holds the tenant registry: slug, display name, time zone, status, description, hero text, feature switches, default_theme and clock_24h, plus keyspace_name, solr_core and redfly_tenant, with the lookups tenant_by_slug, tenant_domain and tenant_domain_by_hostname.

Each tenant has its own keyspace, caulight_<tenant id as 32 hex>, built from the tenant template with NetworkTopologyStrategy {<dc>: 3}.

Resolving the tenant on each request

  1. Host → tenant_domain_by_hostname → tenant → keyspace.
  2. The PASETO ten claim must include the tenant’s redfly_tenant.

Provisioning

From the platform site: create the keyspace, apply the migrations, run the data steps, create the Solr core and register the tenant in Redfly.

Sign-in and roles

  • Redfly handles sign-in. The Shiro realm RedflyTokenRealm verifies the PASETO and checks the revocation deny-list.
  • It maps sub to app_user.redfly_user_id. On first visit, an onboarding form creates the profile: name, city, interests, supporter flag, plain-language preference and intent.
  • The ICS feed /calendar/<token>.ics carries a random token; Caulight stores only its SHA-256. It is read-only, limited to the user’s own bookings, and can be regenerated.
RolePermissions
administratorEvery permission
program_managerreports:review, groups:moderate, invite, users:read, hosts:approve, experiences:read, bookings:read, plus everything an explorer has
hostexperiences:write (own), occurrences:write (own), bookings:read (own), conversations:write, plus everything an explorer has
supporteract-for (for linked explorers), plus everything an explorer has
explorerexperiences:read, bookings:write (own), reviews:write (own), favorites:write (own), groups:read, groups:join, posts:write (own), discussions:read, discussions:write, conversations:write, reports:create, notifications:read (own), profile:write (own)

“(own)” means the handler also checks that the record’s owner column matches the caller, or an explorer linked to a supporter caller.

Search and map

One Solr core per tenant, caulight_<tenant hex>, updated through persistent://odssbc/caulight/index, which every replica consumes through an Exclusive subscription.

DocumentIndexed fields
experienceTitle, description, categories, accessibility features, host, price band, and location as location_rpt for geo search and the public map
personHandle, display name, city and interests, for public profiles only
groupName and description
discussionGroup name, message text and tags

Chat and notifications

  • Discussions and conversations are stored in Cassandra first, then published to persistent://odssbc/caulight/chat, keyed by <tenant>:<group|conversation>.
  • Replicas fan messages out over WebSocket while CAULIGHT_LIVE_PULSAR_ENABLED is on.
  • Booking updates, messages and recommendations go by SMS through Redfly POST /v1/notify/sms, following each user’s sms_* preferences.

Generated API

One controller per tenant table under /api/v1/<table>, generated from the CQL. Every handler resolves the tenant keyspace, checks @RequiresPermissions("<prefix>:read|write"), assigns a UUIDv7 id on POST, keeps *_by_* lookup tables up to date with LWT (409 on conflict) and writes an audit row. List requests take a limit of at most 500 and return a paging-state token.

PrefixTables
experiencesexperience, experience_category, experience_accessibility_feature, occurrence, stored_image
catalogcategory, accessibility_feature
bookings / reviews / favoritesbooking / review / favorite
hostshost_application
groupssocial_group, social_group_member, social_group_join_request, social_group_invite, social_post, social_comment, social_reaction
discussionsdiscussion_group, discussion_member, discussion_message, discussion_tag, discussion_mention, discussion_attachment
conversationsconversation, conversation_participant, message
notifications / reports / supporters / invitenotification / report / supporter_link / site_invitation
users / rolesapp_user / shiro_role, shiro_role_permission, shiro_user_role

Files

Images and attachments are stored in S3-compatible object storage at s3://<bucket>/caulight/<tenant>/<storage_key>; Cassandra keeps metadata only.

Ports

PortBindPurpose
8445pod IPHTTPS: web UI, generated API, ICS feeds, health
7000pod IP, TLSCassandra internode traffic
9042127.0.0.1CQL native (app → embedded Cassandra)
2181127.0.0.1SunLink ZooKeeper protocol (Curator)
7480pod IP, mTLSSunLink Raft ring between replicas
6379127.0.0.1SeaWave RESP (Spring Session, deny-list)
7481pod IP, mTLSSeaWave peer replication

Key environment variables

VariablePurpose
CAULIGHT_CASSANDRA_DATA_DIR, _DC, _SEEDSEmbedded Cassandra
CAULIGHT_SOLR_DATA_DIREmbedded Solr (one core per tenant)
CAULIGHT_LIVE_PULSAR_ENABLEDLive chat fan-out, default true
CAULIGHT_REDFLY_URLRedfly base URL
CAULIGHT_PLATFORM_HOSTHostname of the platform site
CAULIGHT_S3_ENDPOINT / _BUCKET / _CREDENTIALS_FILEImage and attachment storage