Skip to main content

Workshed, Loom & Ribbon Migration Strategy

Overview

This document describes the migration strategy for the program scheduling system from the POC backdoor (React) to the production admin interface (vanilla JS SPA). The system uses a textile metaphor to describe the three architectural layers that transform program definitions into viewable daily schedules.


The Metaphor

The scheduling system follows a weaving metaphor that maps naturally to the data flow:

LayerMetaphorRoleDescription
WorkshedPlanningProgram Creator & SettingsWhere the program is designed — templates, rules, participants, staff, and vehicles
LoomWeavingBackend EngineThe engine that takes the plan and weaves it into concrete daily instances
RibbonViewingRoster & ScheduleThe finished output — viewable, navigable daily rosters and schedules
Workshed (Design) → Loom (Generate) → Ribbon (View)
Plan the Weave the See the
program instances roster

Architecture Mapping

POC to Production Component Map

ConceptPOC (backdoor)Target (admin)Backend Route
Workshed (Wizard)ProgramTemplateWizard.jsxpage_prog_create.htmltemplates.js
Workshed (Editor)N/Aprog_dashboard.htmltemplates.js
Command Center (Live)N/Aprog_timeline.htmlinstances.js
Command Center (Attn)N/Aprog_cancellations.htmlenrollments.js
Command Center (Res)N/Aprog_resources.htmlresources.js
Loom/finalize APIpage_schedule.htmlloom.js, util_syncRethread.js
RibbonRoster.jsxpage_roster.htmlroster.js

Several target pages (Editor, Command Center views) have no POC equivalent — they are net-new functionality in the admin interface.


Migration Status

Completed Work

ComponentStatusDetails
Database migrationDoneMigrated from rules_* tables to program_templates schema
Backend route portsDoneAll routes ported to routes_v1p (API v1 path)
Frontend wizardDoneFull program creation wizard with 6 tabs
Command Center layoutDoneUnified layout for Live, Attention, and Resources views

Wizard Tab Structure

The program creation wizard (page_prog_create.html) contains six configuration tabs:

TabPurpose
DetailsProgram name, description, category, and metadata
VenueLocation selection and facility configuration
Time SlotsDay-of-week scheduling, start/end times, recurrence
ParticipantsEnrolment rules, capacity limits, participant selection
StaffStaff assignment rules, required qualifications, ratios
VehiclesVehicle allocation, accessibility requirements, transport rules

Settings Architecture

The system uses a 3-tier settings hierarchy where each level has a distinct scope and storage location.

PageScopeStorage
page_settings.htmlUser — individual preferencesadmin_profiles.*
page_app-settings.htmlAdmin App — application-wide defaultsadmin.app_settings
page_loom-settings.htmlOrganisation — system-wide scheduling rulesadmin.app_settings

Loom Settings

The Loom settings page (page_loom-settings.html) manages organisation-level scheduling parameters stored in the loom_shift_settings JSON column within admin.app_settings.

Key configuration values:

{
"loom_shift_settings": {
"threshold_staff": 2,
"threshold_vehicle": 1
}
}
SettingTypeDescription
threshold_staffintegerMinimum number of staff required before the Loom will generate a shift instance
threshold_vehicleintegerMinimum number of vehicles required before the Loom will generate a transport instance

These thresholds prevent the Loom from generating incomplete or understaffed program instances.


Data Flow

From Design to Roster

1. Workshed: Admin creates program template via wizard

2. Template saved to program_templates with all rules

3. Loom: /finalize API triggered (manual or scheduled)

4. Loom reads template rules + settings thresholds

5. Loom generates concrete daily instances

6. util_syncRethread.js handles conflict resolution

7. Ribbon: page_roster.html renders the woven schedule

Sync and Rethreading

The util_syncRethread.js utility handles:

  • Detecting conflicts between generated instances and manual overrides
  • Re-weaving affected instances when template rules change
  • Maintaining referential integrity between enrollments and instances

Backend Route Files

All scheduling backend routes reside in backend/routes_v1p/:

FileResponsibility
templates.jsProgram template CRUD and wizard data
instances.jsGenerated instance management (Command Center Live)
enrollments.jsParticipant enrolment and cancellation tracking
resources.jsResource allocation and availability
loom.jsInstance generation engine
util_syncRethread.jsConflict resolution and rethreading utility
roster.jsRoster view data aggregation

Summary

The Workshed–Loom–Ribbon migration moves program scheduling from the React-based POC into the production admin SPA. The database schema has been migrated, backend routes ported, and the frontend wizard completed with a unified Command Center layout. The 3-tier settings architecture ensures that scheduling thresholds and preferences are configurable at user, application, and organisation levels, with the Loom engine respecting all tiers when weaving program templates into daily roster reality.